2 * getlineagecommand.cpp
5 * Created by westcott on 9/24/10.
6 * Copyright 2010 Schloss Lab. All rights reserved.
10 #include "getlineagecommand.h"
11 #include "sequence.hpp"
12 #include "listvector.hpp"
14 //**********************************************************************************************************************
15 vector<string> GetLineageCommand::setParameters(){
17 CommandParameter pfasta("fasta", "InputTypes", "", "", "none", "FNGLT", "none",false,false); parameters.push_back(pfasta);
18 CommandParameter pname("name", "InputTypes", "", "", "none", "FNGLT", "none",false,false); parameters.push_back(pname);
19 CommandParameter pgroup("group", "InputTypes", "", "", "none", "FNGLT", "none",false,false); parameters.push_back(pgroup);
20 CommandParameter plist("list", "InputTypes", "", "", "none", "FNGLT", "none",false,false); parameters.push_back(plist);
21 CommandParameter ptaxonomy("taxonomy", "InputTypes", "", "", "none", "FNGLT", "none",false,true); parameters.push_back(ptaxonomy);
22 CommandParameter palignreport("alignreport", "InputTypes", "", "", "none", "FNGLT", "none",false,false); parameters.push_back(palignreport);
23 CommandParameter ptaxon("taxon", "String", "", "", "", "", "",false,true); parameters.push_back(ptaxon);
24 CommandParameter pdups("dups", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pdups);
25 CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir);
26 CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir);
28 vector<string> myArray;
29 for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); }
33 m->errorOut(e, "GetLineageCommand", "setParameters");
37 //**********************************************************************************************************************
38 string GetLineageCommand::getHelpString(){
40 string helpString = "";
41 helpString += "The get.lineage command reads a taxonomy file and any of the following file types: fasta, name, group, list or alignreport file.\n";
42 helpString += "It outputs a file containing only the sequences from the taxonomy file that are from the taxon requested.\n";
43 helpString += "The get.lineage command parameters are taxon, fasta, name, group, list, taxonomy, alignreport and dups. You must provide taxonomy unless you have a valid current taxonomy file.\n";
44 helpString += "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";
45 helpString += "The taxon parameter allows you to select the taxons you would like to get and is required.\n";
46 helpString += "You may enter your taxons with confidence scores, doing so will get only those sequences that belong to the taxonomy and whose cofidence scores is above the scores you give.\n";
47 helpString += "If they belong to the taxonomy and have confidences below those you provide the sequence will not be selected.\n";
48 helpString += "The get.lineage command should be in the following format: get.lineage(taxonomy=yourTaxonomyFile, taxon=yourTaxons).\n";
49 helpString += "Example get.lineage(taxonomy=amazon.silva.taxonomy, taxon=Bacteria;Firmicutes;Bacilli;Lactobacillales;).\n";
50 helpString += "Note: If you are running mothur in script mode you must wrap the taxon in ' characters so mothur will ignore the ; in the taxon.\n";
51 helpString += "Example get.lineage(taxonomy=amazon.silva.taxonomy, taxon='Bacteria;Firmicutes;Bacilli;Lactobacillales;').\n";
52 helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n";
56 m->errorOut(e, "GetLineageCommand", "getHelpString");
61 //**********************************************************************************************************************
62 GetLineageCommand::GetLineageCommand(){
64 abort = true; calledHelp = true;
66 vector<string> tempOutNames;
67 outputTypes["fasta"] = tempOutNames;
68 outputTypes["taxonomy"] = tempOutNames;
69 outputTypes["name"] = tempOutNames;
70 outputTypes["group"] = tempOutNames;
71 outputTypes["alignreport"] = tempOutNames;
72 outputTypes["list"] = tempOutNames;
75 m->errorOut(e, "GetLineageCommand", "GetLineageCommand");
79 //**********************************************************************************************************************
80 GetLineageCommand::GetLineageCommand(string option) {
82 abort = false; calledHelp = false;
84 //allow user to run help
85 if(option == "help") { help(); abort = true; calledHelp = true; }
86 else if(option == "citation") { citation(); abort = true; calledHelp = true;}
89 vector<string> myArray = setParameters();
91 OptionParser parser(option);
92 map<string,string> parameters = parser.getParameters();
94 ValidParameters validParameter;
95 map<string,string>::iterator it;
97 //check to make sure all parameters are valid for command
98 for (it = parameters.begin(); it != parameters.end(); it++) {
99 if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
102 //initialize outputTypes
103 vector<string> tempOutNames;
104 outputTypes["fasta"] = tempOutNames;
105 outputTypes["taxonomy"] = tempOutNames;
106 outputTypes["name"] = tempOutNames;
107 outputTypes["group"] = tempOutNames;
108 outputTypes["alignreport"] = tempOutNames;
109 outputTypes["list"] = tempOutNames;
111 //if the user changes the output directory command factory will send this info to us in the output parameter
112 outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = ""; }
114 //if the user changes the input directory command factory will send this info to us in the output parameter
115 string inputDir = validParameter.validFile(parameters, "inputdir", false);
116 if (inputDir == "not found"){ inputDir = ""; }
119 it = parameters.find("alignreport");
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["alignreport"] = inputDir + it->second; }
127 it = parameters.find("fasta");
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["fasta"] = inputDir + it->second; }
135 it = parameters.find("list");
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["list"] = inputDir + it->second; }
143 it = parameters.find("name");
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["name"] = inputDir + it->second; }
151 it = parameters.find("group");
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["group"] = inputDir + it->second; }
159 it = parameters.find("taxonomy");
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["taxonomy"] = inputDir + it->second; }
169 //check for required parameters
170 fastafile = validParameter.validFile(parameters, "fasta", true);
171 if (fastafile == "not open") { fastafile = ""; abort = true; }
172 else if (fastafile == "not found") { fastafile = ""; }
173 else { m->setFastaFile(fastafile); }
175 namefile = validParameter.validFile(parameters, "name", true);
176 if (namefile == "not open") { namefile = ""; abort = true; }
177 else if (namefile == "not found") { namefile = ""; }
178 else { m->setNameFile(namefile); }
180 groupfile = validParameter.validFile(parameters, "group", true);
181 if (groupfile == "not open") { abort = true; }
182 else if (groupfile == "not found") { groupfile = ""; }
183 else { m->setGroupFile(groupfile); }
185 alignfile = validParameter.validFile(parameters, "alignreport", true);
186 if (alignfile == "not open") { abort = true; }
187 else if (alignfile == "not found") { alignfile = ""; }
189 listfile = validParameter.validFile(parameters, "list", true);
190 if (listfile == "not open") { abort = true; }
191 else if (listfile == "not found") { listfile = ""; }
192 else { m->setListFile(listfile); }
194 taxfile = validParameter.validFile(parameters, "taxonomy", true);
195 if (taxfile == "not open") { taxfile = ""; abort = true; }
196 else if (taxfile == "not found") {
197 taxfile = m->getTaxonomyFile();
198 if (taxfile != "") { m->mothurOut("Using " + taxfile + " as input file for the taxonomy parameter."); m->mothurOutEndLine(); }
199 else { m->mothurOut("You have no current taxonomy file and the taxonomy parameter is required."); m->mothurOutEndLine(); abort = true; }
200 }else { m->setTaxonomyFile(taxfile); }
202 string usedDups = "true";
203 string temp = validParameter.validFile(parameters, "dups", false);
204 if (temp == "not found") {
205 if (namefile != "") { temp = "true"; }
206 else { temp = "false"; usedDups = ""; }
208 dups = m->isTrue(temp);
210 taxons = validParameter.validFile(parameters, "taxon", false);
211 if (taxons == "not found") { taxons = ""; m->mothurOut("No taxons given, please correct."); m->mothurOutEndLine(); abort = true; }
214 if (taxons[0] == '\'') { taxons = taxons.substr(1); }
215 if (taxons[(taxons.length()-1)] == '\'') { taxons = taxons.substr(0, (taxons.length()-1)); }
217 m->splitAtChar(taxons, listOfTaxons, '-');
219 if ((fastafile == "") && (namefile == "") && (groupfile == "") && (alignfile == "") && (listfile == "") && (taxfile == "")) { m->mothurOut("You must provide one of the following: fasta, name, group, alignreport, taxonomy or listfile."); m->mothurOutEndLine(); abort = true; }
221 if ((namefile == "") && ((fastafile != "") || (taxfile != ""))){
222 vector<string> files; files.push_back(fastafile); files.push_back(taxfile);
223 parser.getNameFile(files);
228 catch(exception& e) {
229 m->errorOut(e, "GetLineageCommand", "GetLineageCommand");
233 //**********************************************************************************************************************
235 int GetLineageCommand::execute(){
238 if (abort == true) { if (calledHelp) { return 0; } return 2; }
240 if (m->control_pressed) { return 0; }
242 //read through the correct file and output lines you want to keep
243 if (taxfile != "") { readTax(); } //fills the set of names to get
244 if (namefile != "") { readName(); }
245 if (fastafile != "") { readFasta(); }
246 if (groupfile != "") { readGroup(); }
247 if (alignfile != "") { readAlign(); }
248 if (listfile != "") { readList(); }
251 if (m->control_pressed) { outputTypes.clear(); for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } return 0; }
253 if (outputNames.size() != 0) {
254 m->mothurOutEndLine();
255 m->mothurOut("Output File Names: "); m->mothurOutEndLine();
256 for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }
257 m->mothurOutEndLine();
259 //set fasta file as new current fastafile
261 itTypes = outputTypes.find("fasta");
262 if (itTypes != outputTypes.end()) {
263 if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setFastaFile(current); }
266 itTypes = outputTypes.find("name");
267 if (itTypes != outputTypes.end()) {
268 if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setNameFile(current); }
271 itTypes = outputTypes.find("group");
272 if (itTypes != outputTypes.end()) {
273 if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setGroupFile(current); }
276 itTypes = outputTypes.find("list");
277 if (itTypes != outputTypes.end()) {
278 if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setListFile(current); }
281 itTypes = outputTypes.find("taxonomy");
282 if (itTypes != outputTypes.end()) {
283 if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setTaxonomyFile(current); }
290 catch(exception& e) {
291 m->errorOut(e, "GetLineageCommand", "execute");
296 //**********************************************************************************************************************
297 int GetLineageCommand::readFasta(){
299 string thisOutputDir = outputDir;
300 if (outputDir == "") { thisOutputDir += m->hasPath(fastafile); }
301 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(fastafile)) + "pick" + m->getExtension(fastafile);
303 m->openOutputFile(outputFileName, out);
307 m->openInputFile(fastafile, in);
310 bool wroteSomething = false;
314 if (m->control_pressed) { in.close(); out.close(); m->mothurRemove(outputFileName); return 0; }
316 Sequence currSeq(in);
317 name = currSeq.getName();
320 //if this name is in the accnos file
321 if (names.count(name) != 0) {
322 wroteSomething = true;
324 currSeq.printSequence(out);
332 if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
333 outputNames.push_back(outputFileName); outputTypes["fasta"].push_back(outputFileName);
338 catch(exception& e) {
339 m->errorOut(e, "GetLineageCommand", "readFasta");
343 //**********************************************************************************************************************
344 int GetLineageCommand::readList(){
346 string thisOutputDir = outputDir;
347 if (outputDir == "") { thisOutputDir += m->hasPath(listfile); }
348 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(listfile)) + "pick" + m->getExtension(listfile);
350 m->openOutputFile(outputFileName, out);
353 m->openInputFile(listfile, in);
355 bool wroteSomething = false;
359 if (m->control_pressed) { in.close(); out.close(); m->mothurRemove(outputFileName); return 0; }
361 //read in list vector
364 //make a new list vector
366 newList.setLabel(list.getLabel());
369 for (int i = 0; i < list.getNumBins(); i++) {
371 //parse out names that are in accnos file
372 string binnames = list.get(i);
374 string newNames = "";
375 while (binnames.find_first_of(',') != -1) {
376 string name = binnames.substr(0,binnames.find_first_of(','));
377 binnames = binnames.substr(binnames.find_first_of(',')+1, binnames.length());
379 //if that name is in the .accnos file, add it
380 if (names.count(name) != 0) { newNames += name + ","; }
384 if (names.count(binnames) != 0) { newNames += binnames + ","; }
386 //if there are names in this bin add to new list
387 if (newNames != "") {
388 newNames = newNames.substr(0, newNames.length()-1); //rip off extra comma
389 newList.push_back(newNames);
393 //print new listvector
394 if (newList.getNumBins() != 0) {
395 wroteSomething = true;
404 if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
405 outputNames.push_back(outputFileName); outputTypes["list"].push_back(outputFileName);
410 catch(exception& e) {
411 m->errorOut(e, "GetLineageCommand", "readList");
415 //**********************************************************************************************************************
416 int GetLineageCommand::readName(){
418 string thisOutputDir = outputDir;
419 if (outputDir == "") { thisOutputDir += m->hasPath(namefile); }
420 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(namefile)) + "pick" + m->getExtension(namefile);
422 m->openOutputFile(outputFileName, out);
426 m->openInputFile(namefile, in);
427 string name, firstCol, secondCol;
429 bool wroteSomething = false;
434 if (m->control_pressed) { in.close(); out.close(); m->mothurRemove(outputFileName); return 0; }
440 if (dups) { hold = secondCol; }
442 vector<string> parsedNames;
443 m->splitAtComma(secondCol, parsedNames);
445 vector<string> validSecond;
446 for (int i = 0; i < parsedNames.size(); i++) {
447 if (names.count(parsedNames[i]) != 0) {
448 validSecond.push_back(parsedNames[i]);
452 if ((dups) && (validSecond.size() != 0)) { //dups = true and we want to add someone, then add everyone
453 for (int i = 0; i < parsedNames.size(); i++) { names.insert(parsedNames[i]); }
454 out << firstCol << '\t' << hold << endl;
455 wroteSomething = true;
457 //if the name in the first column is in the set then print it and any other names in second column also in set
458 if (names.count(firstCol) != 0) {
460 wroteSomething = true;
462 out << firstCol << '\t';
464 //you know you have at least one valid second since first column is valid
465 for (int i = 0; i < validSecond.size()-1; i++) { out << validSecond[i] << ','; }
466 out << validSecond[validSecond.size()-1] << endl;
469 //make first name in set you come to first column and then add the remaining names to second column
471 //you want part of this row
472 if (validSecond.size() != 0) {
474 wroteSomething = true;
476 out << validSecond[0] << '\t';
478 //you know you have at least one valid second since first column is valid
479 for (int i = 0; i < validSecond.size()-1; i++) { out << validSecond[i] << ','; }
480 out << validSecond[validSecond.size()-1] << endl;
489 if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
490 outputNames.push_back(outputFileName); outputTypes["name"].push_back(outputFileName);
495 catch(exception& e) {
496 m->errorOut(e, "GetLineageCommand", "readName");
501 //**********************************************************************************************************************
502 int GetLineageCommand::readGroup(){
504 string thisOutputDir = outputDir;
505 if (outputDir == "") { thisOutputDir += m->hasPath(groupfile); }
506 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(groupfile)) + "pick" + m->getExtension(groupfile);
508 m->openOutputFile(outputFileName, out);
512 m->openInputFile(groupfile, in);
515 bool wroteSomething = false;
519 if (m->control_pressed) { in.close(); out.close(); m->mothurRemove(outputFileName); return 0; }
522 in >> name; //read from first column
523 in >> group; //read from second column
525 //if this name is in the accnos file
526 if (names.count(name) != 0) {
527 wroteSomething = true;
529 out << name << '\t' << group << endl;
537 if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
538 outputNames.push_back(outputFileName); outputTypes["group"].push_back(outputFileName);
543 catch(exception& e) {
544 m->errorOut(e, "GetLineageCommand", "readGroup");
548 //**********************************************************************************************************************
549 int GetLineageCommand::readTax(){
551 string thisOutputDir = outputDir;
552 if (outputDir == "") { thisOutputDir += m->hasPath(taxfile); }
553 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(taxfile)) + "pick" + m->getExtension(taxfile);
555 m->openOutputFile(outputFileName, out);
558 m->openInputFile(taxfile, in);
561 //bool wroteSomething = false;
562 vector<bool> taxonsHasConfidence; taxonsHasConfidence.resize(listOfTaxons.size(), false);
563 vector< vector< map<string, float> > > searchTaxons; searchTaxons.resize(listOfTaxons.size());
564 vector<string> noConfidenceTaxons; noConfidenceTaxons.resize(listOfTaxons.size(), "");
566 for (int i = 0; i < listOfTaxons.size(); i++) {
567 noConfidenceTaxons[i] = listOfTaxons[i];
568 int hasConPos = listOfTaxons[i].find_first_of('(');
569 if (hasConPos != string::npos) {
570 taxonsHasConfidence[i] = true;
571 searchTaxons[i] = getTaxons(listOfTaxons[i]);
572 noConfidenceTaxons[i] = listOfTaxons[i];
573 m->removeConfidences(noConfidenceTaxons[i]);
580 if (m->control_pressed) { in.close(); out.close(); m->mothurRemove(outputFileName); return 0; }
582 in >> name; //read from first column
583 in >> tax; //read from second column
585 for (int j = 0; j < listOfTaxons.size(); j++) {
589 //if the users file contains confidence scores we want to ignore them when searching for the taxons, unless the taxon has them
590 if (!taxonsHasConfidence[j]) {
591 int hasConfidences = tax.find_first_of('(');
592 if (hasConfidences != string::npos) {
594 m->removeConfidences(newtax);
597 int pos = newtax.find(noConfidenceTaxons[j]);
599 if (pos != string::npos) { //this sequence contains the taxon the user wants
601 out << name << '\t' << tax << endl;
602 //since you belong to at least one of the taxons we want you are included so no need to search for other
605 }else{//if listOfTaxons[i] has them and you don't them remove taxons
606 int hasConfidences = tax.find_first_of('(');
607 if (hasConfidences == string::npos) {
609 int pos = newtax.find(noConfidenceTaxons[j]);
611 if (pos != string::npos) { //this sequence contains the taxon the user wants
613 out << name << '\t' << tax << endl;
614 //since you belong to at least one of the taxons we want you are included so no need to search for other
617 }else { //both have confidences so we want to make sure the users confidences are greater then or equal to the taxons
618 //first remove confidences from both and see if the taxonomy exists
620 string noNewTax = tax;
621 int hasConfidences = tax.find_first_of('(');
622 if (hasConfidences != string::npos) {
624 m->removeConfidences(noNewTax);
627 int pos = noNewTax.find(noConfidenceTaxons[j]);
629 if (pos != string::npos) { //if yes, then are the confidences okay
632 vector< map<string, float> > usersTaxon = getTaxons(newtax);
634 //the usersTaxon is most likely longer than the searchTaxons, and searchTaxon[0] may relate to userTaxon[4]
635 //we want to "line them up", so we will find the the index where the searchstring starts
637 for (int i = 0; i < usersTaxon.size(); i++) {
639 if (usersTaxon[i].begin()->first == searchTaxons[j][0].begin()->first) {
642 bool goodspot = true;
643 //is this really the start, or are we dealing with a taxon of the same name?
644 while ((spot < searchTaxons[j].size()) && ((i+spot) < usersTaxon.size())) {
645 if (usersTaxon[i+spot].begin()->first != searchTaxons[j][spot].begin()->first) { goodspot = false; break; }
649 if (goodspot) { break; }
653 for (int i = 0; i < searchTaxons[j].size(); i++) {
655 if ((i+index) < usersTaxon.size()) { //just in case, should never be false
656 if (usersTaxon[i+index].begin()->second < searchTaxons[j][i].begin()->second) { //is the users cutoff less than the search taxons
666 //passed the test so add you
669 out << name << '\t' << tax << endl;
683 if (names.size() == 0) { m->mothurOut("Your taxonomy file does not contain any sequences from " + taxons + "."); m->mothurOutEndLine(); }
684 outputNames.push_back(outputFileName); outputTypes["taxonomy"].push_back(outputFileName);
689 catch(exception& e) {
690 m->errorOut(e, "GetLineageCommand", "readTax");
694 /**************************************************************************************************/
695 vector< map<string, float> > GetLineageCommand::getTaxons(string tax) {
698 vector< map<string, float> > t;
700 int taxLength = tax.length();
701 for(int i=0;i<taxLength;i++){
704 int openParen = taxon.find_first_of('(');
705 int closeParen = taxon.find_last_of(')');
707 string newtaxon, confidence;
708 if ((openParen != string::npos) && (closeParen != string::npos)) {
709 newtaxon = taxon.substr(0, openParen); //rip off confidence
710 confidence = taxon.substr((openParen+1), (closeParen-openParen-1));
716 convert(confidence, con);
718 map<string, float> temp;
719 temp[newtaxon] = con;
731 catch(exception& e) {
732 m->errorOut(e, "GetLineageCommand", "getTaxons");
736 //**********************************************************************************************************************
737 //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
738 int GetLineageCommand::readAlign(){
740 string thisOutputDir = outputDir;
741 if (outputDir == "") { thisOutputDir += m->hasPath(alignfile); }
742 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(alignfile)) + "pick.align.report";
744 m->openOutputFile(outputFileName, out);
748 m->openInputFile(alignfile, in);
751 bool wroteSomething = false;
753 //read column headers
754 for (int i = 0; i < 16; i++) {
755 if (!in.eof()) { in >> junk; out << junk << '\t'; }
762 if (m->control_pressed) { in.close(); out.close(); m->mothurRemove(outputFileName); return 0; }
765 in >> name; //read from first column
767 //if this name is in the accnos file
768 if (names.count(name) != 0) {
769 wroteSomething = true;
774 for (int i = 0; i < 15; i++) {
775 if (!in.eof()) { in >> junk; out << junk << '\t'; }
780 }else {//still read just don't do anything with it
782 for (int i = 0; i < 15; i++) {
783 if (!in.eof()) { in >> junk; }
793 if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
794 outputNames.push_back(outputFileName); outputTypes["alignreport"].push_back(outputFileName);
799 catch(exception& e) {
800 m->errorOut(e, "GetLineageCommand", "readAlign");
804 //**********************************************************************************************************************