| 57 | } |
| 58 | |
| 59 | std::vector<SequenceTreeNode> |
| 60 | SequenceTreeNode::getChildren(const int maxChildren) const |
| 61 | { |
| 62 | std::vector<SequenceTreeNode> children; |
| 63 | if (maxLength > treeSequenceLength) { |
| 64 | if (forward) { |
| 65 | int step = out_degree(*this, g_contigGraph) / maxChildren; |
| 66 | if (step <= 0) { |
| 67 | step = 1; |
| 68 | } |
| 69 | out_edge_iterator it, itLast; |
| 70 | for (std::tie(it, itLast) = out_edges(*this, g_contigGraph); it != itLast; |
| 71 | std::advance(it, step)) { |
| 72 | ContigNode outig = target(*it, g_contigGraph); |
| 73 | |
| 74 | children.push_back(SequenceTreeNode( |
| 75 | outig, |
| 76 | -distanceBetween(*this, outig), |
| 77 | maxLength - treeSequenceLength, |
| 78 | forward)); |
| 79 | if (int(children.size()) >= maxChildren) { |
| 80 | break; |
| 81 | } |
| 82 | } |
| 83 | } else { |
| 84 | int step = in_degree(*this, g_contigGraph) / maxChildren; |
| 85 | if (step <= 0) { |
| 86 | step = 1; |
| 87 | } |
| 88 | in_edge_iterator it, itLast; |
| 89 | for (std::tie(it, itLast) = in_edges(*this, g_contigGraph); it != itLast; |
| 90 | std::advance(it, step)) { |
| 91 | ContigNode intig = source(*it, g_contigGraph); |
| 92 | |
| 93 | children.push_back(SequenceTreeNode( |
| 94 | intig, |
| 95 | -distanceBetween(intig, *this), |
| 96 | maxLength - treeSequenceLength, |
| 97 | forward)); |
| 98 | if (int(children.size()) >= maxChildren) { |
| 99 | break; |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | return children; |
| 105 | } |
| 106 | |
| 107 | const Sequence |
| 108 | SequenceTreeNode::treeSequence() const |
no test coverage detected