//allow user to run help
if(option == "help") { help(); abort = true; calledHelp = true; }
+ else if(option == "citation") { citation(); abort = true; calledHelp = true;}
else {
//valid paramters for this command
//erase from file list
filenames.erase(filenames.begin()+i);
i--;
- }
+ }else { m->setSFFFile(filenames[i]); }
}
}
}
if ((sfftxtFilename == "") && (filenames.size() == 0)) {
- //if there is a current fasta file, use it
+ //if there is a current sff file, use it
string filename = m->getSFFFile();
if (filename != "") { filenames.push_back(filename); m->mothurOut("Using " + filename + " as input file for the sff parameter."); m->mothurOutEndLine(); }
else { m->mothurOut("[ERROR]: you must provide a valid sff or sfftxt file."); m->mothurOutEndLine(); abort=true; }
for (int s = 0; s < filenames.size(); s++) {
- if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
+ if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } return 0; }
int start = time(NULL);
if (sfftxtFilename != "") { parseSffTxt(); }
- if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
+ if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } return 0; }
//set fasta file as new current fastafile
string current = "";
//read offset
char buffer2 [8];
in.read(buffer2, 8);
- header.indexOffset = be_int8(*(unsigned long int *)(&buffer2));
+ header.indexOffset = be_int8(*(unsigned long long *)(&buffer2));
//read index length
char buffer3 [4];
delete[] tempBuffer2;
/* Pad to 8 chars */
- unsigned long int spotInFile = in.tellg();
- unsigned long int spot = (spotInFile + 7)& ~7; // ~ inverts
+ unsigned long long spotInFile = in.tellg();
+ unsigned long long spot = (spotInFile + 7)& ~7; // ~ inverts
in.seekg(spot);
}else{
decodeName(header.timestamp, header.region, header.xy, header.name);
/* Pad to 8 chars */
- unsigned long int spotInFile = in.tellg();
- unsigned long int spot = (spotInFile + 7)& ~7;
+ unsigned long long spotInFile = in.tellg();
+ unsigned long long spot = (spotInFile + 7)& ~7;
in.seekg(spot);
}else{
}
/* Pad to 8 chars */
- unsigned long int spotInFile = in.tellg();
- unsigned long int spot = (spotInFile + 7)& ~7;
+ unsigned long long spotInFile = in.tellg();
+ unsigned long long spot = (spotInFile + 7)& ~7;
in.seekg(spot);
}else{
//output file names
ofstream outFasta, outQual, outFlow;
string outFastaFileName, outQualFileName;
- string outFlowFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "flow";
+ string fileRoot = m->getRootName(m->getSimpleName(sfftxtFilename));
+ if (fileRoot.length() > 0) {
+ //rip off last .
+ fileRoot = fileRoot.substr(0, fileRoot.length()-1);
+ fileRoot = m->getRootName(fileRoot);
+ }
+
+ string outFlowFileName = outputDir + fileRoot + "flow";
if (trim) {
- outFastaFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "fasta";
- outQualFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "qual";
+ outFastaFileName = outputDir + fileRoot + "fasta";
+ outQualFileName = outputDir + fileRoot + "qual";
}else{
- outFastaFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "raw.fasta";
- outQualFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "raw.qual";
+ outFastaFileName = outputDir + fileRoot + "raw.fasta";
+ outQualFileName = outputDir + fileRoot + "raw.qual";
}
if (fasta) { m->openOutputFile(outFastaFileName, outFasta); outputNames.push_back(outFastaFileName); outputTypes["fasta"].push_back(outFastaFileName); }