X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=phylotree.cpp;h=6ca36361dc55fe6c204017486c98ebeea77e7a9c;hb=ae57e166b2ed7b475ec3f466106bd76fabadd063;hp=2ea219350c1f8bf8099b7cfc40d28ddcdfc9d872;hpb=050220fe7822cc660615972a0054cf4a83eefbe4;p=mothur.git diff --git a/phylotree.cpp b/phylotree.cpp index 2ea2193..6ca3636 100644 --- a/phylotree.cpp +++ b/phylotree.cpp @@ -55,24 +55,24 @@ PhyloTree::PhyloTree(ifstream& in, string filename){ delete buffer; //read version - getline(iss); gobble(iss); + m->getline(iss); m->gobble(iss); - iss >> numNodes; gobble(iss); + iss >> numNodes; m->gobble(iss); tree.resize(numNodes); for (int i = 0; i < tree.size(); i++) { - iss >> tree[i].name >> tree[i].level >> tree[i].parent; gobble(iss); + iss >> tree[i].name >> tree[i].level >> tree[i].parent; m->gobble(iss); } //read genus nodes int numGenus = 0; - iss >> numGenus; gobble(iss); + iss >> numGenus; m->gobble(iss); int gnode, gsize; totals.clear(); for (int i = 0; i < numGenus; i++) { - iss >> gnode >> gsize; gobble(iss); + iss >> gnode >> gsize; m->gobble(iss); uniqueTaxonomies[gnode] = gnode; totals.push_back(gsize); @@ -82,24 +82,24 @@ PhyloTree::PhyloTree(ifstream& in, string filename){ #else //read version - string line = getline(in); gobble(in); + string line = m->getline(in); m->gobble(in); - in >> numNodes; gobble(in); + in >> numNodes; m->gobble(in); tree.resize(numNodes); for (int i = 0; i < tree.size(); i++) { - in >> tree[i].name >> tree[i].level >> tree[i].parent; gobble(in); + in >> tree[i].name >> tree[i].level >> tree[i].parent; m->gobble(in); } //read genus nodes int numGenus = 0; - in >> numGenus; gobble(in); + in >> numGenus; m->gobble(in); int gnode, gsize; totals.clear(); for (int i = 0; i < numGenus; i++) { - in >> gnode >> gsize; gobble(in); + in >> gnode >> gsize; m->gobble(in); uniqueTaxonomies[gnode] = gnode; totals.push_back(gsize); @@ -131,7 +131,7 @@ PhyloTree::PhyloTree(string tfile){ #ifdef USE_MPI int pid, num, processors; - vector positions; + vector positions; MPI_Status status; MPI_File inMPI; @@ -144,7 +144,7 @@ PhyloTree::PhyloTree(string tfile){ MPI_File_open(MPI_COMM_WORLD, inFileName, MPI_MODE_RDONLY, MPI_INFO_NULL, &inMPI); //comm, filename, mode, info, filepointer if (pid == 0) { - positions = setFilePosEachLine(tfile, num); + positions = m->setFilePosEachLine(tfile, num); //send file positions to all processes for(int i = 1; i < processors; i++) { @@ -179,11 +179,11 @@ PhyloTree::PhyloTree(string tfile){ #else ifstream in; - openInputFile(tfile, in); + m->openInputFile(tfile, in); //read in users taxonomy file and add sequences to tree while(!in.eof()){ - in >> name >> tax; gobble(in); + in >> name >> tax; m->gobble(in); addSeqToTree(name, tax); } @@ -275,6 +275,8 @@ int PhyloTree::addSeqToTree(string seqName, string seqTaxonomy){ if (seqTaxonomy == "") { uniqueTaxonomies[currentNode] = currentNode; } } + + return 0; } catch(exception& e) { m->errorOut(e, "PhyloTree", "addSeqToTree"); @@ -365,7 +367,7 @@ void PhyloTree::binUnclassified(string file){ try { ofstream out; - openOutputFile(file, out); + m->openOutputFile(file, out); map::iterator itBin; map::iterator childPointer; @@ -519,7 +521,7 @@ void PhyloTree::printTreeNodes(string treefilename) { #endif ofstream outTree; - openOutputFile(treefilename, outTree); + m->openOutputFile(treefilename, outTree); //output mothur version outTree << "#" << m->getVersion() << endl;