X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=seqerrorcommand.cpp;h=0dc15f59ee98d0ee2d93659c4c3ad1f033f8a193;hb=2c97dd48b8e27ee0a6a86c7a082f4c504c3357c6;hp=253e03e2a1d380cb4d13f360fc9a5fecaaeb0808;hpb=8977d23b7f18d981b14e59c210c97198541ca7b0;p=mothur.git diff --git a/seqerrorcommand.cpp b/seqerrorcommand.cpp index 253e03e..0dc15f5 100644 --- a/seqerrorcommand.cpp +++ b/seqerrorcommand.cpp @@ -176,7 +176,7 @@ SeqErrorCommand::SeqErrorCommand(string option) { 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); @@ -213,7 +213,7 @@ SeqErrorCommand::SeqErrorCommand(string option) { //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); @@ -242,10 +242,15 @@ SeqErrorCommand::SeqErrorCommand(string option) { 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 files; files.push_back(queryFileName); + parser.getNameFile(files); + } } } catch(exception& e) { @@ -293,7 +298,7 @@ int SeqErrorCommand::execute(){ 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{ @@ -361,7 +366,7 @@ int SeqErrorCommand::createProcesses(string filename, string qFileName, string r processIDS.clear(); map >::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) { @@ -677,7 +682,8 @@ int SeqErrorCommand::driver(string filename, string qFileName, string rFileName, 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()); @@ -734,7 +740,7 @@ int SeqErrorCommand::driver(string filename, string qFileName, string rFileName, index++; - #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) + #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) unsigned long long pos = queryFile.tellg(); if ((pos == -1) || (pos >= line.end)) { break; } #else @@ -834,7 +840,7 @@ void SeqErrorCommand::getReferences(){ //*************************************************************************************************************** -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"); @@ -845,7 +851,7 @@ Compare SeqErrorCommand::getErrors(Sequence query, Sequence reference){ string r = reference.getAligned(); int started = 0; - Compare errors; + //Compare errors; for(int i=0;ierrorOut(e, "SeqErrorCommand", "getErrors"); @@ -1210,7 +1217,7 @@ void SeqErrorCommand::printQualityFR(vector > qualForwardMap, vector int SeqErrorCommand::setLines(string filename, string qfilename, string rfilename, vector& fastaFilePos, vector& qfileFilePos, vector& 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);