X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=phylotree.cpp;fp=phylotree.cpp;h=2ea219350c1f8bf8099b7cfc40d28ddcdfc9d872;hb=050220fe7822cc660615972a0054cf4a83eefbe4;hp=e2b0805656064d0930de37933a1e599301573881;hpb=1d18c13c5d71e92ee850a0d8d7cda4f0ef530bf7;p=mothur.git diff --git a/phylotree.cpp b/phylotree.cpp index e2b0805..2ea2193 100644 --- a/phylotree.cpp +++ b/phylotree.cpp @@ -54,6 +54,9 @@ PhyloTree::PhyloTree(ifstream& in, string filename){ istringstream iss (tempBuf,istringstream::in); delete buffer; + //read version + getline(iss); gobble(iss); + iss >> numNodes; gobble(iss); tree.resize(numNodes); @@ -78,6 +81,9 @@ PhyloTree::PhyloTree(ifstream& in, string filename){ MPI_File_close(&inMPI); #else + //read version + string line = getline(in); gobble(in); + in >> numNodes; gobble(in); tree.resize(numNodes); @@ -474,6 +480,10 @@ string PhyloTree::getFullTaxonomy(string seqName) { void PhyloTree::print(ofstream& out, vector& copy){ try { + + //output mothur version + out << "#" << m->getVersion() << endl; + out << copy.size() << endl; out << maxLevel << endl; @@ -511,6 +521,9 @@ void PhyloTree::printTreeNodes(string treefilename) { ofstream outTree; openOutputFile(treefilename, outTree); + //output mothur version + outTree << "#" << m->getVersion() << endl; + //print treenodes outTree << tree.size() << endl; for (int i = 0; i < tree.size(); i++) {