X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=chimeraslayercommand.cpp;h=e7dc92e5919d1f5f7078fd5a11171cbb39030861;hp=d8e0952a8b9f89cd237946a27ea624f11fa42898;hb=b206f634aae1b4ce13978d203247fb64757d5482;hpb=859e3a473a3e63e0060c49be70b80f9289253da2 diff --git a/chimeraslayercommand.cpp b/chimeraslayercommand.cpp index d8e0952..e7dc92e 100644 --- a/chimeraslayercommand.cpp +++ b/chimeraslayercommand.cpp @@ -603,10 +603,7 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option) { m->mothurConvert(temp, numwanted); temp = validParameter.validFile(parameters, "dereplicate", false); - if (temp == "not found") { - if (groupfile != "") { temp = "false"; } - else { temp = "true"; } - } + if (temp == "not found") { temp = "false"; } dups = m->isTrue(temp); blastlocation = validParameter.validFile(parameters, "blastlocation", false); @@ -762,7 +759,7 @@ int ChimeraSlayerCommand::execute(){ if (processors == 1) { numSeqs = driverGroups(outputFileName, accnosFileName, trimFastaFileName, fileToPriority, fileGroup, newCountFile); if (hasCount && dups) { - CountTable c; c.readTable(nameFileNames[s]); + CountTable c; c.readTable(nameFileNames[s], true, false); if (!m->isBlank(newCountFile)) { ifstream in2; m->openInputFile(newCountFile, in2); @@ -794,7 +791,7 @@ int ChimeraSlayerCommand::execute(){ }else { if (hasCount) { set doNotRemove; - CountTable c; c.readTable(newCountFile); + CountTable c; c.readTable(newCountFile, true, true); vector namesInTable = c.getNamesOfSeqs(); for (int i = 0; i < namesInTable.size(); i++) { int temp = c.getNumSeqs(namesInTable[i]); @@ -837,6 +834,11 @@ int ChimeraSlayerCommand::execute(){ } } + itTypes = outputTypes.find("count"); + if (itTypes != outputTypes.end()) { + if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setCountTableFile(current); } + } + m->mothurOutEndLine(); m->mothurOut("Output File Names: "); m->mothurOutEndLine(); for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); } @@ -866,8 +868,8 @@ int ChimeraSlayerCommand::MPIExecuteGroups(string outputFileName, string accnosF map >::iterator itFile; vector filenames; for(itFile = fileToPriority.begin(); itFile != fileToPriority.end(); itFile++) { filenames.push_back(itFile->first); } - - int numGroupsPerProcessor = filenames.size() / processors; + + int numGroupsPerProcessor = ceil(filenames.size() / (double) processors); int startIndex = pid * numGroupsPerProcessor; int endIndex = (pid+1) * numGroupsPerProcessor; if(pid == (processors - 1)){ endIndex = filenames.size(); } @@ -1549,7 +1551,7 @@ int ChimeraSlayerCommand::createProcessesGroups(string outputFName, string accno if (fileToPriority.size() < processors) { processors = fileToPriority.size(); } CountTable newCount; - if (hasCount && dups) { newCount.readTable(countFile); } + if (hasCount && dups) { newCount.readTable(countFile, true, false); } int groupsPerProcessor = fileToPriority.size() / processors; int remainder = fileToPriority.size() % processors; @@ -1626,7 +1628,7 @@ int ChimeraSlayerCommand::createProcessesGroups(string outputFName, string accno //Create processor worker threads. for(int i=1; imothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine(); } + if((count) % 100 == 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count) + "\n"); } } //report progress - if((count) % 100 != 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine(); } + if((count) % 100 != 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count)+ "\n"); } int numNoParents = chimera->getNumNoParents(); if (numNoParents == count) { m->mothurOut("[WARNING]: megablast returned 0 potential parents for all your sequences. This could be due to formatdb.exe not being setup properly, please check formatdb.log for errors."); m->mothurOutEndLine(); } @@ -1971,10 +1973,10 @@ int ChimeraSlayerCommand::driverMPI(int start, int num, MPI_File& inMPI, MPI_Fil delete candidateSeq; //report progress - if((i+1) % 100 == 0){ cout << "Processing sequence: " << (i+1) << endl; m->mothurOutJustToLog("Processing sequence: " + toString(i+1) + "\n"); } + if((i+1) % 100 == 0){ cout << "Processing sequence: " << (i+1) << endl; } } //report progress - if(num % 100 != 0){ cout << "Processing sequence: " << num << endl; m->mothurOutJustToLog("Processing sequence: " + toString(num) + "\n"); } + if(num % 100 != 0){ cout << "Processing sequence: " << num << endl; } int numNoParents = chimera->getNumNoParents(); if (numNoParents == num) { cout << "[WARNING]: megablast returned 0 potential parents for all your sequences. This could be due to formatdb.exe not being setup properly, please check formatdb.log for errors." << endl; } @@ -2159,7 +2161,7 @@ map ChimeraSlayerCommand::sortFastaFile(string fastaFile, string na int error; if (hasCount) { CountTable ct; - ct.readTable(nameFile); + ct.readTable(nameFile, true, false); for(map::iterator it = seqs.begin(); it != seqs.end(); it++) { int num = ct.getNumSeqs(it->first);