Scaffolding  0.1
This program can assemble genome scaffolds using the pairing information in paired-end reads.
Public Member Functions | Friends | List of all members
scaffold::PermissiveMatching Class Reference

Public Member Functions

 PermissiveMatching (const unordered_map< byte, byte > *edges=NULL)
 construct from an unordered_map More...
 
 PermissiveMatching (const PermissiveMatching &P)
 copy constructor
 
 ~PermissiveMatching ()
 destructor
 
 operator size_t () const
 conversion to size_t, for hash calculation
 
const byte & operator[] (const byte i) const
 access to the array
 
byte & operator[] (const byte i)
 access to the array
 
bool introduce_edge (const byte u, const byte v)
 introduce an edge uv, unless uv is already present OR the insertion would violate the matching constraint; return whether uv was inserted
 
bool is_identity () const
 return whether everyone matches to itself
 
void permute (const BytePermutation &perm)
 rename the indices according to the given BytePermutation More...
 
PathsAndCycles merge_with (const PermissiveMatching &P, const std::bitset< ARRAY_LENGTH > &deg1_in_both)
 TODO: move this out of the permissive matching class as it's unique to the DP code & this should be a more general class. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const PermissiveMatching &P)
 

Constructor & Destructor Documentation

scaffold::PermissiveMatching::PermissiveMatching ( const unordered_map< byte, byte > *  edges = NULL)
inline

construct from an unordered_map

the given map does not have to be a permutation on 1..n; if it is not, then all indices that are not assigned by edges are set to identity

Member Function Documentation

PathsAndCycles scaffold::PermissiveMatching::merge_with ( const PermissiveMatching P,
const std::bitset< ARRAY_LENGTH > &  deg1_in_both 
)
inline

TODO: move this out of the permissive matching class as it's unique to the DP code & this should be a more general class.

merge this matching with a given one and return the number of paths and cycles that are closed below this DP node deg1_in_both should contain all vertices with degree 1 in both me and P – they are used to count the number of finished paths

void scaffold::PermissiveMatching::permute ( const BytePermutation perm)
inline

rename the indices according to the given BytePermutation

For example, suppose our matching is (0,1,3,2), meaning there is an edge between 2 & 3. Now, if we relabel using (3,2,1,0), that is, rename 0 to 3, rename 1 to 2, rename 2 to 1, rename 3 to 0), then we get (1,0,2,3), that is, a matching consisting of an edge between 0 and 1 (who were known as 2 & 3 before)


The documentation for this class was generated from the following file: