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; }
81 vector<string> myArray = setParameters();
83 OptionParser parser(option);
84 map<string,string> parameters = parser.getParameters();
86 ValidParameters validParameter;
87 map<string,string>::iterator it;
89 //check to make sure all parameters are valid for command
90 for (it = parameters.begin(); it != parameters.end(); it++) {
91 if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
94 //initialize outputTypes
95 vector<string> tempOutNames;
96 outputTypes["fasta"] = tempOutNames;
97 outputTypes["name"] = tempOutNames;
98 outputTypes["summary"] = tempOutNames;
101 //if the user changes the input directory command factory will send this info to us in the output parameter
102 string inputDir = validParameter.validFile(parameters, "inputdir", false);
103 if (inputDir == "not found"){ inputDir = ""; }
106 it = parameters.find("fasta");
107 //user has given a template file
108 if(it != parameters.end()){
109 path = m->hasPath(it->second);
110 //if the user has not given a path then, add inputdir. else leave path alone.
111 if (path == "") { parameters["fasta"] = inputDir + it->second; }
114 it = parameters.find("name");
115 //user has given a template file
116 if(it != parameters.end()){
117 path = m->hasPath(it->second);
118 //if the user has not given a path then, add inputdir. else leave path alone.
119 if (path == "") { parameters["name"] = inputDir + it->second; }
122 it = parameters.find("list");
123 //user has given a template file
124 if(it != parameters.end()){
125 path = m->hasPath(it->second);
126 //if the user has not given a path then, add inputdir. else leave path alone.
127 if (path == "") { parameters["list"] = inputDir + it->second; }
132 //check for parameters
133 fastafile = validParameter.validFile(parameters, "fasta", true);
134 if (fastafile == "not open") { abort = true; }
135 else if (fastafile == "not found") {
136 fastafile = m->getFastaFile();
137 if (fastafile != "") { m->mothurOut("Using " + fastafile + " as input file for the fasta parameter."); m->mothurOutEndLine(); }
138 else { m->mothurOut("You have no current fastafile and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; }
141 namefile = validParameter.validFile(parameters, "name", true);
142 if (namefile == "not open") { abort = true; }
143 else if (namefile == "not found") { namefile = ""; }
145 listfile = validParameter.validFile(parameters, "list", true);
146 if (listfile == "not open") { abort = true; }
147 else if (listfile == "not found") { listfile = ""; }
149 label = validParameter.validFile(parameters, "label", false);
150 if (label == "not found") { label = ""; }
152 if(label != "all") { m->splitAtDash(label, labels); allLines = 0; }
153 else { allLines = 1; }
156 //if the user changes the output directory command factory will send this info to us in the output parameter
157 outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = m->hasPath(fastafile); }
161 catch(exception& e) {
162 m->errorOut(e, "ConsensusSeqsCommand", "ConsensusSeqsCommand");
166 //***************************************************************************************************************
168 int ConsensusSeqsCommand::execute(){
171 if (abort == true) { if (calledHelp) { return 0; } return 2; }
175 if (m->control_pressed) { return 0; }
177 if (namefile != "") { readNames(); }
179 if (m->control_pressed) { return 0; }
182 if (listfile == "") {
185 string outputSummaryFile = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "cons.summary";
186 m->openOutputFile(outputSummaryFile, outSummary);
187 outSummary.setf(ios::fixed, ios::floatfield); outSummary.setf(ios::showpoint);
188 outputNames.push_back(outputSummaryFile); outputTypes["summary"].push_back(outputSummaryFile);
190 outSummary << "PositioninAlignment\tA\tT\tG\tC\tGap\tNumberofSeqs\tConsensusBase" << endl;
193 string outputFastaFile = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "cons.fasta";
194 m->openOutputFile(outputFastaFile, outFasta);
195 outputNames.push_back(outputFastaFile); outputTypes["fasta"].push_back(outputFastaFile);
199 for (map<string, string>::iterator it = nameMap.begin(); it != nameMap.end(); it++) {
201 if (m->control_pressed) { outSummary.close(); outFasta.close(); for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
203 string seq = fastaMap[it->second];
206 if (seqLength == 0) { seqLength = seq.length(); }
207 else if (seqLength != seq.length()) { m->mothurOut("[ERROR]: sequence are not the same length, please correct."); m->mothurOutEndLine(); m->control_pressed = true; }
211 vector< vector<float> > percentages; percentages.resize(5);
212 for (int j = 0; j < percentages.size(); j++) { percentages[j].resize(seqLength, 0.0); }
216 for (int j = 0; j < seqLength; j++) {
218 if (m->control_pressed) { outSummary.close(); outFasta.close(); for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
220 vector<int> counts; counts.resize(5, 0); //A,T,G,C,Gap
223 for (int i = 0; i < seqs.size(); i++) {
225 if (seqs[i][j] == '.') { numDots++; }
227 char base = toupper(seqs[i][j]);
228 if (base == 'A') { counts[0]++; }
229 else if (base == 'T') { counts[1]++; }
230 else if (base == 'G') { counts[2]++; }
231 else if (base == 'C') { counts[3]++; }
232 else { counts[4]++; }
236 if (numDots != seqs.size()) { conBase = getBase(counts); }
240 percentages[0][j] = counts[0] / (float) seqs.size();
241 percentages[1][j] = counts[1] / (float) seqs.size();
242 percentages[2][j] = counts[2] / (float) seqs.size();
243 percentages[3][j] = counts[3] / (float) seqs.size();
244 percentages[4][j] = counts[4] / (float) seqs.size();
248 for (int j = 0; j < seqLength; j++) {
249 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;
253 outFasta << ">conseq" << endl << consSeq << endl;
255 outSummary.close(); outFasta.close();
261 InputData* input = new InputData(listfile, "list");
262 ListVector* list = input->getListVector();
264 string lastLabel = list->getLabel();
265 set<string> processedLabels;
266 set<string> userLabels = labels;
268 //as long as you are not at the end of the file or done wih the lines you want
269 while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
271 if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } delete list; delete input; return 0; }
273 if(allLines == 1 || labels.count(list->getLabel()) == 1){
275 m->mothurOut(list->getLabel()); m->mothurOutEndLine();
279 processedLabels.insert(list->getLabel());
280 userLabels.erase(list->getLabel());
283 if ((m->anyLabelsToProcess(list->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
284 string saveLabel = list->getLabel();
288 list = input->getListVector(lastLabel);
289 m->mothurOut(list->getLabel()); m->mothurOutEndLine();
293 processedLabels.insert(list->getLabel());
294 userLabels.erase(list->getLabel());
296 //restore real lastlabel to save below
297 list->setLabel(saveLabel);
300 lastLabel = list->getLabel();
302 delete list; list = NULL;
304 //get next line to process
305 list = input->getListVector();
309 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; }
311 //output error messages about any remaining user labels
312 set<string>::iterator it;
313 bool needToRun = false;
314 for (it = userLabels.begin(); it != userLabels.end(); it++) {
315 m->mothurOut("Your file does not include the label " + *it);
316 if (processedLabels.count(lastLabel) != 1) {
317 m->mothurOut(". I will use " + lastLabel + "."); m->mothurOutEndLine();
320 m->mothurOut(". Please refer to " + lastLabel + "."); m->mothurOutEndLine();
324 //run last label if you need to
325 if (needToRun == true) {
326 if (list != NULL) { delete list; }
328 list = input->getListVector(lastLabel);
330 m->mothurOut(list->getLabel()); m->mothurOutEndLine();
334 delete list; list = NULL;
337 if (list != NULL) { delete list; }
341 m->mothurOutEndLine();
342 m->mothurOut("Output File Name: "); m->mothurOutEndLine();
343 for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }
344 m->mothurOutEndLine();
350 catch(exception& e) {
351 m->errorOut(e, "ConsensusSeqsCommand", "execute");
355 //***************************************************************************************************************
357 int ConsensusSeqsCommand::processList(ListVector*& list){
361 string outputSummaryFile = outputDir + m->getRootName(m->getSimpleName(fastafile)) + list->getLabel() + ".cons.summary";
362 m->openOutputFile(outputSummaryFile, outSummary);
363 outSummary.setf(ios::fixed, ios::floatfield); outSummary.setf(ios::showpoint);
364 outputNames.push_back(outputSummaryFile); outputTypes["summary"].push_back(outputSummaryFile);
367 string outputNameFile = outputDir + m->getRootName(m->getSimpleName(fastafile)) + list->getLabel() + ".cons.names";
368 m->openOutputFile(outputNameFile, outName);
369 outputNames.push_back(outputNameFile); outputTypes["name"].push_back(outputNameFile);
372 string outputFastaFile = outputDir + m->getRootName(m->getSimpleName(fastafile)) + list->getLabel() + ".cons.fasta";
373 m->openOutputFile(outputFastaFile, outFasta);
374 outputNames.push_back(outputFastaFile); outputTypes["fasta"].push_back(outputFastaFile);
376 outSummary << "OTU#\tPositioninAlignment\tA\tT\tG\tC\tGap\tNumberofSeqs\tConsensusBase" << endl;
378 for (int i = 0; i < list->getNumBins(); i++) {
380 if (m->control_pressed) { outSummary.close(); outName.close(); outFasta.close(); return 0; }
382 string bin = list->get(i);
385 string consSeq = getConsSeq(bin, outSummary, newName, i);
387 outFasta << ">seq" << (i+1) << endl << consSeq << endl;
388 outName << "seq" << (i+1) << '\t' << "seq" << (i+1) << "," << newName << endl;
391 outSummary.close(); outName.close(); outFasta.close();
396 catch(exception& e) {
397 m->errorOut(e, "ConsensusSeqsCommand", "processList");
402 //***************************************************************************************************************
403 //made this smart enough to owrk with unique or non unique list file
404 string ConsensusSeqsCommand::getConsSeq(string bin, ofstream& outSummary, string& name, int binNumber){
410 //the whole bin is the second column if no names file, otherwise build it
412 if (namefile != "") { name = ""; }
414 vector<string> binNames;
415 m->splitAtComma(bin, binNames);
417 //get sequence strings for each name in the bin
420 set<string> addedAlready;
422 for (int i = 0; i < binNames.size(); i++) {
424 map<string, string>::iterator it;
426 it = nameMap.find(binNames[i]);
427 if (it == nameMap.end()) {
428 if (namefile == "") { m->mothurOut("[ERROR]: " + binNames[i] + " is not in your fasta file, please correct."); m->mothurOutEndLine(); error = true; }
429 else { m->mothurOut("[ERROR]: " + binNames[i] + " is not in your fasta or name file, please correct."); m->mothurOutEndLine(); error = true; }
433 //add sequence string to seqs vector to process below
434 string seq = fastaMap[it->second];
437 if (seqLength == 0) { seqLength = seq.length(); }
438 else if (seqLength != seq.length()) { m->mothurOut("[ERROR]: sequence are not the same length, please correct."); m->mothurOutEndLine(); error = true; break; }
440 if (namefile != "") {
441 //did we add this line from name file already?
442 if (addedAlready.count(it->second) == 0) {
443 name += "," + nameFileMap[it->second];
444 addedAlready.insert(it->second);
451 if (error) { m->control_pressed = true; return consSeq; }
453 if (namefile != "") { name = name.substr(1); }
455 vector< vector<float> > percentages; percentages.resize(5);
456 for (int j = 0; j < percentages.size(); j++) { percentages[j].resize(seqLength, 0.0); }
459 for (int j = 0; j < seqLength; j++) {
461 if (m->control_pressed) { return consSeq; }
463 vector<int> counts; counts.resize(5, 0); //A,T,G,C,Gap
466 for (int i = 0; i < seqs.size(); i++) {
468 if (seqs[i][j] == '.') { numDots++; }
470 char base = toupper(seqs[i][j]);
471 if (base == 'A') { counts[0]++; }
472 else if (base == 'T') { counts[1]++; }
473 else if (base == 'G') { counts[2]++; }
474 else if (base == 'C') { counts[3]++; }
475 else { counts[4]++; }
479 if (numDots != seqs.size()) { conBase = getBase(counts); }
483 percentages[0][j] = counts[0] / (float) seqs.size();
484 percentages[1][j] = counts[1] / (float) seqs.size();
485 percentages[2][j] = counts[2] / (float) seqs.size();
486 percentages[3][j] = counts[3] / (float) seqs.size();
487 percentages[4][j] = counts[4] / (float) seqs.size();
491 for (int j = 0; j < seqLength; j++) {
492 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;
498 catch(exception& e) {
499 m->errorOut(e, "ConsensusSeqsCommand", "getConsSeq");
503 //***************************************************************************************************************
505 char ConsensusSeqsCommand::getBase(vector<int> counts){ //A,T,G,C,Gap
512 * Y = T C (pyrimidine)
515 * S = G C (strong bonds)
516 * W = A T (weak bonds)
517 * B = G T C (all but A)
518 * D = G A T (all but C)
519 * H = A C T (all but G)
520 * V = G C A (all but T)
521 * N = A G C T (any) */
526 if ((counts[0] != 0) && (counts[1] != 0) && (counts[2] != 0) && (counts[3] != 0) && (counts[4] != 0)) { conBase = 'n'; }
528 else if ((counts[0] != 0) && (counts[1] != 0) && (counts[2] != 0) && (counts[3] != 0) && (counts[4] == 0)) { conBase = 'N'; }
530 else if ((counts[0] != 0) && (counts[1] == 0) && (counts[2] != 0) && (counts[3] != 0) && (counts[4] != 0)) { conBase = 'v'; }
532 else if ((counts[0] != 0) && (counts[1] == 0) && (counts[2] != 0) && (counts[3] != 0) && (counts[4] == 0)) { conBase = 'V'; }
534 else if ((counts[0] != 0) && (counts[1] != 0) && (counts[2] == 0) && (counts[3] != 0) && (counts[4] != 0)) { conBase = 'h'; }
536 else if ((counts[0] != 0) && (counts[1] != 0) && (counts[2] == 0) && (counts[3] != 0) && (counts[4] == 0)) { conBase = 'H'; }
538 else if ((counts[0] != 0) && (counts[1] != 0) && (counts[2] != 0) && (counts[3] == 0) && (counts[4] != 0)) { conBase = 'd'; }
540 else if ((counts[0] != 0) && (counts[1] != 0) && (counts[2] != 0) && (counts[3] == 0) && (counts[4] == 0)) { conBase = 'D'; }
542 else if ((counts[0] == 0) && (counts[1] != 0) && (counts[2] != 0) && (counts[3] != 0) && (counts[4] != 0)) { conBase = 'b'; }
544 else if ((counts[0] == 0) && (counts[1] != 0) && (counts[2] != 0) && (counts[3] != 0) && (counts[4] == 0)) { conBase = 'B'; }
545 //W = A T (weak bonds)
546 else if ((counts[0] != 0) && (counts[1] != 0) && (counts[2] == 0) && (counts[3] == 0) && (counts[4] != 0)) { conBase = 'w'; }
547 //W = A T (weak bonds) no gap
548 else if ((counts[0] != 0) && (counts[1] != 0) && (counts[2] == 0) && (counts[3] == 0) && (counts[4] == 0)) { conBase = 'W'; }
549 //S = G C (strong bonds)
550 else if ((counts[0] == 0) && (counts[1] == 0) && (counts[2] != 0) && (counts[3] != 0) && (counts[4] != 0)) { conBase = 's'; }
551 //S = G C (strong bonds) no gap
552 else if ((counts[0] == 0) && (counts[1] == 0) && (counts[2] != 0) && (counts[3] != 0) && (counts[4] == 0)) { conBase = 'S'; }
554 else if ((counts[0] != 0) && (counts[1] == 0) && (counts[2] == 0) && (counts[3] != 0) && (counts[4] != 0)) { conBase = 'm'; }
555 //M = A C (amino) no gap
556 else if ((counts[0] != 0) && (counts[1] == 0) && (counts[2] == 0) && (counts[3] != 0) && (counts[4] == 0)) { conBase = 'M'; }
558 else if ((counts[0] == 0) && (counts[1] != 0) && (counts[2] != 0) && (counts[3] == 0) && (counts[4] != 0)) { conBase = 'k'; }
559 //K = G T (keto) no gap
560 else if ((counts[0] == 0) && (counts[1] != 0) && (counts[2] != 0) && (counts[3] == 0) && (counts[4] == 0)) { conBase = 'K'; }
561 //Y = T C (pyrimidine)
562 else if ((counts[0] == 0) && (counts[1] != 0) && (counts[2] == 0) && (counts[3] != 0) && (counts[4] != 0)) { conBase = 'y'; }
563 //Y = T C (pyrimidine) no gap
564 else if ((counts[0] == 0) && (counts[1] != 0) && (counts[2] == 0) && (counts[3] != 0) && (counts[4] == 0)) { conBase = 'Y'; }
566 else if ((counts[0] != 0) && (counts[1] == 0) && (counts[2] != 0) && (counts[3] == 0) && (counts[4] != 0)) { conBase = 'r'; }
567 //R = G A (purine) no gap
568 else if ((counts[0] != 0) && (counts[1] == 0) && (counts[2] != 0) && (counts[3] == 0) && (counts[4] == 0)) { conBase = 'R'; }
570 else if ((counts[0] != 0) && (counts[1] == 0) && (counts[2] == 0) && (counts[3] == 0) && (counts[4] != 0)) { conBase = 'a'; }
572 else if ((counts[0] != 0) && (counts[1] == 0) && (counts[2] == 0) && (counts[3] == 0) && (counts[4] == 0)) { conBase = 'A'; }
574 else if ((counts[0] == 0) && (counts[1] != 0) && (counts[2] == 0) && (counts[3] == 0) && (counts[4] != 0)) { conBase = 't'; }
576 else if ((counts[0] == 0) && (counts[1] != 0) && (counts[2] == 0) && (counts[3] == 0) && (counts[4] == 0)) { conBase = 'T'; }
578 else if ((counts[0] == 0) && (counts[1] == 0) && (counts[2] != 0) && (counts[3] == 0) && (counts[4] != 0)) { conBase = 'g'; }
580 else if ((counts[0] == 0) && (counts[1] == 0) && (counts[2] != 0) && (counts[3] == 0) && (counts[4] == 0)) { conBase = 'G'; }
582 else if ((counts[0] == 0) && (counts[1] == 0) && (counts[2] == 0) && (counts[3] != 0) && (counts[4] != 0)) { conBase = 'c'; }
584 else if ((counts[0] == 0) && (counts[1] == 0) && (counts[2] == 0) && (counts[3] != 0) && (counts[4] == 0)) { conBase = 'C'; }
586 else if ((counts[0] == 0) && (counts[1] == 0) && (counts[2] == 0) && (counts[3] == 0) && (counts[4] != 0)) { conBase = '-'; }
587 else{ m->mothurOut("[ERROR]: cannot find consensus base."); m->mothurOutEndLine(); }
592 catch(exception& e) {
593 m->errorOut(e, "ConsensusSeqsCommand", "getBase");
598 //***************************************************************************************************************
600 int ConsensusSeqsCommand::readFasta(){
604 m->openInputFile(fastafile, in);
608 if (m->control_pressed) { break; }
610 Sequence seq(in); m->gobble(in);
611 string name = seq.getName();
614 fastaMap[name] = seq.getAligned();
615 nameMap[name] = name; //set nameMap incase no names file
616 nameFileMap[name] = name;
625 catch(exception& e) {
626 m->errorOut(e, "ConsensusSeqsCommand", "readFasta");
630 //***************************************************************************************************************
632 int ConsensusSeqsCommand::readNames(){
636 m->openInputFile(namefile, in);
638 string thisname, repnames;
639 map<string, string>::iterator it;
645 if (m->control_pressed) { break; }
647 in >> thisname; m->gobble(in); //read from first column
648 in >> repnames; //read from second column
650 it = nameMap.find(thisname);
651 if (it != nameMap.end()) { //then this sequence was in the fastafile
653 vector<string> splitRepNames;
654 m->splitAtComma(repnames, splitRepNames);
656 nameFileMap[thisname] = repnames; //for later when outputting the new namesFile if the list file is unique
657 for (int i = 0; i < splitRepNames.size(); i++) { nameMap[splitRepNames[i]] = thisname; }
659 }else{ m->mothurOut("[ERROR]: " + thisname + " is not in the fasta file, please correct."); m->mothurOutEndLine(); error = true; }
666 if (error) { m->control_pressed = true; }
671 catch(exception& e) {
672 m->errorOut(e, "ConsensusSeqsCommand", "readNames");
677 //***************************************************************************************************************