//allow user to run help
if(option == "help") { help(); abort = true; calledHelp = true; }
+ else if(option == "citation") { citation(); abort = true; calledHelp = true;}
else {
vector<string> myArray = setParameters();
int currentSeqsDiffs = 0;
Sequence currSeq(inFASTA); m->gobble(inFASTA);
-
+
QualityScores currQual;
if(qFileName != ""){
currQual = QualityScores(qFile); m->gobble(qFile);
else if(qRollAverage != 0) { success = currQual.stripQualRollingAverage(currSeq, qRollAverage); }
else if(qWindowAverage != 0){ success = currQual.stripQualWindowAverage(currSeq, qWindowStep, qWindowSize, qWindowAverage); }
else { success = 1; }
-
+
//you don't want to trim, if it fails above then scrap it
if ((!qtrim) && (origLength != currSeq.getNumBases())) { success = 0; }
if(barcodes.size() != 0){
string thisGroup = barcodeNameVector[barcodeIndex];
- if (primers.size() != 0) { thisGroup += "." + primerNameVector[primerIndex]; }
+ if (primers.size() != 0) { if (primerNameVector[primerIndex] != "") { thisGroup += "." + primerNameVector[primerIndex]; } }
outGroupsFile << currSeq.getName() << '\t' << thisGroup << endl;
int TrimSeqsCommand::setLines(string filename, string qfilename, vector<unsigned long int>& fastaFilePos, vector<unsigned long int>& qfileFilePos) {
try {
-
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
//set file positions for fasta file
fastaFilePos = m->divideFile(filename, processors);
qfileFilePos.push_back(size);
return processors;
+
+ #else
+
+ fastaFilePos.push_back(0); qfileFilePos.push_back(0);
+ //get last file position of fastafile
+ FILE * pFile;
+ unsigned long int size;
+
+ //get num bytes in file
+ pFile = fopen (filename.c_str(),"rb");
+ if (pFile==NULL) perror ("Error opening file");
+ else{
+ fseek (pFile, 0, SEEK_END);
+ size=ftell (pFile);
+ fclose (pFile);
+ }
+ fastaFilePos.push_back(size);
+
+ //get last file position of fastafile
+ FILE * qFile;
+
+ //get num bytes in file
+ qFile = fopen (qfilename.c_str(),"rb");
+ if (qFile==NULL) perror ("Error opening file");
+ else{
+ fseek (qFile, 0, SEEK_END);
+ size=ftell (qFile);
+ fclose (qFile);
+ }
+ qfileFilePos.push_back(size);
+
+ return 1;
+
+ #endif
}
catch(exception& e) {
m->errorOut(e, "TrimSeqsCommand", "setLines");
while(!inOligos.eof()){
- inOligos >> type; m->gobble(inOligos);
+ inOligos >> type;
if(type[0] == '#'){
- while (!inOligos.eof()) { char c = inOligos.get(); if (c == 10 || c == 13){ break; } } // get rest of line if there's any crap there
+ while (!inOligos.eof()) { char c = inOligos.get(); if (c == 10 || c == 13){ break; } } // get rest of line if there's any crap there
+ m->gobble(inOligos);
}
else{
+ m->gobble(inOligos);
//make type case insensitive
for(int i=0;i<type.length();i++){ type[i] = toupper(type[i]); }