Return the sequence of the specified contig node. The sequence * may be ambiguous or reverse complemented. */
| 157 | * may be ambiguous or reverse complemented. |
| 158 | */ |
| 159 | static Sequence |
| 160 | sequence(const Contigs& contigs, const ContigNode& id) |
| 161 | { |
| 162 | if (id.ambiguous()) { |
| 163 | string s(id.ambiguousSequence()); |
| 164 | if (s.length() < opt::k) |
| 165 | transform(s.begin(), s.end(), s.begin(), ::tolower); |
| 166 | return string(opt::k - 1, 'N') + s; |
| 167 | } else { |
| 168 | const Sequence& seq = contigs[id.id()].seq; |
| 169 | return id.sense() ? reverseComplement(seq) : seq; |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | /** Return a consensus sequence of a and b. |
| 174 | * @return an empty string if a consensus could not be found |
no test coverage detected