MCPcopy Create free account
hub / github.com/BirolLab/abyss / processLinearExtensionForBranch

Function processLinearExtensionForBranch

Assembly/TrimAlgorithm.h:136–179  ·  view source on GitHub ↗

* Process the extension for this branch for the trimming algorithm * CurrSeq is the current sequence being inspected (the next member to * be added to the branch). The extension record is the extensions of * that sequence and multiplicity is the number of times that kmer * appears in the data set. After processing currSeq is unchanged if * the branch is no longer active or else it is the gene

Source from the content-addressed store, hash-verified

134 * branch.
135 */
136static inline bool
137processLinearExtensionForBranch(BranchRecord& branch,
138 graph_traits<SequenceCollectionHash>::vertex_descriptor& currSeq,
139 SequenceCollectionHash::SymbolSetPair extensions,
140 int multiplicity,
141 unsigned maxLength, bool addKmer)
142{
143 typedef SequenceCollectionHash Graph;
144 typedef vertex_bundle_type<Graph>::type VP;
145
146 /** Stop contig assembly at palindromes. */
147 const bool stopAtPalindromes = !opt::ss && maxLength == UINT_MAX;
148
149 extDirection dir = branch.getDirection();
150 if (branch.isTooLong(maxLength)) {
151 // Too long.
152 branch.terminate(BS_TOO_LONG);
153 return false;
154 } else if (extensions.dir[!dir].isAmbiguous()) {
155 // Ambiguous.
156 branch.terminate(BS_AMBI_OPP);
157 return false;
158 } else if (stopAtPalindromes && currSeq.isPalindrome()) {
159 // Palindrome.
160 branch.terminate(BS_AMBI_SAME);
161 return false;
162 }
163
164 if (addKmer)
165 branch.push_back(std::make_pair(currSeq,
166 VP(multiplicity, extensions)));
167
168 if (branch.isTooLong(maxLength)) {
169 // Too long.
170 branch.terminate(BS_TOO_LONG);
171 return false;
172 } else if (stopAtPalindromes && currSeq.isPalindrome(dir)) {
173 // Palindrome.
174 branch.terminate(BS_AMBI_SAME);
175 return false;
176 }
177
178 return extendBranch(branch, currSeq, extensions.dir[dir]);
179}
180
181/** Trim the specified branch if it meets trimming criteria.
182 * @return true if the specified branch was trimmed

Callers 4

assembleFunction · 0.85
trimSequencesFunction · 0.85

Calls 7

extendBranchFunction · 0.85
isTooLongMethod · 0.80
terminateMethod · 0.80
getDirectionMethod · 0.45
isAmbiguousMethod · 0.45
isPalindromeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected