X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=clusterclassic.cpp;h=32a9341613d07274d397c1ea9cc9d6b8d9383826;hp=ba1f7f68801d3451025d928f434c63ba094b1877;hb=b206f634aae1b4ce13978d203247fb64757d5482;hpb=529ec122f7cac4af987e121d150b878d7c7a0d5d diff --git a/clusterclassic.cpp b/clusterclassic.cpp index ba1f7f6..32a9341 100644 --- a/clusterclassic.cpp +++ b/clusterclassic.cpp @@ -597,16 +597,12 @@ void ClusterClassic::setMapWanted(bool f) { //parse bin string names = list->get(i); - while (names.find_first_of(',') != -1) { - //get name from bin - string name = names.substr(0,names.find_first_of(',')); + vector binnames; + m->splitAtComma(names, binnames); + for (int j = 0; j < binnames.size(); j++) { //save name and bin number - seq2Bin[name] = i; - names = names.substr(names.find_first_of(',')+1, names.length()); + seq2Bin[binnames[j]] = i; } - - //get last name - seq2Bin[names] = i; } } @@ -619,17 +615,13 @@ void ClusterClassic::setMapWanted(bool f) { void ClusterClassic::updateMap() { try { //update location of seqs in smallRow since they move to smallCol now - string names = list->get(smallRow); - while (names.find_first_of(',') != -1) { - //get name from bin - string name = names.substr(0,names.find_first_of(',')); - //save name and bin number - seq2Bin[name] = smallCol; - names = names.substr(names.find_first_of(',')+1, names.length()); - } - - //get last name - seq2Bin[names] = smallCol; + string names = list->get(smallRow); + vector binnames; + m->splitAtComma(names, binnames); + for (int j = 0; j < binnames.size(); j++) { + //save name and bin number + seq2Bin[binnames[j]] = smallCol; + } } catch(exception& e) {