* 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
| 134 | * branch. |
| 135 | */ |
| 136 | static inline bool |
| 137 | processLinearExtensionForBranch(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 |
no test coverage detected