}
ifstream in;
- int ableToOpen = openInputFile(filenames[i], in);
+ int ableToOpen = openInputFile(filenames[i], in, "noerror");
+
+ //if you can't open it, try default location
+ if (ableToOpen == 1) {
+ if (m->getDefaultPath() != "") { //default path is set
+ string tryPath = m->getDefaultPath() + getSimpleName(filenames[i]);
+ m->mothurOut("Unable to open " + filenames[i] + ". Trying default " + tryPath); m->mothurOutEndLine();
+ ableToOpen = openInputFile(tryPath, in, "noerror");
+ filenames[i] = tryPath;
+ }
+ }
in.close();
if (ableToOpen == 1) {
- m->mothurOut(filenames[i] + " will be disregarded."); m->mothurOutEndLine();
+ m->mothurOut("Unable to open " + filenames[i] + ". It will be disregarded."); m->mothurOutEndLine();
//erase from file list
filenames.erase(filenames.begin()+i);
i--;
}
ifstream in;
- int ableToOpen = openInputFile(accnosFileNames[i], in);
+ int ableToOpen = openInputFile(accnosFileNames[i], in, "noerror");
+
+ //if you can't open it, try default location
+ if (ableToOpen == 1) {
+ if (m->getDefaultPath() != "") { //default path is set
+ string tryPath = m->getDefaultPath() + getSimpleName(accnosFileNames[i]);
+ m->mothurOut("Unable to open " + accnosFileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine();
+ ableToOpen = openInputFile(tryPath, in, "noerror");
+ accnosFileNames[i] = tryPath;
+ }
+ }
in.close();
if (ableToOpen == 1) {
- m->mothurOut(accnosFileNames[i] + " will be disregarded."); m->mothurOutEndLine();
+ m->mothurOut("Unable to open " + accnosFileNames[i] + ". It will be disregarded."); m->mothurOutEndLine();
//erase from file list
accnosFileNames.erase(accnosFileNames.begin()+i);
i--;
void SffInfoCommand::help(){
try {
- m->mothurOut("The sffinfo command reads a sff file and outputs a .sff.txt file.\n");
-
- m->mothurOut("Example sffinfo(sff=...).\n");
+ m->mothurOut("The sffinfo command reads a sff file and extracts the sequence data.\n");
+ m->mothurOut("The sffinfo command parameters are sff, fasta, qfile, accnos, flow, sfftxt, and trim. sff is required. \n");
+ m->mothurOut("The sff parameter allows you to enter the sff file you would like to extract data from. You may enter multiple files by separating them by -'s.\n");
+ m->mothurOut("The fasta parameter allows you to indicate if you would like a fasta formatted file generated. Default=True. \n");
+ m->mothurOut("The qfile parameter allows you to indicate if you would like a quality file generated. Default=True. \n");
+ m->mothurOut("The flow parameter allows you to indicate if you would like a flowgram file generated. Default=False. \n");
+ m->mothurOut("The sfftxt parameter allows you to indicate if you would like a sff.txt file generated. Default=False. \n");
+ m->mothurOut("The trim parameter allows you to indicate if you would like a sequences and quality scores trimmed to the clipQualLeft and clipQualRight values. Default=True. \n");
+ m->mothurOut("The accnos parameter allows you to provide a accnos file containing the names of the sequences you would like extracted. You may enter multiple files by separating them by -'s. \n");
+ m->mothurOut("Example sffinfo(sff=mySffFile.sff, trim=F).\n");
m->mothurOut("Note: No spaces between parameter labels (i.e. sff), '=' and parameters (i.e.yourSffFileName).\n\n");
}
catch(exception& e) {
if (header.keySequence.length() > header.keyLength) { header.keySequence = header.keySequence.substr(0, header.keyLength); }
/* Pad to 8 chars */
- int spotInFile = in.tellg();
- int spot = (spotInFile + 7)& ~7; // ~ inverts
+ unsigned long int spotInFile = in.tellg();
+ unsigned long int spot = (spotInFile + 7)& ~7; // ~ inverts
in.seekg(spot);
}else{
if (header.name.length() > header.nameLength) { header.name = header.name.substr(0, header.nameLength); }
/* Pad to 8 chars */
- int spotInFile = in.tellg();
- int spot = (spotInFile + 7)& ~7;
+ unsigned long int spotInFile = in.tellg();
+ unsigned long int spot = (spotInFile + 7)& ~7;
in.seekg(spot);
}else{
}
/* Pad to 8 chars */
- int spotInFile = in.tellg();
- int spot = (spotInFile + 7)& ~7;
+ unsigned long int spotInFile = in.tellg();
+ unsigned long int spot = (spotInFile + 7)& ~7;
in.seekg(spot);
}else{