From: pschloss Date: Thu, 26 Aug 2010 13:04:35 +0000 (+0000) Subject: changes to read.otu(list/shared) - took out substr calls X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=commitdiff_plain;h=87537e4ee46cae9b7041ae0ed4dbbc229936d37c changes to read.otu(list/shared) - took out substr calls --- diff --git a/groupmap.cpp b/groupmap.cpp index 47fbc36..0e0be0e 100644 --- a/groupmap.cpp +++ b/groupmap.cpp @@ -61,26 +61,28 @@ string GroupMap::getGroup(string sequenceName) { } /************************************************************/ + void GroupMap::setGroup(string sequenceName, string groupN) { groupmap[sequenceName] = groupN; } + /************************************************************/ void GroupMap::setNamesOfGroups(string seqGroup) { - int i, count; - count = 0; - for (i=0; i SharedListVector::getSharedRAbundVector() { //fill vectors for(int i=0;igetGroup(name); - if(group == "not found") { m->mothurOut("Error: Sequence '" + name + "' was not found in the group file, please correct."); m->mothurOutEndLine(); exit(1); } - finder[group]->set(i, finder[group]->getAbundance(i) + 1, group); //i represents what bin you are in + int nameLength = names.size(); + string seqName = ""; + + for(int j=0;jgetGroup(seqName); + if(group == "not found") { m->mothurOut("Error: Sequence '" + seqName + "' was not found in the group file, please correct."); m->mothurOutEndLine(); exit(1); } + finder[group]->set(i, finder[group]->getAbundance(i) + 1, group); //i represents what bin you are in + + seqName = ""; + } + else{ + seqName += names[j]; + } } + group = groupmap->getGroup(seqName); + if(group == "not found") { m->mothurOut("Error: Sequence '" + seqName + "' was not found in the group file, please correct."); m->mothurOutEndLine(); exit(1); } + finder[group]->set(i, finder[group]->getAbundance(i) + 1, group); //i represents what bin you are in + + + +// while (names.find_first_of(',') != -1) { +// name = names.substr(0,names.find_first_of(',')); +// names = names.substr(names.find_first_of(',')+1, names.length()); +// group = groupmap->getGroup(name); +// if(group == "not found") { m->mothurOut("Error: Sequence '" + name + "' was not found in the group file, please correct."); m->mothurOutEndLine(); exit(1); } +// finder[group]->set(i, finder[group]->getAbundance(i) + 1, group); //i represents what bin you are in +// } //get last name - group = groupmap->getGroup(names); - if(group == "not found") { m->mothurOut("Error: Sequence '" + names + "' was not found in the group file, please correct."); m->mothurOutEndLine(); exit(1); } - finder[group]->set(i, finder[group]->getAbundance(i) + 1, group); //i represents what bin you are in +// group = groupmap->getGroup(names); +// if(group == "not found") { m->mothurOut("Error: Sequence '" + names + "' was not found in the group file, please correct."); m->mothurOutEndLine(); exit(1); } +// finder[group]->set(i, finder[group]->getAbundance(i) + 1, group); //i represents what bin you are in } - + return lookup; } catch(exception& e) {