if (queryFileName != "") { m->mothurOut("Using " + queryFileName + " as input file for the fasta parameter."); m->mothurOutEndLine(); }
else { m->mothurOut("You have no current fasta file and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; }
}
- else if (queryFileName == "not open") { abort = true; }
+ else if (queryFileName == "not open") { queryFileName = ""; 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 = ""; }
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
temp = validParameter.validFile(parameters, "threshold", false); if (temp == "not found") { temp = "1.00"; }
- convert(temp, threshold);
+ m->mothurConvert(temp, threshold);
temp = validParameter.validFile(parameters, "save", false); if (temp == "not found"){ temp = "f"; }
save = m->isTrue(temp);
temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); }
m->setProcessors(temp);
- convert(temp, processors);
+ m->mothurConvert(temp, processors);
substitutionMatrix.resize(6);
for(int i=0;i<6;i++){ substitutionMatrix[i].resize(6,0); }
+
+ if ((namesFileName == "") && (queryFileName != "")){
+ vector<string> files; files.push_back(queryFileName);
+ parser.getNameFile(files);
+ }
}
}
catch(exception& e) {
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);
if(qualFileName == "") { qLines = lines; rLines = lines; } //fills with duds
int numSeqs = 0;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors == 1){
numSeqs = driver(queryFileName, qualFileName, reportFileName, errorSummaryFileName, errorSeqFileName, errorChimeraFileName, lines[0], qLines[0], rLines[0]);
}else{
processIDS.clear();
map<char, vector<int> >::iterator it;
int num = 0;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
if(numParentSeqs > 1 && ignoreChimeras == 1) { ignoreSeq = 1; }
else { ignoreSeq = 0; }
- Compare minCompare = getErrors(query, referenceSeqs[closestRefIndex]);
+ Compare minCompare;
+ getErrors(query, referenceSeqs[closestRefIndex], minCompare);
if(namesFileName != ""){
it = weights.find(query.getName());
index++;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
- unsigned long int pos = queryFile.tellg();
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
+ unsigned long long pos = queryFile.tellg();
if ((pos == -1) || (pos >= line.end)) { break; }
#else
if (queryFile.eof()) { break; }
//***************************************************************************************************************
-Compare SeqErrorCommand::getErrors(Sequence query, Sequence reference){
+int SeqErrorCommand::getErrors(Sequence query, Sequence reference, Compare& errors){
try {
if(query.getAlignLength() != reference.getAlignLength()){
m->mothurOut("Warning: " + toString(query.getName()) + " and " + toString(reference.getName()) + " are different lengths\n");
string r = reference.getAligned();
int started = 0;
- Compare errors;
+ //Compare errors;
for(int i=0;i<alignLength;i++){
// cout << r[i] << '\t' << q[i] << '\t';
errors.queryName = query.getName();
errors.refName = reference.getName();
- return errors;
+ //return errors;
+ return 0;
}
catch(exception& e) {
m->errorOut(e, "SeqErrorCommand", "getErrors");
}
/**************************************************************************************************/
-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)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//set file positions for fasta file
fastaFilePos = m->divideFile(filename, processors);
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");