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

Method getChildren

RResolver/SequenceTree.cpp:59–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59std::vector<SequenceTreeNode>
60SequenceTreeNode::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
107const Sequence
108SequenceTreeNode::treeSequence() const

Callers 1

getTreeTracesFunction · 0.80

Calls 8

SequenceTreeNodeClass · 0.85
distanceBetweenFunction · 0.85
out_degreeFunction · 0.50
out_edgesFunction · 0.50
in_degreeFunction · 0.50
in_edgesFunction · 0.50
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected