X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=aligncommand.cpp;h=8215de301b646f4d4571944de85dddb40478e7e5;hb=36a6b02cf7f09d2bc34376b588944a9ca73429c5;hp=960d70229a084923fd1cc8dc368ff4b71d815cbd;hpb=ae57e166b2ed7b475ec3f466106bd76fabadd063;p=mothur.git diff --git a/aligncommand.cpp b/aligncommand.cpp index 960d702..8215de3 100644 --- a/aligncommand.cpp +++ b/aligncommand.cpp @@ -224,34 +224,29 @@ AlignCommand::AlignCommand(string option) { // ...at some point should added some additional type checking... string temp; temp = validParameter.validFile(parameters, "ksize", false); if (temp == "not found"){ temp = "8"; } - convert(temp, kmerSize); + m->mothurConvert(temp, kmerSize); temp = validParameter.validFile(parameters, "match", false); if (temp == "not found"){ temp = "1.0"; } - convert(temp, match); + m->mothurConvert(temp, match); temp = validParameter.validFile(parameters, "mismatch", false); if (temp == "not found"){ temp = "-1.0"; } - convert(temp, misMatch); + m->mothurConvert(temp, misMatch); temp = validParameter.validFile(parameters, "gapopen", false); if (temp == "not found"){ temp = "-2.0"; } - convert(temp, gapOpen); + m->mothurConvert(temp, gapOpen); temp = validParameter.validFile(parameters, "gapextend", false); if (temp == "not found"){ temp = "-1.0"; } - convert(temp, gapExtend); + m->mothurConvert(temp, gapExtend); temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); temp = validParameter.validFile(parameters, "flip", false); if (temp == "not found"){ temp = "f"; } flip = m->isTrue(temp); temp = validParameter.validFile(parameters, "save", false); if (temp == "not found"){ temp = "f"; } save = m->isTrue(temp); - //this is so the threads can quickly load the reference data - #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) - #else - if (processors != 1) { save = true; } - #endif rdb->save = save; if (save) { //clear out old references rdb->clearMemory(); @@ -272,7 +267,7 @@ AlignCommand::AlignCommand(string option) { else { if (save) { rdb->setSavedReference(templateFileName); } } temp = validParameter.validFile(parameters, "threshold", false); if (temp == "not found"){ temp = "0.50"; } - convert(temp, threshold); + m->mothurConvert(temp, threshold); search = validParameter.validFile(parameters, "search", false); if (search == "not found"){ search = "kmer"; } if ((search != "suffix") && (search != "kmer") && (search != "blast")) { m->mothurOut("invalid search option: choices are kmer, suffix or blast."); m->mothurOutEndLine(); abort=true; } @@ -427,7 +422,7 @@ int AlignCommand::execute(){ #else vector positions; - #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) + #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) positions = m->divideFile(candidateFileNames[s], processors); for (int i = 0; i < (positions.size()-1); i++) { lines.push_back(new linePair(positions[i], positions[(i+1)])); } #else @@ -435,7 +430,8 @@ int AlignCommand::execute(){ lines.push_back(new linePair(0, 1000)); }else { positions = m->setFilePosFasta(candidateFileNames[s], numFastaSeqs); - + if (positions.size() < processors) { processors = positions.size(); } + //figure out how many sequences you have to process int numSeqsPerProcessor = numFastaSeqs / processors; for (int i = 0; i < processors; i++) { @@ -622,7 +618,7 @@ int AlignCommand::driver(linePair* filePos, string alignFName, string reportFNam } delete candidateSeq; - #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) + #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) unsigned long long pos = inFASTA.tellg(); if ((pos == -1) || (pos >= filePos->end)) { break; } #else @@ -831,7 +827,7 @@ int AlignCommand::createProcesses(string alignFileName, string reportFileName, s try { int num = 0; processIDS.resize(0); -#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) +#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) int process = 1; //loop through and create all the processes you want @@ -923,7 +919,7 @@ int AlignCommand::createProcesses(string alignFileName, string reportFileName, s string extension = ""; if (i != 0) { extension = toString(i) + ".temp"; } - alignData* tempalign = new alignData((alignFileName + extension), (reportFileName + extension), (accnosFName + extension), filename, align, search, kmerSize, m, lines[i]->start, lines[i]->end, flip, match, misMatch, gapOpen, gapExtend, threshold, i); + alignData* tempalign = new alignData(templateFileName, (alignFileName + extension), (reportFileName + extension), (accnosFName + extension), filename, align, search, kmerSize, m, lines[i]->start, lines[i]->end, flip, match, misMatch, gapOpen, gapExtend, threshold, i); pDataArray.push_back(tempalign); processIDS.push_back(i);