Skip to content

Commit 036e1fd

Browse files
committed
Merge branch 'simulations' of https://github.com/raphael-group/machina into simulations
2 parents 3755505 + 3e06827 commit 036e1fd

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/basetree.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ bool BaseTree::read(std::istream& in)
137137
}
138138
}
139139

140+
if (_idToNode.empty())
141+
{
142+
std::cerr << "Error: empty tree" << std::endl;
143+
return false;
144+
}
145+
140146
init();
141147

142148
if (!isValid())

src/msenumeration.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,16 @@ void MSEnumeration::run(const MigrationTree& migrationTree,
199199
}
200200
outFile.close();
201201

202+
snprintf(buf, 1024, "%s/T%s%d.tree", _outputDirectory.c_str(), migrationTreeString.c_str(), i);
203+
std::ofstream outT(buf);
204+
entry->_T.write(outT);
205+
outT.close();
206+
207+
snprintf(buf, 1024, "%s/T%s%d.labeling", _outputDirectory.c_str(), migrationTreeString.c_str(), i);
208+
std::ofstream outLabeling(buf);
209+
entry->_T.writeVertexLabeling(outT, entry->_lPlus);
210+
outLabeling.close();
211+
202212
// snprintf(buf, 1024, "%s/phyloT%s%d.dot", _outputDirectory.c_str(), migrationTreeString.c_str(), i);
203213
// std::ofstream outFileT(buf);
204214
// gm::PerfectPhyloTree phyloT(solutions.solution(i).A(), solutions.solution(i).S());

0 commit comments

Comments
 (0)