X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=readtreecommand.cpp;h=19ab67531dc96e8929b258eef2a41b4d24538bc4;hb=2e5ec5cbbd23637ed20da9bdd544d178a3b5d949;hp=6af28ad7788a351e1a320aaf433c800c2c529f1b;hpb=d0939d3ab83988cc068f9ebe60596cf5decb65e5;p=mothur.git diff --git a/readtreecommand.cpp b/readtreecommand.cpp index 6af28ad..19ab675 100644 --- a/readtreecommand.cpp +++ b/readtreecommand.cpp @@ -22,6 +22,9 @@ ReadTreeCommand::ReadTreeCommand(){ //memory leak prevention //if (globaldata->gTreemap != NULL) { delete globaldata->gTreemap; } globaldata->gTreemap = treeMap; + + //get names in tree + globaldata->parseTreeFile(); read = new ReadNewickTree(filename); @@ -59,6 +62,23 @@ int ReadTreeCommand::execute(){ T[i]->assembleTree(); } + //output any names that are in names file but not in tree + if (globaldata->Treenames.size() < treeMap->getNumSeqs()) { + for (int i = 0; i < treeMap->namesOfSeqs.size(); i++) { + //is that name in the tree? + int count = 0; + for (int j = 0; j < globaldata->Treenames.size(); j++) { + if (treeMap->namesOfSeqs[i] == globaldata->Treenames[j]) { break; } //found it + count++; + } + + //then you did not find it so report it + if (count == globaldata->Treenames.size()) { + cout << treeMap->namesOfSeqs[i] << " is in your namefile and not in your tree. It will be disregarded." << endl; + } + } + } + return 0; } catch(exception& e) {