X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=getoturepcommand.cpp;h=6daad979d741f56290ac7e40979de956a705e1ee;hb=fe342304a0fdff3ab48226e1dcfdab95d3a94a64;hp=064455f49e28538c95858ba574dc9ef3b0cc9289;hpb=9653c9f8c1b63ecb1a63b45e781c303713d5b5df;p=mothur.git diff --git a/getoturepcommand.cpp b/getoturepcommand.cpp index 064455f..6daad97 100644 --- a/getoturepcommand.cpp +++ b/getoturepcommand.cpp @@ -20,11 +20,19 @@ GetOTURepCommand::GetOTURepCommand(){ if(globaldata->gListVector != NULL) { listOfNames = new ListVector(*globaldata->gListVector); + vector names; + string binnames; //map names to rows in sparsematrix for (int i = 0; i < listOfNames->size(); i++) { - nameToIndex[listOfNames->get(i)] = i; + names.clear(); + binnames = listOfNames->get(i); + splitAtComma(binnames, names); + + for (int j = 0; j < names.size(); j++) { + nameToIndex[names[j]] = i; + } } - }else { cout << "error" << endl; } + }else { cout << "error, no listvector." << endl; } fastafile = globaldata->getFastaFile(); @@ -176,7 +184,7 @@ string GetOTURepCommand::FindRep(int bin) { string minName; binnames = list->get(bin); - + //parse names into vector splitAtComma(binnames, names); @@ -186,6 +194,7 @@ string GetOTURepCommand::FindRep(int bin) { //fill binMap for (int i = 0; i < names.size(); i++) { for (it3 = nameToIndex.begin(); it3 != nameToIndex.end(); it3++) { + if (it3->first == names[i]) { binMap[it3->second] = it3->first;