5 * Created by Sarah Westcott on 7/8/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "getseqscommand.h"
11 #include "sequence.hpp"
12 #include "listvector.hpp"
14 //**********************************************************************************************************************
15 vector<string> GetSeqsCommand::getValidParameters(){
17 string Array[] = {"fasta","name", "group", "qfile","alignreport", "accnos", "accnos2","dups", "list","taxonomy","outputdir","inputdir"};
18 vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
22 m->errorOut(e, "GetSeqsCommand", "getValidParameters");
26 //**********************************************************************************************************************
27 GetSeqsCommand::GetSeqsCommand(){
29 abort = true; calledHelp = true;
30 vector<string> tempOutNames;
31 outputTypes["fasta"] = tempOutNames;
32 outputTypes["taxonomy"] = tempOutNames;
33 outputTypes["name"] = tempOutNames;
34 outputTypes["group"] = tempOutNames;
35 outputTypes["alignreport"] = tempOutNames;
36 outputTypes["list"] = tempOutNames;
37 outputTypes["qfile"] = tempOutNames;
38 outputTypes["accnosreport"] = tempOutNames;
41 m->errorOut(e, "GetSeqsCommand", "GetSeqsCommand");
45 //**********************************************************************************************************************
46 vector<string> GetSeqsCommand::getRequiredParameters(){
48 string Array[] = {"accnos"};
49 vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
53 m->errorOut(e, "GetSeqsCommand", "getRequiredParameters");
57 //**********************************************************************************************************************
58 vector<string> GetSeqsCommand::getRequiredFiles(){
60 vector<string> myArray;
64 m->errorOut(e, "GetSeqsCommand", "getRequiredFiles");
68 //**********************************************************************************************************************
69 GetSeqsCommand::GetSeqsCommand(string option) {
71 abort = false; calledHelp = false;
73 //allow user to run help
74 if(option == "help") { help(); abort = true; calledHelp = true; }
77 //valid paramters for this command
78 string Array[] = {"fasta","name", "group", "alignreport", "qfile", "accnos", "accnos2","dups", "list","taxonomy","outputdir","inputdir"};
79 vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
81 OptionParser parser(option);
82 map<string,string> parameters = parser.getParameters();
84 ValidParameters validParameter;
85 map<string,string>::iterator it;
87 //check to make sure all parameters are valid for command
88 for (it = parameters.begin(); it != parameters.end(); it++) {
89 if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
92 //initialize outputTypes
93 vector<string> tempOutNames;
94 outputTypes["fasta"] = tempOutNames;
95 outputTypes["taxonomy"] = tempOutNames;
96 outputTypes["name"] = tempOutNames;
97 outputTypes["group"] = tempOutNames;
98 outputTypes["alignreport"] = tempOutNames;
99 outputTypes["list"] = tempOutNames;
100 outputTypes["qfile"] = tempOutNames;
101 outputTypes["accnosreport"] = tempOutNames;
103 //if the user changes the output directory command factory will send this info to us in the output parameter
104 outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = ""; }
106 //if the user changes the input directory command factory will send this info to us in the output parameter
107 string inputDir = validParameter.validFile(parameters, "inputdir", false);
108 if (inputDir == "not found"){ inputDir = ""; }
111 it = parameters.find("alignreport");
112 //user has given a template file
113 if(it != parameters.end()){
114 path = m->hasPath(it->second);
115 //if the user has not given a path then, add inputdir. else leave path alone.
116 if (path == "") { parameters["alignreport"] = inputDir + it->second; }
119 it = parameters.find("fasta");
120 //user has given a template file
121 if(it != parameters.end()){
122 path = m->hasPath(it->second);
123 //if the user has not given a path then, add inputdir. else leave path alone.
124 if (path == "") { parameters["fasta"] = inputDir + it->second; }
127 it = parameters.find("accnos");
128 //user has given a template file
129 if(it != parameters.end()){
130 path = m->hasPath(it->second);
131 //if the user has not given a path then, add inputdir. else leave path alone.
132 if (path == "") { parameters["accnos"] = inputDir + it->second; }
135 it = parameters.find("accnos2");
136 //user has given a template file
137 if(it != parameters.end()){
138 path = m->hasPath(it->second);
139 //if the user has not given a path then, add inputdir. else leave path alone.
140 if (path == "") { parameters["accnos2"] = inputDir + it->second; }
143 it = parameters.find("list");
144 //user has given a template file
145 if(it != parameters.end()){
146 path = m->hasPath(it->second);
147 //if the user has not given a path then, add inputdir. else leave path alone.
148 if (path == "") { parameters["list"] = inputDir + it->second; }
151 it = parameters.find("name");
152 //user has given a template file
153 if(it != parameters.end()){
154 path = m->hasPath(it->second);
155 //if the user has not given a path then, add inputdir. else leave path alone.
156 if (path == "") { parameters["name"] = inputDir + it->second; }
159 it = parameters.find("group");
160 //user has given a template file
161 if(it != parameters.end()){
162 path = m->hasPath(it->second);
163 //if the user has not given a path then, add inputdir. else leave path alone.
164 if (path == "") { parameters["group"] = inputDir + it->second; }
167 it = parameters.find("taxonomy");
168 //user has given a template file
169 if(it != parameters.end()){
170 path = m->hasPath(it->second);
171 //if the user has not given a path then, add inputdir. else leave path alone.
172 if (path == "") { parameters["taxonomy"] = inputDir + it->second; }
175 it = parameters.find("qfile");
176 //user has given a template file
177 if(it != parameters.end()){
178 path = m->hasPath(it->second);
179 //if the user has not given a path then, add inputdir. else leave path alone.
180 if (path == "") { parameters["qfile"] = inputDir + it->second; }
185 //check for required parameters
186 accnosfile = validParameter.validFile(parameters, "accnos", true);
187 if (accnosfile == "not open") { abort = true; }
188 else if (accnosfile == "not found") { accnosfile = ""; m->mothurOut("You must provide an accnos file."); m->mothurOutEndLine(); abort = true; }
190 if (accnosfile2 == "not found") { accnosfile2 = ""; }
192 fastafile = validParameter.validFile(parameters, "fasta", true);
193 if (fastafile == "not open") { abort = true; }
194 else if (fastafile == "not found") { fastafile = ""; }
196 namefile = validParameter.validFile(parameters, "name", true);
197 if (namefile == "not open") { abort = true; }
198 else if (namefile == "not found") { namefile = ""; }
200 groupfile = validParameter.validFile(parameters, "group", true);
201 if (groupfile == "not open") { abort = true; }
202 else if (groupfile == "not found") { groupfile = ""; }
204 alignfile = validParameter.validFile(parameters, "alignreport", true);
205 if (alignfile == "not open") { abort = true; }
206 else if (alignfile == "not found") { alignfile = ""; }
208 listfile = validParameter.validFile(parameters, "list", true);
209 if (listfile == "not open") { abort = true; }
210 else if (listfile == "not found") { listfile = ""; }
212 taxfile = validParameter.validFile(parameters, "taxonomy", true);
213 if (taxfile == "not open") { abort = true; }
214 else if (taxfile == "not found") { taxfile = ""; }
216 qualfile = validParameter.validFile(parameters, "qfile", true);
217 if (qualfile == "not open") { abort = true; }
218 else if (qualfile == "not found") { qualfile = ""; }
220 string usedDups = "true";
221 string temp = validParameter.validFile(parameters, "dups", false); if (temp == "not found") { temp = "false"; usedDups = ""; }
222 dups = m->isTrue(temp);
224 if ((fastafile == "") && (namefile == "") && (groupfile == "") && (alignfile == "") && (listfile == "") && (taxfile == "") && (qualfile == "") && (accnosfile2 == "")) { m->mothurOut("You must provide one of the following: fasta, name, group, alignreport, taxonomy, quality or listfile."); m->mothurOutEndLine(); abort = true; }
226 if ((usedDups != "") && (namefile == "")) { m->mothurOut("You may only use dups with the name option."); m->mothurOutEndLine(); abort = true; }
231 catch(exception& e) {
232 m->errorOut(e, "GetSeqsCommand", "GetSeqsCommand");
236 //**********************************************************************************************************************
238 void GetSeqsCommand::help(){
240 m->mothurOut("The get.seqs command reads an .accnos file and any of the following file types: fasta, name, group, list, taxonomy, quality or alignreport file.\n");
241 m->mothurOut("It outputs a file containing only the sequences in the .accnos file.\n");
242 m->mothurOut("The get.seqs command parameters are accnos, fasta, name, group, list, taxonomy, qfile, alignreport and dups. You must provide accnos and at least one of the other parameters.\n");
243 m->mothurOut("The dups parameter allows you to add the entire line from a name file if you add any name from the line. default=false. \n");
244 m->mothurOut("The get.seqs command should be in the following format: get.seqs(accnos=yourAccnos, fasta=yourFasta).\n");
245 m->mothurOut("Example get.seqs(accnos=amazon.accnos, fasta=amazon.fasta).\n");
246 m->mothurOut("Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n");
248 catch(exception& e) {
249 m->errorOut(e, "GetSeqsCommand", "help");
254 //**********************************************************************************************************************
256 int GetSeqsCommand::execute(){
259 if (abort == true) { if (calledHelp) { return 0; } return 2; }
261 //get names you want to keep
264 if (m->control_pressed) { return 0; }
266 //read through the correct file and output lines you want to keep
267 if (namefile != "") { readName(); }
268 if (fastafile != "") { readFasta(); }
269 if (groupfile != "") { readGroup(); }
270 if (alignfile != "") { readAlign(); }
271 if (listfile != "") { readList(); }
272 if (taxfile != "") { readTax(); }
273 if (qualfile != "") { readQual(); }
274 if (accnosfile2 != "") { compareAccnos(); }
276 if (m->control_pressed) { outputTypes.clear(); for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
278 m->mothurOut("Selected " + toString(names.size()) + " sequences."); m->mothurOutEndLine();
280 if (outputNames.size() != 0) {
281 m->mothurOutEndLine();
282 m->mothurOut("Output File Names: "); m->mothurOutEndLine();
283 for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }
284 m->mothurOutEndLine();
286 //set fasta file as new current fastafile
288 itTypes = outputTypes.find("fasta");
289 if (itTypes != outputTypes.end()) {
290 if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setFastaFile(current); }
293 itTypes = outputTypes.find("name");
294 if (itTypes != outputTypes.end()) {
295 if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setNameFile(current); }
298 itTypes = outputTypes.find("group");
299 if (itTypes != outputTypes.end()) {
300 if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setGroupFile(current); }
303 itTypes = outputTypes.find("list");
304 if (itTypes != outputTypes.end()) {
305 if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setListFile(current); }
308 itTypes = outputTypes.find("taxonomy");
309 if (itTypes != outputTypes.end()) {
310 if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setTaxonomyFile(current); }
313 itTypes = outputTypes.find("qfile");
314 if (itTypes != outputTypes.end()) {
315 if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setQualFile(current); }
323 catch(exception& e) {
324 m->errorOut(e, "GetSeqsCommand", "execute");
329 //**********************************************************************************************************************
330 int GetSeqsCommand::readFasta(){
332 string thisOutputDir = outputDir;
333 if (outputDir == "") { thisOutputDir += m->hasPath(fastafile); }
334 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(fastafile)) + "pick" + m->getExtension(fastafile);
336 m->openOutputFile(outputFileName, out);
340 m->openInputFile(fastafile, in);
343 bool wroteSomething = false;
347 if (m->control_pressed) { in.close(); out.close(); remove(outputFileName.c_str()); return 0; }
349 Sequence currSeq(in);
350 name = currSeq.getName();
353 //if this name is in the accnos file
354 if (names.count(name) != 0) {
355 wroteSomething = true;
357 currSeq.printSequence(out);
366 if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
367 outputNames.push_back(outputFileName); outputTypes["fasta"].push_back(outputFileName);
372 catch(exception& e) {
373 m->errorOut(e, "GetSeqsCommand", "readFasta");
377 //**********************************************************************************************************************
378 int GetSeqsCommand::readQual(){
380 string thisOutputDir = outputDir;
381 if (outputDir == "") { thisOutputDir += m->hasPath(qualfile); }
382 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(qualfile)) + "pick" + m->getExtension(qualfile);
384 m->openOutputFile(outputFileName, out);
388 m->openInputFile(qualfile, in);
391 bool wroteSomething = false;
395 string saveName = "";
401 if (name.length() != 0) {
402 saveName = name.substr(1);
405 if (c == 10 || c == 13){ break; }
412 char letter= in.get();
413 if(letter == '>'){ in.putback(letter); break; }
414 else{ scores += letter; }
419 if (names.count(saveName) != 0) {
420 wroteSomething = true;
422 out << name << endl << scores;
431 if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
432 outputNames.push_back(outputFileName); outputTypes["qfile"].push_back(outputFileName);
437 catch(exception& e) {
438 m->errorOut(e, "GetSeqsCommand", "readQual");
442 //**********************************************************************************************************************
443 int GetSeqsCommand::readList(){
445 string thisOutputDir = outputDir;
446 if (outputDir == "") { thisOutputDir += m->hasPath(listfile); }
447 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(listfile)) + "pick" + m->getExtension(listfile);
449 m->openOutputFile(outputFileName, out);
452 m->openInputFile(listfile, in);
454 bool wroteSomething = false;
458 if (m->control_pressed) { in.close(); out.close(); remove(outputFileName.c_str()); return 0; }
460 //read in list vector
463 //make a new list vector
465 newList.setLabel(list.getLabel());
468 for (int i = 0; i < list.getNumBins(); i++) {
470 //parse out names that are in accnos file
471 string binnames = list.get(i);
473 string newNames = "";
474 while (binnames.find_first_of(',') != -1) {
475 string name = binnames.substr(0,binnames.find_first_of(','));
476 binnames = binnames.substr(binnames.find_first_of(',')+1, binnames.length());
478 //if that name is in the .accnos file, add it
479 if (names.count(name) != 0) { newNames += name + ","; }
483 if (names.count(binnames) != 0) { newNames += binnames + ","; }
485 //if there are names in this bin add to new list
486 if (newNames != "") {
487 newNames = newNames.substr(0, newNames.length()-1); //rip off extra comma
488 newList.push_back(newNames);
492 //print new listvector
493 if (newList.getNumBins() != 0) {
494 wroteSomething = true;
503 if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
504 outputNames.push_back(outputFileName); outputTypes["list"].push_back(outputFileName);
509 catch(exception& e) {
510 m->errorOut(e, "GetSeqsCommand", "readList");
514 //**********************************************************************************************************************
515 int GetSeqsCommand::readName(){
517 string thisOutputDir = outputDir;
518 if (outputDir == "") { thisOutputDir += m->hasPath(namefile); }
519 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(namefile)) + "pick" + m->getExtension(namefile);
521 m->openOutputFile(outputFileName, out);
525 m->openInputFile(namefile, in);
526 string name, firstCol, secondCol;
528 bool wroteSomething = false;
533 if (m->control_pressed) { in.close(); out.close(); remove(outputFileName.c_str()); return 0; }
539 if (dups) { hold = secondCol; }
541 vector<string> parsedNames;
542 //parse second column saving each name
543 while (secondCol.find_first_of(',') != -1) {
544 name = secondCol.substr(0,secondCol.find_first_of(','));
545 secondCol = secondCol.substr(secondCol.find_first_of(',')+1, secondCol.length());
546 parsedNames.push_back(name);
549 //get name after last ,
550 parsedNames.push_back(secondCol);
552 vector<string> validSecond;
553 for (int i = 0; i < parsedNames.size(); i++) {
554 if (names.count(parsedNames[i]) != 0) {
555 validSecond.push_back(parsedNames[i]);
559 if ((dups) && (validSecond.size() != 0)) { //dups = true and we want to add someone, then add everyone
560 for (int i = 0; i < parsedNames.size(); i++) { names.insert(parsedNames[i]); }
561 out << firstCol << '\t' << hold << endl;
562 wroteSomething = true;
564 //if the name in the first column is in the set then print it and any other names in second column also in set
565 if (names.count(firstCol) != 0) {
567 wroteSomething = true;
569 out << firstCol << '\t';
571 //you know you have at least one valid second since first column is valid
572 for (int i = 0; i < validSecond.size()-1; i++) { out << validSecond[i] << ','; }
573 out << validSecond[validSecond.size()-1] << endl;
576 //make first name in set you come to first column and then add the remaining names to second column
578 //you want part of this row
579 if (validSecond.size() != 0) {
581 wroteSomething = true;
583 out << validSecond[0] << '\t';
585 //you know you have at least one valid second since first column is valid
586 for (int i = 0; i < validSecond.size()-1; i++) { out << validSecond[i] << ','; }
587 out << validSecond[validSecond.size()-1] << endl;
596 if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
597 outputNames.push_back(outputFileName); outputTypes["name"].push_back(outputFileName);
602 catch(exception& e) {
603 m->errorOut(e, "GetSeqsCommand", "readName");
608 //**********************************************************************************************************************
609 int GetSeqsCommand::readGroup(){
611 string thisOutputDir = outputDir;
612 if (outputDir == "") { thisOutputDir += m->hasPath(groupfile); }
613 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(groupfile)) + "pick" + m->getExtension(groupfile);
615 m->openOutputFile(outputFileName, out);
619 m->openInputFile(groupfile, in);
622 bool wroteSomething = false;
626 if (m->control_pressed) { in.close(); out.close(); remove(outputFileName.c_str()); return 0; }
629 in >> name; //read from first column
630 in >> group; //read from second column
632 //if this name is in the accnos file
633 if (names.count(name) != 0) {
634 wroteSomething = true;
636 out << name << '\t' << group << endl;
644 if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
645 outputNames.push_back(outputFileName); outputTypes["group"].push_back(outputFileName);
650 catch(exception& e) {
651 m->errorOut(e, "GetSeqsCommand", "readGroup");
655 //**********************************************************************************************************************
656 int GetSeqsCommand::readTax(){
658 string thisOutputDir = outputDir;
659 if (outputDir == "") { thisOutputDir += m->hasPath(taxfile); }
660 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(taxfile)) + "pick" + m->getExtension(taxfile);
662 m->openOutputFile(outputFileName, out);
665 m->openInputFile(taxfile, in);
668 bool wroteSomething = false;
672 if (m->control_pressed) { in.close(); out.close(); remove(outputFileName.c_str()); return 0; }
674 in >> name; //read from first column
675 in >> tax; //read from second column
677 //if this name is in the accnos file
678 if (names.count(name) != 0) {
679 wroteSomething = true;
681 out << name << '\t' << tax << endl;
689 if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
690 outputNames.push_back(outputFileName); outputTypes["taxonomy"].push_back(outputFileName);
695 catch(exception& e) {
696 m->errorOut(e, "GetSeqsCommand", "readTax");
700 //**********************************************************************************************************************
701 //alignreport file has a column header line then all other lines contain 16 columns. we just want the first column since that contains the name
702 int GetSeqsCommand::readAlign(){
704 string thisOutputDir = outputDir;
705 if (outputDir == "") { thisOutputDir += m->hasPath(alignfile); }
706 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(alignfile)) + "pick.align.report";
708 m->openOutputFile(outputFileName, out);
712 m->openInputFile(alignfile, in);
715 bool wroteSomething = false;
717 //read column headers
718 for (int i = 0; i < 16; i++) {
719 if (!in.eof()) { in >> junk; out << junk << '\t'; }
726 if (m->control_pressed) { in.close(); out.close(); remove(outputFileName.c_str()); return 0; }
729 in >> name; //read from first column
731 //if this name is in the accnos file
732 if (names.count(name) != 0) {
733 wroteSomething = true;
738 for (int i = 0; i < 15; i++) {
739 if (!in.eof()) { in >> junk; out << junk << '\t'; }
744 }else {//still read just don't do anything with it
746 for (int i = 0; i < 15; i++) {
747 if (!in.eof()) { in >> junk; }
757 if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
758 outputNames.push_back(outputFileName); outputTypes["alignreport"].push_back(outputFileName);
763 catch(exception& e) {
764 m->errorOut(e, "GetSeqsCommand", "readAlign");
768 //**********************************************************************************************************************
770 int GetSeqsCommand::readAccnos(){
774 m->openInputFile(accnosfile, in);
789 catch(exception& e) {
790 m->errorOut(e, "GetSeqsCommand", "readAccnos");
794 //**********************************************************************************************************************
796 int GetSeqsCommand::compareAccnos(){
799 string thisOutputDir = outputDir;
800 if (outputDir == "") { thisOutputDir += m->hasPath(accnosfile); }
801 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(accnosfile)) + "accnos.report";
803 m->openOutputFile(outputFileName, out);
806 m->openInputFile(accnosfile2, in);
809 set<string> namesAccnos2;
810 set<string> namesDups;
811 set<string> namesAccnos = names;
813 map<string, int> nameCount;
815 if (namefile != "") {
817 m->openInputFile(namefile, inName);
820 while(!inName.eof()){
822 if (m->control_pressed) { inName.close(); return 0; }
824 string thisname, repnames;
826 inName >> thisname; m->gobble(inName); //read from first column
827 inName >> repnames; //read from second column
829 int num = m->getNumNames(repnames);
830 nameCount[thisname] = num;
840 if (namesAccnos.count(name) == 0){ //name unique to accnos2
841 namesAccnos2.insert(name);
842 }else { //you are in both so erase
843 namesAccnos.erase(name);
844 namesDups.insert(name);
851 out << "Names in both files : " + toString(namesDups.size()) << endl;
852 m->mothurOut("Names in both files : " + toString(namesDups.size())); m->mothurOutEndLine();
854 for (set<string>::iterator it = namesDups.begin(); it != namesDups.end(); it++) {
856 if (namefile != "") { out << '\t' << nameCount[(*it)]; }
860 out << "Names unique to " + accnosfile + " : " + toString(namesAccnos.size()) << endl;
861 m->mothurOut("Names unique to " + accnosfile + " : " + toString(namesAccnos.size())); m->mothurOutEndLine();
863 for (set<string>::iterator it = namesAccnos.begin(); it != namesAccnos.end(); it++) {
865 if (namefile != "") { out << '\t' << nameCount[(*it)]; }
869 out << "Names unique to " + accnosfile2 + " : " + toString(namesAccnos2.size()) << endl;
870 m->mothurOut("Names unique to " + accnosfile2 + " : " + toString(namesAccnos2.size())); m->mothurOutEndLine();
872 for (set<string>::iterator it = namesAccnos2.begin(); it != namesAccnos2.end(); it++) {
874 if (namefile != "") { out << '\t' << nameCount[(*it)]; }
880 outputNames.push_back(outputFileName); outputTypes["accnosreport"].push_back(outputFileName);
885 catch(exception& e) {
886 m->errorOut(e, "GetSeqsCommand", "readAccnos");
892 //**********************************************************************************************************************