2 * consensusseqscommand.cpp
5 * Created by westcott on 11/23/10.
6 * Copyright 2010 Schloss Lab. All rights reserved.
10 #include "consensusseqscommand.h"
11 #include "sequence.hpp"
12 #include "inputdata.h"
14 //**********************************************************************************************************************
15 vector<string> ConsensusSeqsCommand::setParameters(){
17 CommandParameter pfasta("fasta", "InputTypes", "", "", "none", "none", "none",false,true); parameters.push_back(pfasta);
18 CommandParameter pname("name", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pname);
19 CommandParameter plist("list", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(plist);
20 CommandParameter plabel("label", "String", "", "", "", "", "",false,false); parameters.push_back(plabel);
21 CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir);
22 CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir);
24 vector<string> myArray;
25 for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); }
29 m->errorOut(e, "ConsensusSeqsCommand", "setParameters");
33 //**********************************************************************************************************************
34 string ConsensusSeqsCommand::getHelpString(){
36 string helpString = "";
37 helpString += "The consensus.seqs command can be used in 2 ways: create a consensus sequence from a fastafile, or with a listfile create a consensus sequence for each otu. Sequences must be aligned.\n";
38 helpString += "The consensus.seqs command parameters are fasta, list, name and label.\n";
39 helpString += "The fasta parameter allows you to enter the fasta file containing your sequences, and is required, unless you have a valid current fasta file. \n";
40 helpString += "The list parameter allows you to enter a your list file. \n";
41 helpString += "The name parameter allows you to enter a names file associated with the fasta file. \n";
42 helpString += "The label parameter allows you to select what distance levels you would like output files for, and are separated by dashes.\n";
43 helpString += "The consensus.seqs command should be in the following format: \n";
44 helpString += "consensus.seqs(fasta=yourFastaFile, list=yourListFile) \n";
45 helpString += "Example: consensus.seqs(fasta=abrecovery.align, list=abrecovery.fn.list) \n";
46 helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n";
50 m->errorOut(e, "ConsensusSeqsCommand", "getHelpString");
55 //**********************************************************************************************************************
56 ConsensusSeqsCommand::ConsensusSeqsCommand(){
58 abort = true; calledHelp = true;
60 vector<string> tempOutNames;
61 outputTypes["fasta"] = tempOutNames;
62 outputTypes["name"] = tempOutNames;
63 outputTypes["summary"] = tempOutNames;
66 m->errorOut(e, "ConsensusSeqsCommand", "ConsensusSeqsCommand");
70 //***************************************************************************************************************
71 ConsensusSeqsCommand::ConsensusSeqsCommand(string option) {
73 abort = false; calledHelp = false;
76 //allow user to run help
77 if(option == "help") { help(); abort = true; calledHelp = true; }
78 else if(option == "citation") { citation(); abort = true; calledHelp = true;}
82 vector<string> myArray = setParameters();
84 OptionParser parser(option);
85 map<string,string> parameters = parser.getParameters();
87 ValidParameters validParameter;
88 map<string,string>::iterator it;
90 //check to make sure all parameters are valid for command
91 for (it = parameters.begin(); it != parameters.end(); it++) {
92 if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
95 //initialize outputTypes
96 vector<string> tempOutNames;
97 outputTypes["fasta"] = tempOutNames;
98 outputTypes["name"] = tempOutNames;
99 outputTypes["summary"] = tempOutNames;
102 //if the user changes the input directory command factory will send this info to us in the output parameter
103 string inputDir = validParameter.validFile(parameters, "inputdir", false);
104 if (inputDir == "not found"){ inputDir = ""; }
107 it = parameters.find("fasta");
108 //user has given a template file
109 if(it != parameters.end()){
110 path = m->hasPath(it->second);
111 //if the user has not given a path then, add inputdir. else leave path alone.
112 if (path == "") { parameters["fasta"] = inputDir + it->second; }
115 it = parameters.find("name");
116 //user has given a template file
117 if(it != parameters.end()){
118 path = m->hasPath(it->second);
119 //if the user has not given a path then, add inputdir. else leave path alone.
120 if (path == "") { parameters["name"] = inputDir + it->second; }
123 it = parameters.find("list");
124 //user has given a template file
125 if(it != parameters.end()){
126 path = m->hasPath(it->second);
127 //if the user has not given a path then, add inputdir. else leave path alone.
128 if (path == "") { parameters["list"] = inputDir + it->second; }
133 //check for parameters
134 fastafile = validParameter.validFile(parameters, "fasta", true);
135 if (fastafile == "not open") { abort = true; }
136 else if (fastafile == "not found") {
137 fastafile = m->getFastaFile();
138 if (fastafile != "") { m->mothurOut("Using " + fastafile + " as input file for the fasta parameter."); m->mothurOutEndLine(); }
139 else { m->mothurOut("You have no current fastafile and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; }
142 namefile = validParameter.validFile(parameters, "name", true);
143 if (namefile == "not open") { abort = true; }
144 else if (namefile == "not found") { namefile = ""; }
146 listfile = validParameter.validFile(parameters, "list", true);
147 if (listfile == "not open") { abort = true; }
148 else if (listfile == "not found") { listfile = ""; }
150 label = validParameter.validFile(parameters, "label", false);
151 if (label == "not found") { label = ""; }
153 if(label != "all") { m->splitAtDash(label, labels); allLines = 0; }
154 else { allLines = 1; }
157 //if the user changes the output directory command factory will send this info to us in the output parameter
158 outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = m->hasPath(fastafile); }
162 catch(exception& e) {
163 m->errorOut(e, "ConsensusSeqsCommand", "ConsensusSeqsCommand");
167 //***************************************************************************************************************
169 int ConsensusSeqsCommand::execute(){
172 if (abort == true) { if (calledHelp) { return 0; } return 2; }
176 if (m->control_pressed) { return 0; }
178 if (namefile != "") { readNames(); }
180 if (m->control_pressed) { return 0; }
183 if (listfile == "") {
186 string outputSummaryFile = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "cons.summary";
187 m->openOutputFile(outputSummaryFile, outSummary);
188 outSummary.setf(ios::fixed, ios::floatfield); outSummary.setf(ios::showpoint);
189 outputNames.push_back(outputSummaryFile); outputTypes["summary"].push_back(outputSummaryFile);
191 outSummary << "PositioninAlignment\tA\tT\tG\tC\tGap\tNumberofSeqs\tConsensusBase" << endl;
194 string outputFastaFile = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "cons.fasta";
195 m->openOutputFile(outputFastaFile, outFasta);
196 outputNames.push_back(outputFastaFile); outputTypes["fasta"].push_back(outputFastaFile);
200 for (map<string, string>::iterator it = nameMap.begin(); it != nameMap.end(); it++) {
202 if (m->control_pressed) { outSummary.close(); outFasta.close(); for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
204 string seq = fastaMap[it->second];
207 if (seqLength == 0) { seqLength = seq.length(); }
208 else if (seqLength != seq.length()) { m->mothurOut("[ERROR]: sequence are not the same length, please correct."); m->mothurOutEndLine(); m->control_pressed = true; }
212 vector< vector<float> > percentages; percentages.resize(5);
213 for (int j = 0; j < percentages.size(); j++) { percentages[j].resize(seqLength, 0.0); }
217 for (int j = 0; j < seqLength; j++) {
219 if (m->control_pressed) { outSummary.close(); outFasta.close(); for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
221 vector<int> counts; counts.resize(5, 0); //A,T,G,C,Gap
224 for (int i = 0; i < seqs.size(); i++) {
226 if (seqs[i][j] == '.') { numDots++; }
228 char base = toupper(seqs[i][j]);
229 if (base == 'A') { counts[0]++; }
230 else if (base == 'T') { counts[1]++; }
231 else if (base == 'G') { counts[2]++; }
232 else if (base == 'C') { counts[3]++; }
233 else { counts[4]++; }
237 if (numDots != seqs.size()) { conBase = getBase(counts); }
241 percentages[0][j] = counts[0] / (float) seqs.size();
242 percentages[1][j] = counts[1] / (float) seqs.size();
243 percentages[2][j] = counts[2] / (float) seqs.size();
244 percentages[3][j] = counts[3] / (float) seqs.size();
245 percentages[4][j] = counts[4] / (float) seqs.size();
249 for (int j = 0; j < seqLength; j++) {
250 outSummary << (j+1) << '\t' << percentages[0][j] << '\t'<< percentages[1][j] << '\t'<< percentages[2][j] << '\t' << percentages[3][j] << '\t' << percentages[4][j] << '\t' << seqs.size() << '\t' << consSeq[j] << endl;
254 outFasta << ">conseq" << endl << consSeq << endl;
256 outSummary.close(); outFasta.close();
262 InputData* input = new InputData(listfile, "list");
263 ListVector* list = input->getListVector();
265 string lastLabel = list->getLabel();
266 set<string> processedLabels;
267 set<string> userLabels = labels;
269 //as long as you are not at the end of the file or done wih the lines you want
270 while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
272 if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } delete list; delete input; return 0; }
274 if(allLines == 1 || labels.count(list->getLabel()) == 1){
276 m->mothurOut(list->getLabel()); m->mothurOutEndLine();
280 processedLabels.insert(list->getLabel());
281 userLabels.erase(list->getLabel());
284 if ((m->anyLabelsToProcess(list->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
285 string saveLabel = list->getLabel();
289 list = input->getListVector(lastLabel);
290 m->mothurOut(list->getLabel()); m->mothurOutEndLine();
294 processedLabels.insert(list->getLabel());
295 userLabels.erase(list->getLabel());
297 //restore real lastlabel to save below
298 list->setLabel(saveLabel);
301 lastLabel = list->getLabel();
303 delete list; list = NULL;
305 //get next line to process
306 list = input->getListVector();
310 if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } if (list != NULL) { delete list; } delete input; return 0; }
312 //output error messages about any remaining user labels
313 set<string>::iterator it;
314 bool needToRun = false;
315 for (it = userLabels.begin(); it != userLabels.end(); it++) {
316 m->mothurOut("Your file does not include the label " + *it);
317 if (processedLabels.count(lastLabel) != 1) {
318 m->mothurOut(". I will use " + lastLabel + "."); m->mothurOutEndLine();
321 m->mothurOut(". Please refer to " + lastLabel + "."); m->mothurOutEndLine();
325 //run last label if you need to
326 if (needToRun == true) {
327 if (list != NULL) { delete list; }
329 list = input->getListVector(lastLabel);
331 m->mothurOut(list->getLabel()); m->mothurOutEndLine();
335 delete list; list = NULL;
338 if (list != NULL) { delete list; }
342 m->mothurOutEndLine();
343 m->mothurOut("Output File Name: "); m->mothurOutEndLine();
344 for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }
345 m->mothurOutEndLine();
351 catch(exception& e) {
352 m->errorOut(e, "ConsensusSeqsCommand", "execute");
356 //***************************************************************************************************************
358 int ConsensusSeqsCommand::processList(ListVector*& list){
362 string outputSummaryFile = outputDir + m->getRootName(m->getSimpleName(fastafile)) + list->getLabel() + ".cons.summary";
363 m->openOutputFile(outputSummaryFile, outSummary);
364 outSummary.setf(ios::fixed, ios::floatfield); outSummary.setf(ios::showpoint);
365 outputNames.push_back(outputSummaryFile); outputTypes["summary"].push_back(outputSummaryFile);
368 string outputNameFile = outputDir + m->getRootName(m->getSimpleName(fastafile)) + list->getLabel() + ".cons.names";
369 m->openOutputFile(outputNameFile, outName);
370 outputNames.push_back(outputNameFile); outputTypes["name"].push_back(outputNameFile);
373 string outputFastaFile = outputDir + m->getRootName(m->getSimpleName(fastafile)) + list->getLabel() + ".cons.fasta";
374 m->openOutputFile(outputFastaFile, outFasta);
375 outputNames.push_back(outputFastaFile); outputTypes["fasta"].push_back(outputFastaFile);
377 outSummary << "OTU#\tPositioninAlignment\tA\tT\tG\tC\tGap\tNumberofSeqs\tConsensusBase" << endl;
379 for (int i = 0; i < list->getNumBins(); i++) {
381 if (m->control_pressed) { outSummary.close(); outName.close(); outFasta.close(); return 0; }
383 string bin = list->get(i);
386 string consSeq = getConsSeq(bin, outSummary, newName, i);
388 outFasta << ">seq" << (i+1) << endl << consSeq << endl;
389 outName << "seq" << (i+1) << '\t' << "seq" << (i+1) << "," << newName << endl;
392 outSummary.close(); outName.close(); outFasta.close();
397 catch(exception& e) {
398 m->errorOut(e, "ConsensusSeqsCommand", "processList");
403 //***************************************************************************************************************
404 //made this smart enough to owrk with unique or non unique list file
405 string ConsensusSeqsCommand::getConsSeq(string bin, ofstream& outSummary, string& name, int binNumber){
411 //the whole bin is the second column if no names file, otherwise build it
413 if (namefile != "") { name = ""; }
415 vector<string> binNames;
416 m->splitAtComma(bin, binNames);
418 //get sequence strings for each name in the bin
421 set<string> addedAlready;
423 for (int i = 0; i < binNames.size(); i++) {
425 map<string, string>::iterator it;
427 it = nameMap.find(binNames[i]);
428 if (it == nameMap.end()) {
429 if (namefile == "") { m->mothurOut("[ERROR]: " + binNames[i] + " is not in your fasta file, please correct."); m->mothurOutEndLine(); error = true; }
430 else { m->mothurOut("[ERROR]: " + binNames[i] + " is not in your fasta or name file, please correct."); m->mothurOutEndLine(); error = true; }
434 //add sequence string to seqs vector to process below
435 string seq = fastaMap[it->second];
438 if (seqLength == 0) { seqLength = seq.length(); }
439 else if (seqLength != seq.length()) { m->mothurOut("[ERROR]: sequence are not the same length, please correct."); m->mothurOutEndLine(); error = true; break; }
441 if (namefile != "") {
442 //did we add this line from name file already?
443 if (addedAlready.count(it->second) == 0) {
444 name += "," + nameFileMap[it->second];
445 addedAlready.insert(it->second);
452 if (error) { m->control_pressed = true; return consSeq; }
454 if (namefile != "") { name = name.substr(1); }
456 vector< vector<float> > percentages; percentages.resize(5);
457 for (int j = 0; j < percentages.size(); j++) { percentages[j].resize(seqLength, 0.0); }
460 for (int j = 0; j < seqLength; j++) {
462 if (m->control_pressed) { return consSeq; }
464 vector<int> counts; counts.resize(5, 0); //A,T,G,C,Gap
467 for (int i = 0; i < seqs.size(); i++) {
469 if (seqs[i][j] == '.') { numDots++; }
471 char base = toupper(seqs[i][j]);
472 if (base == 'A') { counts[0]++; }
473 else if (base == 'T') { counts[1]++; }
474 else if (base == 'G') { counts[2]++; }
475 else if (base == 'C') { counts[3]++; }
476 else { counts[4]++; }
480 if (numDots != seqs.size()) { conBase = getBase(counts); }
484 percentages[0][j] = counts[0] / (float) seqs.size();
485 percentages[1][j] = counts[1] / (float) seqs.size();
486 percentages[2][j] = counts[2] / (float) seqs.size();
487 percentages[3][j] = counts[3] / (float) seqs.size();
488 percentages[4][j] = counts[4] / (float) seqs.size();
492 for (int j = 0; j < seqLength; j++) {
493 outSummary << (binNumber + 1) << '\t' << (j+1) << '\t' << percentages[0][j] << '\t'<< percentages[1][j] << '\t'<< percentages[2][j] << '\t' << percentages[3][j] << '\t' << percentages[4][j] << '\t' << seqs.size() << '\t' << consSeq[j] << endl;
499 catch(exception& e) {
500 m->errorOut(e, "ConsensusSeqsCommand", "getConsSeq");
504 //***************************************************************************************************************
506 char ConsensusSeqsCommand::getBase(vector<int> counts){ //A,T,G,C,Gap
513 * Y = T C (pyrimidine)
516 * S = G C (strong bonds)
517 * W = A T (weak bonds)
518 * B = G T C (all but A)
519 * D = G A T (all but C)
520 * H = A C T (all but G)
521 * V = G C A (all but T)
522 * N = A G C T (any) */
527 if ((counts[0] != 0) && (counts[1] != 0) && (counts[2] != 0) && (counts[3] != 0) && (counts[4] != 0)) { conBase = 'n'; }
529 else if ((counts[0] != 0) && (counts[1] != 0) && (counts[2] != 0) && (counts[3] != 0) && (counts[4] == 0)) { conBase = 'N'; }
531 else if ((counts[0] != 0) && (counts[1] == 0) && (counts[2] != 0) && (counts[3] != 0) && (counts[4] != 0)) { conBase = 'v'; }
533 else if ((counts[0] != 0) && (counts[1] == 0) && (counts[2] != 0) && (counts[3] != 0) && (counts[4] == 0)) { conBase = 'V'; }
535 else if ((counts[0] != 0) && (counts[1] != 0) && (counts[2] == 0) && (counts[3] != 0) && (counts[4] != 0)) { conBase = 'h'; }
537 else if ((counts[0] != 0) && (counts[1] != 0) && (counts[2] == 0) && (counts[3] != 0) && (counts[4] == 0)) { conBase = 'H'; }
539 else if ((counts[0] != 0) && (counts[1] != 0) && (counts[2] != 0) && (counts[3] == 0) && (counts[4] != 0)) { conBase = 'd'; }
541 else if ((counts[0] != 0) && (counts[1] != 0) && (counts[2] != 0) && (counts[3] == 0) && (counts[4] == 0)) { conBase = 'D'; }
543 else if ((counts[0] == 0) && (counts[1] != 0) && (counts[2] != 0) && (counts[3] != 0) && (counts[4] != 0)) { conBase = 'b'; }
545 else if ((counts[0] == 0) && (counts[1] != 0) && (counts[2] != 0) && (counts[3] != 0) && (counts[4] == 0)) { conBase = 'B'; }
546 //W = A T (weak bonds)
547 else if ((counts[0] != 0) && (counts[1] != 0) && (counts[2] == 0) && (counts[3] == 0) && (counts[4] != 0)) { conBase = 'w'; }
548 //W = A T (weak bonds) no gap
549 else if ((counts[0] != 0) && (counts[1] != 0) && (counts[2] == 0) && (counts[3] == 0) && (counts[4] == 0)) { conBase = 'W'; }
550 //S = G C (strong bonds)
551 else if ((counts[0] == 0) && (counts[1] == 0) && (counts[2] != 0) && (counts[3] != 0) && (counts[4] != 0)) { conBase = 's'; }
552 //S = G C (strong bonds) no gap
553 else if ((counts[0] == 0) && (counts[1] == 0) && (counts[2] != 0) && (counts[3] != 0) && (counts[4] == 0)) { conBase = 'S'; }
555 else if ((counts[0] != 0) && (counts[1] == 0) && (counts[2] == 0) && (counts[3] != 0) && (counts[4] != 0)) { conBase = 'm'; }
556 //M = A C (amino) no gap
557 else if ((counts[0] != 0) && (counts[1] == 0) && (counts[2] == 0) && (counts[3] != 0) && (counts[4] == 0)) { conBase = 'M'; }
559 else if ((counts[0] == 0) && (counts[1] != 0) && (counts[2] != 0) && (counts[3] == 0) && (counts[4] != 0)) { conBase = 'k'; }
560 //K = G T (keto) no gap
561 else if ((counts[0] == 0) && (counts[1] != 0) && (counts[2] != 0) && (counts[3] == 0) && (counts[4] == 0)) { conBase = 'K'; }
562 //Y = T C (pyrimidine)
563 else if ((counts[0] == 0) && (counts[1] != 0) && (counts[2] == 0) && (counts[3] != 0) && (counts[4] != 0)) { conBase = 'y'; }
564 //Y = T C (pyrimidine) no gap
565 else if ((counts[0] == 0) && (counts[1] != 0) && (counts[2] == 0) && (counts[3] != 0) && (counts[4] == 0)) { conBase = 'Y'; }
567 else if ((counts[0] != 0) && (counts[1] == 0) && (counts[2] != 0) && (counts[3] == 0) && (counts[4] != 0)) { conBase = 'r'; }
568 //R = G A (purine) no gap
569 else if ((counts[0] != 0) && (counts[1] == 0) && (counts[2] != 0) && (counts[3] == 0) && (counts[4] == 0)) { conBase = 'R'; }
571 else if ((counts[0] != 0) && (counts[1] == 0) && (counts[2] == 0) && (counts[3] == 0) && (counts[4] != 0)) { conBase = 'a'; }
573 else if ((counts[0] != 0) && (counts[1] == 0) && (counts[2] == 0) && (counts[3] == 0) && (counts[4] == 0)) { conBase = 'A'; }
575 else if ((counts[0] == 0) && (counts[1] != 0) && (counts[2] == 0) && (counts[3] == 0) && (counts[4] != 0)) { conBase = 't'; }
577 else if ((counts[0] == 0) && (counts[1] != 0) && (counts[2] == 0) && (counts[3] == 0) && (counts[4] == 0)) { conBase = 'T'; }
579 else if ((counts[0] == 0) && (counts[1] == 0) && (counts[2] != 0) && (counts[3] == 0) && (counts[4] != 0)) { conBase = 'g'; }
581 else if ((counts[0] == 0) && (counts[1] == 0) && (counts[2] != 0) && (counts[3] == 0) && (counts[4] == 0)) { conBase = 'G'; }
583 else if ((counts[0] == 0) && (counts[1] == 0) && (counts[2] == 0) && (counts[3] != 0) && (counts[4] != 0)) { conBase = 'c'; }
585 else if ((counts[0] == 0) && (counts[1] == 0) && (counts[2] == 0) && (counts[3] != 0) && (counts[4] == 0)) { conBase = 'C'; }
587 else if ((counts[0] == 0) && (counts[1] == 0) && (counts[2] == 0) && (counts[3] == 0) && (counts[4] != 0)) { conBase = '-'; }
588 else{ m->mothurOut("[ERROR]: cannot find consensus base."); m->mothurOutEndLine(); }
593 catch(exception& e) {
594 m->errorOut(e, "ConsensusSeqsCommand", "getBase");
599 //***************************************************************************************************************
601 int ConsensusSeqsCommand::readFasta(){
605 m->openInputFile(fastafile, in);
609 if (m->control_pressed) { break; }
611 Sequence seq(in); m->gobble(in);
612 string name = seq.getName();
615 fastaMap[name] = seq.getAligned();
616 nameMap[name] = name; //set nameMap incase no names file
617 nameFileMap[name] = name;
626 catch(exception& e) {
627 m->errorOut(e, "ConsensusSeqsCommand", "readFasta");
631 //***************************************************************************************************************
633 int ConsensusSeqsCommand::readNames(){
637 m->openInputFile(namefile, in);
639 string thisname, repnames;
640 map<string, string>::iterator it;
646 if (m->control_pressed) { break; }
648 in >> thisname; m->gobble(in); //read from first column
649 in >> repnames; //read from second column
651 it = nameMap.find(thisname);
652 if (it != nameMap.end()) { //then this sequence was in the fastafile
654 vector<string> splitRepNames;
655 m->splitAtComma(repnames, splitRepNames);
657 nameFileMap[thisname] = repnames; //for later when outputting the new namesFile if the list file is unique
658 for (int i = 0; i < splitRepNames.size(); i++) { nameMap[splitRepNames[i]] = thisname; }
660 }else{ m->mothurOut("[ERROR]: " + thisname + " is not in the fasta file, please correct."); m->mothurOutEndLine(); error = true; }
667 if (error) { m->control_pressed = true; }
672 catch(exception& e) {
673 m->errorOut(e, "ConsensusSeqsCommand", "readNames");
678 //***************************************************************************************************************