helpString += "The list.seqs command parameters are fasta, name, group, list, taxonomy and alignreport. You must provide one of these parameters.\n";
helpString += "The list.seqs command should be in the following format: list.seqs(fasta=yourFasta).\n";
helpString += "Example list.seqs(fasta=amazon.fasta).\n";
- helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n";
+ helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n";
return helpString;
}
catch(exception& e) {
m->openInputFile(fastafile, in);
string name;
+ ofstream out;
+ string newFastaName = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "numsAdded.fasta";
+ m->openOutputFile(newFastaName, out);
+ int count = 1;
+ string lastName = "";
+
while(!in.eof()){
if (m->control_pressed) { in.close(); return 0; }
Sequence currSeq(in);
name = currSeq.getName();
+ if (lastName == "") { lastName = name; }
+ if (name != lastName) { count = 1; }
+ lastName = name;
+
+ Sequence newSeq(name+"_"+toString(count), currSeq.getAligned());
+ newSeq.printSequence(out);
if (name != "") { names.push_back(name); }
m->gobble(in);
+ count++;
}
in.close();
+ out.close();
return 0;