X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=treemap.cpp;h=5880b0c593fdd0dc96808e485921d96871e865d6;hb=c5c7502f435e1413c19e373dab1dfebcaa67588d;hp=fee309c5877138039c2ecdff8f54428a8060bc24;hpb=2e5ec5cbbd23637ed20da9bdd544d178a3b5d949;p=mothur.git diff --git a/treemap.cpp b/treemap.cpp index fee309c..5880b0c 100644 --- a/treemap.cpp +++ b/treemap.cpp @@ -144,3 +144,31 @@ void TreeMap::print(ostream& output){ } /************************************************************/ +void TreeMap::makeSim(GroupMap* groupmap) { + try { + //set names of groups + namesOfGroups = groupmap->namesOfGroups; + + //set names of seqs to names of groups + namesOfSeqs = groupmap->namesOfGroups; + + // make map where key and value are both the group name since that what the tree.groups command wants + for (int i = 0; i < namesOfGroups.size(); i++) { + treemap[namesOfGroups[i]].groupname = namesOfGroups[i]; + seqsPerGroup[namesOfGroups[i]] = 1; + } + + numGroups = namesOfGroups.size(); + + } + catch(exception& e) { + cout << "Standard Error: " << e.what() << " has occurred in the TreeMap class Function make. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + exit(1); + } + catch(...) { + cout << "An unknown error has occurred in the TreeMap class function make. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + exit(1); + } +} +/************************************************************/ +