}
else if (queryFileName == "not open") { abort = true; }
else { m->setFastaFile(queryFileName); }
-
+
+ referenceFileName = validParameter.validFile(parameters, "reference", true);
+ if (referenceFileName == "not found") { m->mothurOut("reference is a required parameter for the seq.error command."); m->mothurOutEndLine(); abort = true; }
+ else if (referenceFileName == "not open") { abort = true; }
+
//check for optional parameters
namesFileName = validParameter.validFile(parameters, "name", true);
if(namesFileName == "not found"){ namesFileName = ""; }
if(namesFileName != ""){ weights = getWeights(); }
- vector<unsigned long int> fastaFilePos;
- vector<unsigned long int> qFilePos;
- vector<unsigned long int> reportFilePos;
+ vector<unsigned long long> fastaFilePos;
+ vector<unsigned long long> qFilePos;
+ vector<unsigned long long> reportFilePos;
setLines(queryFileName, qualFileName, reportFileName, fastaFilePos, qFilePos, reportFilePos);
printErrorFRFile(errorForward, errorReverse);
- 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; }
string errorCountFileName = queryFileName.substr(0,queryFileName.find_last_of('.')) + ".error.count";
ofstream errorCountFile;
}
errorCountFile.close();
- 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; }
printSubMatrix();
m->mothurOut("Appending files from process " + toString(processIDS[i])); m->mothurOutEndLine();
m->appendFiles((summaryFileName + toString(processIDS[i]) + ".temp"), summaryFileName);
- remove((summaryFileName + toString(processIDS[i]) + ".temp").c_str());
+ m->mothurRemove((summaryFileName + toString(processIDS[i]) + ".temp"));
m->appendFiles((errorOutputFileName + toString(processIDS[i]) + ".temp"), errorOutputFileName);
- remove((errorOutputFileName + toString(processIDS[i]) + ".temp").c_str());
+ m->mothurRemove((errorOutputFileName + toString(processIDS[i]) + ".temp"));
m->appendFiles((chimeraOutputFileName + toString(processIDS[i]) + ".temp"), chimeraOutputFileName);
- remove((chimeraOutputFileName + toString(processIDS[i]) + ".temp").c_str());
+ m->mothurRemove((chimeraOutputFileName + toString(processIDS[i]) + ".temp"));
ifstream in;
string tempFile = filename + toString(processIDS[i]) + ".info.temp";
}
m->gobble(in);
- in.close(); remove(tempFile.c_str());
+ in.close(); m->mothurRemove(tempFile);
}
#endif
index++;
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
- unsigned long int pos = queryFile.tellg();
+ unsigned long long pos = queryFile.tellg();
if ((pos == -1) || (pos >= line.end)) { break; }
#else
if (queryFile.eof()) { break; }
}
/**************************************************************************************************/
-int SeqErrorCommand::setLines(string filename, string qfilename, string rfilename, vector<unsigned long int>& fastaFilePos, vector<unsigned long int>& qfileFilePos, vector<unsigned long int>& rfileFilePos) {
+int SeqErrorCommand::setLines(string filename, string qfilename, string rfilename, vector<unsigned long long>& fastaFilePos, vector<unsigned long long>& qfileFilePos, vector<unsigned long long>& rfileFilePos) {
try {
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
//set file positions for fasta file
map<string, int>::iterator it = firstSeqNames.find(sname);
if(it != firstSeqNames.end()) { //this is the start of a new chunk
- unsigned long int pos = inQual.tellg();
+ unsigned long long pos = inQual.tellg();
qfileFilePos.push_back(pos - input.length() - 1);
firstSeqNames.erase(it);
}
//get last file position of qfile
FILE * pFile;
- unsigned long int size;
+ unsigned long long size;
//get num bytes in file
pFile = fopen (qfilename.c_str(),"rb");
map<string, int>::iterator it = firstSeqNamesReport.find(sname);
if(it != firstSeqNamesReport.end()) { //this is the start of a new chunk
- unsigned long int pos = inR.tellg();
+ unsigned long long pos = inR.tellg();
rfileFilePos.push_back(pos - input.length() - 1);
firstSeqNamesReport.erase(it);
}
//get last file position of qfile
FILE * rFile;
- unsigned long int sizeR;
+ unsigned long long sizeR;
//get num bytes in file
rFile = fopen (rfilename.c_str(),"rb");
fastaFilePos.push_back(0); qfileFilePos.push_back(0);
//get last file position of fastafile
FILE * pFile;
- unsigned long int size;
+ unsigned long long size;
//get num bytes in file
pFile = fopen (filename.c_str(),"rb");