X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=readtree.cpp;h=e8aeacc4431688ca0dfc8f94bf546c1fea2a91dd;hb=7762fd5ec7582a78a31bb690a5c05b76e5b899c2;hp=8158a577f478b71139ce5c6f91eeb9dedc4b0d62;hpb=f40e9e38c5604fdbe90f964fc26eca7758e6257f;p=mothur.git diff --git a/readtree.cpp b/readtree.cpp index 8158a57..e8aeacc 100644 --- a/readtree.cpp +++ b/readtree.cpp @@ -129,7 +129,10 @@ int ReadNewickTree::read() { } //if you are a nexus file }else if ((c = filehandle.peek()) == '#') { - holder = nexusTranslation(); //reads file through the translation and updates treemap + //get right number of seqs from nexus file. + Tree* temp = new Tree(); delete temp; + + nexusTranslation(); //reads file through the translation and updates treemap while((c = filehandle.peek()) != EOF) { // get past comments while ((c = filehandle.peek()) != EOF) { @@ -179,7 +182,7 @@ string ReadNewickTree::nexusTranslation() { try { holder = ""; - //int numSeqs = globaldata->gTreemap->getNumSeqs(); //must save this some when we clear old names we can still know how many sequences there were + int numSeqs = globaldata->Treenames.size(); //must save this some when we clear old names we can still know how many sequences there were int comment = 0; // get past comments @@ -197,7 +200,7 @@ string ReadNewickTree::nexusTranslation() { //update treemap globaldata->gTreemap->namesOfSeqs.clear(); - char c; + /*char c; string number, name; while ((c = filehandle.peek()) != EOF) { @@ -213,7 +216,15 @@ string ReadNewickTree::nexusTranslation() { if ((name == "tree") || (name == ";") ) { break; } if (lastChar == ',') { name.erase(name.end()-1); } //erase the comma - + */ + cout << "numseqs = " << numSeqs << endl; + string number, name; + for(int i=0;i> number; + filehandle >> name; + name.erase(name.end()-1); //erase the comma + //insert new one with new name string group = globaldata->gTreemap->getGroup(name); globaldata->gTreemap->treemap[toString(number)].groupname = group;