X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=screenseqscommand.cpp;h=a56b0ebb73d1f6188ecd09430e70ed0128abaf31;hb=6b32d112bb60e9f7eb6d4407a4eed4c49b67bced;hp=1d7cb8d73c161b147c6c2d1162a996728d8d2c23;hpb=f204e1111a6d4da30db9bccfa65f75546f59ba11;p=mothur.git diff --git a/screenseqscommand.cpp b/screenseqscommand.cpp index 1d7cb8d..a56b0eb 100644 --- a/screenseqscommand.cpp +++ b/screenseqscommand.cpp @@ -14,7 +14,7 @@ vector ScreenSeqsCommand::setParameters(){ try { CommandParameter pfasta("fasta", "InputTypes", "", "", "none", "none", "none","fasta",false,true,true); parameters.push_back(pfasta); - CommandParameter pcontigsreport("contigsreport", "InputTypes", "", "", "report", "none", "none","contigsreport",false,true,true); parameters.push_back(pcontigsreport); + CommandParameter pcontigsreport("contigsreport", "InputTypes", "", "", "report", "none", "none","contigsreport",false,false,true); parameters.push_back(pcontigsreport); CommandParameter palignreport("alignreport", "InputTypes", "", "", "report", "none", "none","alignreport",false,false); parameters.push_back(palignreport); CommandParameter psummary("summary", "InputTypes", "", "", "report", "none", "none","summary",false,false); parameters.push_back(psummary); CommandParameter pname("name", "InputTypes", "", "", "NameCount", "none", "none","name",false,false,true); parameters.push_back(pname); @@ -683,7 +683,7 @@ int ScreenSeqsCommand::screenReports(map& badSeqNames){ if (namefile != "") { nameMap = m->readNames(namefile); } else if (countfile != "") { CountTable ct; - ct.readTable(countfile, true); + ct.readTable(countfile, true, false); nameMap = ct.getNameMap(); } getSummary(positions); @@ -714,7 +714,7 @@ int ScreenSeqsCommand::screenReports(map& badSeqNames){ if (namefile != "") { nameMap = m->readNames(namefile); } else if (countfile != "") { CountTable ct; - ct.readTable(countfile, true); + ct.readTable(countfile, true, false); nameMap = ct.getNameMap(); } getSummaryReport(); @@ -1019,7 +1019,7 @@ int ScreenSeqsCommand::screenFasta(map& badSeqNames){ if (namefile != "") { nameMap = m->readNames(namefile); } else if (countfile != "") { CountTable ct; - ct.readTable(countfile, true); + ct.readTable(countfile, true, false); nameMap = ct.getNameMap(); } getSummary(positions); @@ -1820,7 +1820,6 @@ int ScreenSeqsCommand::getSummary(vector& positions){ vector longHomoPolymer; vector numNs; - vector positions; #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) positions = m->divideFile(fastafile, processors); for (int i = 0; i < (positions.size()-1); i++) { lines.push_back(linePair(positions[i], positions[(i+1)])); } @@ -1845,8 +1844,9 @@ int ScreenSeqsCommand::getSummary(vector& positions){ int pid; MPI_Comm_rank(MPI_COMM_WORLD, &pid); - if (pid == 0) { - driverCreateSummary(startPosition, endPosition, seqLength, ambigBases, longHomoPolymer, numNs, fastafile, lines[0]); + if (pid == 0) { + linePair tempLine(0, positions[positions.size()-1]); + driverCreateSummary(startPosition, endPosition, seqLength, ambigBases, longHomoPolymer, numNs, fastafile, tempLine); #else int numSeqs = 0; //#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) @@ -2177,19 +2177,18 @@ int ScreenSeqsCommand::screenCountFile(map badSeqNames){ if (m->control_pressed) { goodCountOut.close(); in.close(); m->mothurRemove(goodCountFile); return 0; } in >> name; m->gobble(in); - in >> thisTotal; m->gobble(in); + in >> thisTotal; rest = m->getline(in); m->gobble(in); it = badSeqNames.find(name); if(it != badSeqNames.end()){ - badSeqNames.erase(it); + badSeqNames.erase(it); } else{ goodCountOut << name << '\t' << thisTotal << '\t' << rest << endl; } } - if (m->control_pressed) { goodCountOut.close(); in.close(); m->mothurRemove(goodCountFile); return 0; } //we were unable to remove some of the bad sequences @@ -2206,7 +2205,7 @@ int ScreenSeqsCommand::screenCountFile(map badSeqNames){ //check for groups that have been eliminated CountTable ct; if (ct.testGroups(goodCountFile)) { - ct.readTable(goodCountFile, true); + ct.readTable(goodCountFile, true, false); ct.printTable(goodCountFile); }