]> git.donarmstrong.com Git - mothur.git/blob - removeseqscommand.cpp
added pipeline commands which involved change to command factory and command class...
[mothur.git] / removeseqscommand.cpp
1 /*
2  *  removeseqscommand.cpp
3  *  Mothur
4  *
5  *  Created by Sarah Westcott on 7/8/09.
6  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
7  *
8  */
9
10 #include "removeseqscommand.h"
11 #include "sequence.hpp"
12 #include "listvector.hpp"
13
14 //**********************************************************************************************************************
15 vector<string> RemoveSeqsCommand::getValidParameters(){ 
16         try {
17                 string Array[] =  {"fasta","name", "group", "alignreport", "accnos", "list","taxonomy","outputdir","inputdir", "dups" };
18                 vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
19                 return myArray;
20         }
21         catch(exception& e) {
22                 m->errorOut(e, "RemoveSeqsCommand", "getValidParameters");
23                 exit(1);
24         }
25 }
26 //**********************************************************************************************************************
27 RemoveSeqsCommand::RemoveSeqsCommand(){ 
28         try {
29                 //initialize outputTypes
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         }
38         catch(exception& e) {
39                 m->errorOut(e, "RemoveSeqsCommand", "RemoveSeqsCommand");
40                 exit(1);
41         }
42 }
43 //**********************************************************************************************************************
44 vector<string> RemoveSeqsCommand::getRequiredParameters(){      
45         try {
46                 string Array[] =  {"accnos"};
47                 vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
48                 return myArray;
49         }
50         catch(exception& e) {
51                 m->errorOut(e, "RemoveSeqsCommand", "getRequiredParameters");
52                 exit(1);
53         }
54 }
55 //**********************************************************************************************************************
56 vector<string> RemoveSeqsCommand::getRequiredFiles(){   
57         try {
58                 vector<string> myArray;
59                 return myArray;
60         }
61         catch(exception& e) {
62                 m->errorOut(e, "RemoveSeqsCommand", "getRequiredFiles");
63                 exit(1);
64         }
65 }
66 //**********************************************************************************************************************
67 RemoveSeqsCommand::RemoveSeqsCommand(string option)  {
68         try {
69                 abort = false;
70                 
71                 //allow user to run help
72                 if(option == "help") { help(); abort = true; }
73                 
74                 else {
75                         //valid paramters for this command
76                         string Array[] =  {"fasta","name", "group", "alignreport", "accnos", "list","taxonomy","outputdir","inputdir", "dups" };
77                         vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
78                         
79                         OptionParser parser(option);
80                         map<string,string> parameters = parser.getParameters();
81                         
82                         ValidParameters validParameter;
83                         map<string,string>::iterator it;
84                         
85                         //check to make sure all parameters are valid for command
86                         for (it = parameters.begin(); it != parameters.end(); it++) { 
87                                 if (validParameter.isValidParameter(it->first, myArray, it->second) != true) {  abort = true;  }
88                         }
89                         
90                         //initialize outputTypes
91                         vector<string> tempOutNames;
92                         outputTypes["fasta"] = tempOutNames;
93                         outputTypes["taxonomy"] = tempOutNames;
94                         outputTypes["name"] = tempOutNames;
95                         outputTypes["group"] = tempOutNames;
96                         outputTypes["alignreport"] = tempOutNames;
97                         outputTypes["list"] = tempOutNames;
98                         
99                         //if the user changes the output directory command factory will send this info to us in the output parameter 
100                         outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  outputDir = "";         }
101                         
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 = "";          }
105                         else {
106                                 string path;
107                                 it = parameters.find("alignreport");
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["alignreport"] = inputDir + it->second;              }
113                                 }
114                                 
115                                 it = parameters.find("fasta");
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["fasta"] = inputDir + it->second;            }
121                                 }
122                                 
123                                 it = parameters.find("accnos");
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["accnos"] = inputDir + it->second;           }
129                                 }
130                                 
131                                 it = parameters.find("list");
132                                 //user has given a template file
133                                 if(it != parameters.end()){ 
134                                         path = m->hasPath(it->second);
135                                         //if the user has not given a path then, add inputdir. else leave path alone.
136                                         if (path == "") {       parameters["list"] = inputDir + it->second;             }
137                                 }
138                                 
139                                 it = parameters.find("name");
140                                 //user has given a template file
141                                 if(it != parameters.end()){ 
142                                         path = m->hasPath(it->second);
143                                         //if the user has not given a path then, add inputdir. else leave path alone.
144                                         if (path == "") {       parameters["name"] = inputDir + it->second;             }
145                                 }
146                                 
147                                 it = parameters.find("group");
148                                 //user has given a template file
149                                 if(it != parameters.end()){ 
150                                         path = m->hasPath(it->second);
151                                         //if the user has not given a path then, add inputdir. else leave path alone.
152                                         if (path == "") {       parameters["group"] = inputDir + it->second;            }
153                                 }
154                                 
155                                 it = parameters.find("taxonomy");
156                                 //user has given a template file
157                                 if(it != parameters.end()){ 
158                                         path = m->hasPath(it->second);
159                                         //if the user has not given a path then, add inputdir. else leave path alone.
160                                         if (path == "") {       parameters["taxonomy"] = inputDir + it->second;         }
161                                 }
162                         }
163
164                         
165                         //check for required parameters
166                         accnosfile = validParameter.validFile(parameters, "accnos", true);
167                         if (accnosfile == "not open") { abort = true; }
168                         else if (accnosfile == "not found") {  accnosfile = "";  m->mothurOut("You must provide an accnos file."); m->mothurOutEndLine(); abort = true; }       
169                         
170                         fastafile = validParameter.validFile(parameters, "fasta", true);
171                         if (fastafile == "not open") { abort = true; }
172                         else if (fastafile == "not found") {  fastafile = "";  }        
173                         
174                         namefile = validParameter.validFile(parameters, "name", true);
175                         if (namefile == "not open") { abort = true; }
176                         else if (namefile == "not found") {  namefile = "";  }  
177                         
178                         groupfile = validParameter.validFile(parameters, "group", true);
179                         if (groupfile == "not open") { abort = true; }
180                         else if (groupfile == "not found") {  groupfile = "";  }        
181                         
182                         alignfile = validParameter.validFile(parameters, "alignreport", true);
183                         if (alignfile == "not open") { abort = true; }
184                         else if (alignfile == "not found") {  alignfile = "";  }
185                         
186                         listfile = validParameter.validFile(parameters, "list", true);
187                         if (listfile == "not open") { abort = true; }
188                         else if (listfile == "not found") {  listfile = "";  }
189                         
190                         taxfile = validParameter.validFile(parameters, "taxonomy", true);
191                         if (taxfile == "not open") { abort = true; }
192                         else if (taxfile == "not found") {  taxfile = "";  }
193
194                         
195                         string usedDups = "true";
196                         string temp = validParameter.validFile(parameters, "dups", false);      
197                         if (temp == "not found") { 
198                                 if (namefile != "") {  temp = "true";                                   }
199                                 else                            {  temp = "false"; usedDups = "";       }
200                         }
201                         dups = m->isTrue(temp);
202                         
203                         if ((fastafile == "") && (namefile == "") && (groupfile == "") && (alignfile == "") && (listfile == "") && (taxfile == ""))  { m->mothurOut("You must provide at least one of the following: fasta, name, group, taxonomy, alignreport or list."); m->mothurOutEndLine(); abort = true; }
204                         
205                         if ((usedDups != "") && (namefile == "")) {  m->mothurOut("You may only use dups with the name option."); m->mothurOutEndLine();  abort = true; }                       
206                 }
207
208         }
209         catch(exception& e) {
210                 m->errorOut(e, "RemoveSeqsCommand", "RemoveSeqsCommand");
211                 exit(1);
212         }
213 }
214 //**********************************************************************************************************************
215
216 void RemoveSeqsCommand::help(){
217         try {
218                 m->mothurOut("The remove.seqs command reads an .accnos file and at least one of the following file types: fasta, name, group, list, taxonomy or alignreport file.\n");
219                 m->mothurOut("It outputs a file containing the sequences NOT in the .accnos file.\n");
220                 m->mothurOut("The remove.seqs command parameters are accnos, fasta, name, group, list, taxonomy, alignreport and dups.  You must provide accnos and at least one of the file parameters.\n");
221                 m->mothurOut("The dups parameter allows you to remove the entire line from a name file if you remove any name from the line. default=true. \n");
222                 m->mothurOut("The remove.seqs command should be in the following format: remove.seqs(accnos=yourAccnos, fasta=yourFasta).\n");
223                 m->mothurOut("Example remove.seqs(accnos=amazon.accnos, fasta=amazon.fasta).\n");
224                 m->mothurOut("Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n");
225         }
226         catch(exception& e) {
227                 m->errorOut(e, "RemoveSeqsCommand", "help");
228                 exit(1);
229         }
230 }
231
232 //**********************************************************************************************************************
233
234 int RemoveSeqsCommand::execute(){
235         try {
236                 
237                 if (abort == true) { return 0; }
238                 
239                 //get names you want to keep
240                 readAccnos();
241                 
242                 if (m->control_pressed) { return 0; }
243                 
244                 //read through the correct file and output lines you want to keep
245                 if (namefile != "")                     {               readName();             }
246                 if (fastafile != "")            {               readFasta();    }
247                 if (groupfile != "")            {               readGroup();    }
248                 if (alignfile != "")            {               readAlign();    }
249                 if (listfile != "")                     {               readList();             }
250                 if (taxfile != "")                      {               readTax();              }
251                 
252                 if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) {        remove(outputNames[i].c_str()); } return 0; }
253                 
254                 if (outputNames.size() != 0) {
255                         m->mothurOutEndLine();
256                         m->mothurOut("Output File Names: "); m->mothurOutEndLine();
257                         for (int i = 0; i < outputNames.size(); i++) {  m->mothurOut(outputNames[i]); m->mothurOutEndLine();    }
258                         m->mothurOutEndLine();
259                 }
260                 
261                 return 0;               
262         }
263
264         catch(exception& e) {
265                 m->errorOut(e, "RemoveSeqsCommand", "execute");
266                 exit(1);
267         }
268 }
269
270 //**********************************************************************************************************************
271 int RemoveSeqsCommand::readFasta(){
272         try {
273                 string thisOutputDir = outputDir;
274                 if (outputDir == "") {  thisOutputDir += m->hasPath(fastafile);  }
275                 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(fastafile)) + "pick" + m->getExtension(fastafile);
276                 
277                 ofstream out;
278                 m->openOutputFile(outputFileName, out);
279                 
280                 ifstream in;
281                 m->openInputFile(fastafile, in);
282                 string name;
283                 
284                 bool wroteSomething = false;
285                 
286                 while(!in.eof()){
287                         if (m->control_pressed) { in.close();  out.close();  remove(outputFileName.c_str());  return 0; }
288                         
289                         Sequence currSeq(in);
290                         name = currSeq.getName();
291                         
292                         if (name != "") {
293                                 //if this name is in the accnos file
294                                 if (names.count(name) == 0) {
295                                         wroteSomething = true;
296                                         
297                                         currSeq.printSequence(out);
298                                 }
299                         }
300                         m->gobble(in);
301                 }
302                 in.close();     
303                 out.close();
304                 
305                 if (wroteSomething == false) {  m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();  }
306                 outputTypes["fasta"].push_back(outputFileName); 
307                 
308                 return 0;
309                 
310         }
311         catch(exception& e) {
312                 m->errorOut(e, "RemoveSeqsCommand", "readFasta");
313                 exit(1);
314         }
315 }
316 //**********************************************************************************************************************
317 int RemoveSeqsCommand::readList(){
318         try {
319                 string thisOutputDir = outputDir;
320                 if (outputDir == "") {  thisOutputDir += m->hasPath(listfile);  }
321                 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(listfile)) + "pick" +  m->getExtension(listfile);
322                 
323                 ofstream out;
324                 m->openOutputFile(outputFileName, out);
325                 
326                 ifstream in;
327                 m->openInputFile(listfile, in);
328                 
329                 bool wroteSomething = false;
330                 
331                 while(!in.eof()){
332                         //read in list vector
333                         ListVector list(in);
334                         
335                         //make a new list vector
336                         ListVector newList;
337                         newList.setLabel(list.getLabel());
338                         
339                         //for each bin
340                         for (int i = 0; i < list.getNumBins(); i++) {
341                                 if (m->control_pressed) { in.close();  out.close();  remove(outputFileName.c_str());  return 0; }
342                         
343                                 //parse out names that are in accnos file
344                                 string binnames = list.get(i);
345                                 
346                                 string newNames = "";
347                                 while (binnames.find_first_of(',') != -1) { 
348                                         string name = binnames.substr(0,binnames.find_first_of(','));
349                                         binnames = binnames.substr(binnames.find_first_of(',')+1, binnames.length());
350                                         
351                                         //if that name is in the .accnos file, add it
352                                         if (names.count(name) == 0) {  newNames += name + ",";  }
353                                 }
354                         
355                                 //get last name
356                                 if (names.count(binnames) == 0) {  newNames += binnames + ",";  }
357
358                                 //if there are names in this bin add to new list
359                                 if (newNames != "") {  
360                                         newNames = newNames.substr(0, newNames.length()-1); //rip off extra comma
361                                         newList.push_back(newNames);    
362                                 }
363                         }
364                                 
365                         //print new listvector
366                         if (newList.getNumBins() != 0) {
367                                 wroteSomething = true;
368                                 newList.print(out);
369                         }
370                         
371                         m->gobble(in);
372                 }
373                 in.close();     
374                 out.close();
375                 
376                 if (wroteSomething == false) {  m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();  }
377                 outputTypes["list"].push_back(outputFileName); 
378                                 
379                 return 0;
380
381         }
382         catch(exception& e) {
383                 m->errorOut(e, "RemoveSeqsCommand", "readList");
384                 exit(1);
385         }
386 }
387 //**********************************************************************************************************************
388 int RemoveSeqsCommand::readName(){
389         try {
390                 string thisOutputDir = outputDir;
391                 if (outputDir == "") {  thisOutputDir += m->hasPath(namefile);  }
392                 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(namefile)) + "pick" + m->getExtension(namefile);
393
394                 ofstream out;
395                 m->openOutputFile(outputFileName, out);
396
397                 ifstream in;
398                 m->openInputFile(namefile, in);
399                 string name, firstCol, secondCol;
400                 
401                 bool wroteSomething = false;
402                 
403                 while(!in.eof()){
404                         if (m->control_pressed) { in.close();  out.close();  remove(outputFileName.c_str());  return 0; }
405
406                         in >> firstCol;                         
407                         in >> secondCol;                        
408
409                         vector<string> parsedNames;
410                         //parse second column saving each name
411                         while (secondCol.find_first_of(',') != -1) { 
412                                 name = secondCol.substr(0,secondCol.find_first_of(','));
413                                 secondCol = secondCol.substr(secondCol.find_first_of(',')+1, secondCol.length());
414                                 parsedNames.push_back(name);
415                         }
416                         
417                         //get name after last ,
418                         parsedNames.push_back(secondCol);
419
420                         vector<string> validSecond;  validSecond.clear();
421                         for (int i = 0; i < parsedNames.size(); i++) {
422                                 if (names.count(parsedNames[i]) == 0) {
423                                         validSecond.push_back(parsedNames[i]);
424                                 }
425                         }
426                         
427                         if ((dups) && (validSecond.size() != parsedNames.size())) {  //if dups is true and we want to get rid of anyone, get rid of everyone
428                                 for (int i = 0; i < parsedNames.size(); i++) {  names.insert(parsedNames[i]);  }
429                         }else {
430                                         //if the name in the first column is in the set then print it and any other names in second column also in set
431                                 if (names.count(firstCol) == 0) {
432                                         
433                                         wroteSomething = true;
434                                         
435                                         out << firstCol << '\t';
436                                         
437                                         //you know you have at least one valid second since first column is valid
438                                         for (int i = 0; i < validSecond.size()-1; i++) {  out << validSecond[i] << ',';  }
439                                         out << validSecond[validSecond.size()-1] << endl;
440                                         
441                                         //make first name in set you come to first column and then add the remaining names to second column
442                                 }else {
443                                         
444                                         //you want part of this row
445                                         if (validSecond.size() != 0) {
446                                                 
447                                                 wroteSomething = true;
448                                                 
449                                                 out << validSecond[0] << '\t';
450                                                 
451                                                 //you know you have at least one valid second since first column is valid
452                                                 for (int i = 0; i < validSecond.size()-1; i++) {  out << validSecond[i] << ',';  }
453                                                 out << validSecond[validSecond.size()-1] << endl;
454                                         }
455                                 }
456                         }
457                         m->gobble(in);
458                 }
459                 in.close();
460                 out.close();
461
462                 if (wroteSomething == false) {  m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();  }
463                 outputTypes["name"].push_back(outputFileName);
464                                 
465                 return 0;
466         }
467         catch(exception& e) {
468                 m->errorOut(e, "RemoveSeqsCommand", "readName");
469                 exit(1);
470         }
471 }
472
473 //**********************************************************************************************************************
474 int RemoveSeqsCommand::readGroup(){
475         try {
476                 string thisOutputDir = outputDir;
477                 if (outputDir == "") {  thisOutputDir += m->hasPath(groupfile);  }
478                 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(groupfile)) + "pick" + m->getExtension(groupfile);
479                 
480                 ofstream out;
481                 m->openOutputFile(outputFileName, out);
482
483                 ifstream in;
484                 m->openInputFile(groupfile, in);
485                 string name, group;
486                 
487                 bool wroteSomething = false;
488                 
489                 while(!in.eof()){
490                         if (m->control_pressed) { in.close();  out.close();  remove(outputFileName.c_str());  return 0; }
491                         
492                         in >> name;                             //read from first column
493                         in >> group;                    //read from second column
494                         
495                         //if this name is in the accnos file
496                         if (names.count(name) == 0) {
497                                 wroteSomething = true;
498                                 out << name << '\t' << group << endl;
499                         }
500                                         
501                         m->gobble(in);
502                 }
503                 in.close();
504                 out.close();
505                 
506                 if (wroteSomething == false) {  m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();  }
507                 outputTypes["group"].push_back(outputFileName); 
508                 
509                 return 0;
510         }
511         catch(exception& e) {
512                 m->errorOut(e, "RemoveSeqsCommand", "readGroup");
513                 exit(1);
514         }
515 }
516 //**********************************************************************************************************************
517 int RemoveSeqsCommand::readTax(){
518         try {
519                 string thisOutputDir = outputDir;
520                 if (outputDir == "") {  thisOutputDir += m->hasPath(taxfile);  }
521                 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(taxfile)) + "pick" + m->getExtension(taxfile);
522                 ofstream out;
523                 m->openOutputFile(outputFileName, out);
524
525                 ifstream in;
526                 m->openInputFile(taxfile, in);
527                 string name, tax;
528                 
529                 bool wroteSomething = false;
530                 
531                 while(!in.eof()){
532                         if (m->control_pressed) { in.close();  out.close();  remove(outputFileName.c_str());  return 0; }
533                         
534                         in >> name;                             //read from first column
535                         in >> tax;                      //read from second column
536                         
537                         //if this name is in the accnos file
538                         if (names.count(name) == 0) {
539                                 wroteSomething = true;
540                                 out << name << '\t' << tax << endl;
541                         }
542                                         
543                         m->gobble(in);
544                 }
545                 in.close();
546                 out.close();
547                 
548                 if (wroteSomething == false) {  m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();  }
549                 outputTypes["taxonomy"].push_back(outputFileName);
550                 
551                 return 0;
552         }
553         catch(exception& e) {
554                 m->errorOut(e, "RemoveSeqsCommand", "readTax");
555                 exit(1);
556         }
557 }
558 //**********************************************************************************************************************
559 //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
560 int RemoveSeqsCommand::readAlign(){
561         try {
562                 string thisOutputDir = outputDir;
563                 if (outputDir == "") {  thisOutputDir += m->hasPath(alignfile);  }
564                 string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(alignfile)) + "pick.align.report";
565                 
566                 ofstream out;
567                 m->openOutputFile(outputFileName, out);
568
569                 ifstream in;
570                 m->openInputFile(alignfile, in);
571                 string name, junk;
572                 
573                 bool wroteSomething = false;
574                 
575                 //read column headers
576                 for (int i = 0; i < 16; i++) {  
577                         if (!in.eof())  {       in >> junk;      out << junk << '\t';   }
578                         else                    {       break;                  }
579                 }
580                 out << endl;
581                 
582                 while(!in.eof()){
583                         if (m->control_pressed) { in.close();  out.close();  remove(outputFileName.c_str());  return 0; }
584                         
585                         in >> name;                             //read from first column
586                         
587                         //if this name is in the accnos file
588                         if (names.count(name) == 0) {
589                                 wroteSomething = true;
590                                 
591                                 out << name << '\t';
592                                 
593                                 //read rest
594                                 for (int i = 0; i < 15; i++) {  
595                                         if (!in.eof())  {       in >> junk;      out << junk << '\t';   }
596                                         else                    {       break;                  }
597                                 }
598                                 out << endl;
599                                 
600                         }else {//still read just don't do anything with it
601                                 
602                                 //read rest
603                                 for (int i = 0; i < 15; i++) {  
604                                         if (!in.eof())  {       in >> junk;             }
605                                         else                    {       break;                  }
606                                 }
607                         }
608                         
609                         m->gobble(in);
610                 }
611                 in.close();
612                 out.close();
613                 
614                 if (wroteSomething == false) {  m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();  }
615                 outputTypes["alignreport"].push_back(outputFileName);
616                 
617                 return 0;
618                 
619         }
620         catch(exception& e) {
621                 m->errorOut(e, "RemoveSeqsCommand", "readAlign");
622                 exit(1);
623         }
624 }
625 //**********************************************************************************************************************
626 void RemoveSeqsCommand::readAccnos(){
627         try {
628                 
629                 ifstream in;
630                 m->openInputFile(accnosfile, in);
631                 string name;
632                 
633                 while(!in.eof()){
634                         in >> name;
635                                                 
636                         names.insert(name);
637                         
638                         m->gobble(in);
639                 }
640                 in.close();             
641
642         }
643         catch(exception& e) {
644                 m->errorOut(e, "RemoveSeqsCommand", "readAccnos");
645                 exit(1);
646         }
647 }
648
649 //**********************************************************************************************************************
650
651