X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sequenceparser.cpp;h=fd94b246a43217cc9cbfa131bfe4cd672955e001;hb=2009a1a1f47e7467094d844e7c07ab8ddf7bb447;hp=e60f19b0df0034de0c1a693d7c5a55c59ef0ef82;hpb=c47e480b743d1c242b8c527b6d12f992c68b8c2c;p=mothur.git diff --git a/sequenceparser.cpp b/sequenceparser.cpp index e60f19b..fd94b24 100644 --- a/sequenceparser.cpp +++ b/sequenceparser.cpp @@ -7,7 +7,7 @@ * */ -#include "sequenceParser.h" +#include "sequenceparser.h" /************************************************************/ @@ -63,6 +63,8 @@ SequenceParser::SequenceParser(string groupFile, string fastaFile, string nameFi string first, second; int countName = 0; + set thisnames1; + while(!inName.eof()) { if (m->control_pressed) { break; } @@ -94,10 +96,12 @@ SequenceParser::SequenceParser(string groupFile, string fastaFile, string nameFi it = splitMap.find(group); if (it != splitMap.end()) { //adding seqs to this group (it->second) += "," + names[i]; + thisnames1.insert(names[i]); countName++; }else { //first sighting of this group splitMap[group] = names[i]; countName++; + thisnames1.insert(names[i]); //is this seq in the fasta file? if (i != 0) { //if not then we need to add a duplicate sequence to the seqs for this group so the new "fasta" and "name" files will match @@ -131,6 +135,15 @@ SequenceParser::SequenceParser(string groupFile, string fastaFile, string nameFi if (error == 1) { m->control_pressed = true; } if (countName != (groupMap->getNumSeqs())) { + vector groupseqsnames = groupMap->getNamesSeqs(); + + for (int i = 0; i < groupseqsnames.size(); i++) { + set::iterator itnamesfile = thisnames1.find(groupseqsnames[i]); + if (itnamesfile == thisnames1.end()){ + cout << "missing name " + groupseqsnames[i] << '\t' << allSeqsMap[groupseqsnames[i]] << endl; + } + } + m->mothurOutEndLine(); m->mothurOut("[ERROR]: Your name file contains " + toString(countName) + " valid sequences, and your groupfile contains " + toString(groupMap->getNumSeqs()) + ", please correct."); m->mothurOutEndLine(); @@ -303,6 +316,7 @@ int SequenceParser::getSeqs(string g, string filename, bool uchimeFormat=false){ } }else { + //m->mothurOut("Group " + g + " contains " + toString(seqForThisGroup.size()) + " unique seqs.\n"); for (int i = 0; i < seqForThisGroup.size(); i++) { if(m->control_pressed) { out.close(); m->mothurRemove(filename); return 1; }