From 116bbb1533575666a682910a10ae1fa2fc5b605c Mon Sep 17 00:00:00 2001 From: westcott Date: Mon, 9 Jan 2012 13:39:57 +0000 Subject: [PATCH] 1.23.0 --- Mothur.xcodeproj/project.pbxproj | 3 +-- aligncommand.h | 2 +- chimerauchimecommand.h | 23 +++++----------- makegroupcommand.cpp | 1 + preclustercommand.cpp | 6 ++--- sharedordervector.cpp | 45 ++++++++++++++++++++++++++++---- sharedrabundvector.cpp | 1 + shhhercommand.cpp | 21 ++++++++++----- 8 files changed, 68 insertions(+), 34 deletions(-) diff --git a/Mothur.xcodeproj/project.pbxproj b/Mothur.xcodeproj/project.pbxproj index 3a37569..c7c7cee 100644 --- a/Mothur.xcodeproj/project.pbxproj +++ b/Mothur.xcodeproj/project.pbxproj @@ -356,7 +356,7 @@ outputFiles = ( "$(TARGET_BUILD_DIR)/$(INPUT_FILE_BASE).o", ); - script = "gfortran -g -m64 -c ${PROJECT_DIR}/${INPUT_FILE_NAME} -o ${TARGET_BUILD_DIR}/${INPUT_FILE_BASE}.o"; + script = "/usr/local/gfortran/bin/gfortran -g -m64 -c ${PROJECT_DIR}/${INPUT_FILE_NAME} -o ${TARGET_BUILD_DIR}/${INPUT_FILE_BASE}.o"; }; /* End PBXBuildRule section */ @@ -1912,7 +1912,6 @@ }; buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "Mothur" */; compatibilityVersion = "Xcode 3.1"; - developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, diff --git a/aligncommand.h b/aligncommand.h index 7f5122a..d423695 100644 --- a/aligncommand.h +++ b/aligncommand.h @@ -147,7 +147,7 @@ static DWORD WINAPI MyAlignThreadFunction(LPVOID lpParam){ pDataArray->count = pDataArray->end; - AlignmentDB* templateDB = new AlignmentDB(templateFileName, pDataArray->search, pDataArray->kmerSize, pDataArray->gapOpen, pDataArray->gapExtend, pDataArray->match, pDataArray->misMatch, pDataArray->threadID); + AlignmentDB* templateDB = new AlignmentDB(pDataArray->templateFileName, pDataArray->search, pDataArray->kmerSize, pDataArray->gapOpen, pDataArray->gapExtend, pDataArray->match, pDataArray->misMatch, pDataArray->threadID); //moved this into driver to avoid deep copies in windows paralellized version Alignment* alignment; diff --git a/chimerauchimecommand.h b/chimerauchimecommand.h index 45dd8a8..b401ae8 100644 --- a/chimerauchimecommand.h +++ b/chimerauchimecommand.h @@ -149,9 +149,9 @@ static DWORD WINAPI MyUchimeThreadFunction(LPVOID lpParam){ try { - pDataArray->outputFName = pDataArray->m->getFullPathName(outputFName); - pDataArray->filename = pDataArray->m->getFullPathName(filename); - pDataArray->alns = pDataArray->m->getFullPathName(alns); + pDataArray->outputFName = pDataArray->m->getFullPathName(pDataArray->outputFName); + pDataArray->filename = pDataArray->m->getFullPathName(pDataArray->filename); + pDataArray->alns = pDataArray->m->getFullPathName(pDataArray->alns); //clears files ofstream out, out1, out2; @@ -330,17 +330,6 @@ static DWORD WINAPI MyUchimeThreadFunction(LPVOID lpParam){ cPara.push_back(tempIdsmoothwindow); } - /*if (useMinsmoothid) { - char* tempminsmoothid = new char[14]; - //strcpy(tempminsmoothid, "--minsmoothid"); - *tempminsmoothid = '\0'; strncat(tempminsmoothid, "--minsmoothid", 13); - cPara.push_back(tempminsmoothid); - char* tempMinsmoothid = new char[minsmoothid.length()+1]; - *tempMinsmoothid = '\0'; strncat(tempMinsmoothid, minsmoothid.c_str(), minsmoothid.length()); - //strcpy(tempMinsmoothid, minsmoothid.c_str()); - cPara.push_back(tempMinsmoothid); - }*/ - if (pDataArray->useMaxp) { char* tempmaxp = new char[7]; //strcpy(tempmaxp, "--maxp"); @@ -498,9 +487,9 @@ static DWORD WINAPI MyUchimeSeqsThreadFunction(LPVOID lpParam){ try { - pDataArray->outputFName = pDataArray->m->getFullPathName(outputFName); - pDataArray->filename = pDataArray->m->getFullPathName(filename); - pDataArray->alns = pDataArray->m->getFullPathName(alns); + pDataArray->outputFName = pDataArray->m->getFullPathName(pDataArray->outputFName); + pDataArray->filename = pDataArray->m->getFullPathName(pDataArray->filename); + pDataArray->alns = pDataArray->m->getFullPathName(pDataArray->alns); int totalSeqs = 0; int numChimeras = 0; diff --git a/makegroupcommand.cpp b/makegroupcommand.cpp index e32af21..0add62e 100644 --- a/makegroupcommand.cpp +++ b/makegroupcommand.cpp @@ -16,6 +16,7 @@ vector MakeGroupCommand::setParameters(){ try { CommandParameter pfasta("fasta", "InputTypes", "", "", "none", "none", "none",false,true); parameters.push_back(pfasta); CommandParameter pgroups("groups", "String", "", "", "", "", "",false,false); parameters.push_back(pgroups); + CommandParameter poutput("output", "String", "", "", "", "", "",false,false); parameters.push_back(poutput); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir); diff --git a/preclustercommand.cpp b/preclustercommand.cpp index cac80b8..21de034 100644 --- a/preclustercommand.cpp +++ b/preclustercommand.cpp @@ -372,9 +372,9 @@ int PreClusterCommand::createProcessesGroups(SequenceParser* parser, string newF //append output files for(int i=0;igetFullPathName(".\\" + newFName); - newNName = m->getFullPathName(".\\" + newNName); - cout << newFName << endl; + //newFName = m->getFullPathName(".\\" + newFName); + //newNName = m->getFullPathName(".\\" + newNName); + m->appendFiles((newFName + toString(processIDS[i]) + ".temp"), newFName); m->mothurRemove((newFName + toString(processIDS[i]) + ".temp")); diff --git a/sharedordervector.cpp b/sharedordervector.cpp index ca26362..5231b3c 100644 --- a/sharedordervector.cpp +++ b/sharedordervector.cpp @@ -38,9 +38,45 @@ SharedOrderVector::SharedOrderVector(ifstream& f) : DataVector() { //reads in a individual newguy; //read in first row since you know there is at least 1 group. - f >> label >> groupN >> num; + //are we at the beginning of the file?? + if (m->saveNextLabel == "") { + f >> label; + + //is this a shared file that has headers + if (label == "label") { + //gets "group" + f >> label; m->gobble(f); + + //gets "numOtus" + f >> label; m->gobble(f); + + //eat rest of line + label = m->getline(f); m->gobble(f); + + //parse labels to save + istringstream iStringStream(label); + m->binLabelsInFile.clear(); + while(!iStringStream.eof()){ + if (m->control_pressed) { break; } + string temp; + iStringStream >> temp; m->gobble(iStringStream); + + m->binLabelsInFile.push_back(temp); + } + + f >> label; + } + }else { label = m->saveNextLabel; } + + //reset labels, currentLabels may have gotten changed as otus were eliminated because of group choices or sampling + m->currentBinLabels = m->binLabelsInFile; + + //read in first row since you know there is at least 1 group. + f >> groupN >> num; + holdLabel = label; + vector allGroups; //save group in groupmap allGroups.push_back(groupN); @@ -58,7 +94,7 @@ SharedOrderVector::SharedOrderVector(ifstream& f) : DataVector() { //reads in a m->gobble(f); - if (f.eof() != true) { f >> nextLabel; } + if (!(f.eof())) { f >> nextLabel; } //read the rest of the groups info in while ((nextLabel == holdLabel) && (f.eof() != true)) { @@ -86,9 +122,8 @@ SharedOrderVector::SharedOrderVector(ifstream& f) : DataVector() { //reads in a } - //put file pointer back since you are now at a new distance label - for (int i = 0; i < nextLabel.length(); i++) { f.unget(); } - + m->saveNextLabel = nextLabel; + groupmap->setNamesOfGroups(allGroups); m->setAllGroups(allGroups); diff --git a/sharedrabundvector.cpp b/sharedrabundvector.cpp index 4a0e5e8..5ad4b2d 100644 --- a/sharedrabundvector.cpp +++ b/sharedrabundvector.cpp @@ -104,6 +104,7 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0), //read in first row since you know there is at least 1 group. f >> groupN >> num; + holdLabel = label; //add new vector to lookup diff --git a/shhhercommand.cpp b/shhhercommand.cpp index e266b98..40a4c84 100644 --- a/shhhercommand.cpp +++ b/shhhercommand.cpp @@ -2150,7 +2150,9 @@ void ShhherCommand::setOTUs(){ void ShhherCommand::writeQualities(vector otuCounts){ try { - string qualityFileName = flowFileName.substr(0,flowFileName.find_last_of('.')) + ".shhh.qual"; + string thisOutputDir = outputDir; + if (outputDir == "") { thisOutputDir += m->hasPath(flowFileName); } + string qualityFileName = thisOutputDir + flowFileName.substr(0,flowFileName.find_last_of('.')) + ".shhh.qual"; ofstream qualityFile; m->openOutputFile(qualityFileName, qualityFile); @@ -2255,8 +2257,9 @@ void ShhherCommand::writeQualities(vector otuCounts){ void ShhherCommand::writeSequences(vector otuCounts){ try { - - string fastaFileName = flowFileName.substr(0,flowFileName.find_last_of('.')) + ".shhh.fasta"; + string thisOutputDir = outputDir; + if (outputDir == "") { thisOutputDir += m->hasPath(flowFileName); } + string fastaFileName = thisOutputDir + flowFileName.substr(0,flowFileName.find_last_of('.')) + ".shhh.fasta"; ofstream fastaFile; m->openOutputFile(fastaFileName, fastaFile); @@ -2302,7 +2305,9 @@ void ShhherCommand::writeSequences(vector otuCounts){ void ShhherCommand::writeNames(vector otuCounts){ try { - string nameFileName = flowFileName.substr(0,flowFileName.find_last_of('.')) + ".shhh.names"; + string thisOutputDir = outputDir; + if (outputDir == "") { thisOutputDir += m->hasPath(flowFileName); } + string nameFileName = thisOutputDir + flowFileName.substr(0,flowFileName.find_last_of('.')) + ".shhh.names"; ofstream nameFile; m->openOutputFile(nameFileName, nameFile); @@ -2338,7 +2343,9 @@ void ShhherCommand::writeNames(vector otuCounts){ void ShhherCommand::writeGroups(){ try { - string fileRoot = flowFileName.substr(0,flowFileName.find_last_of('.')); + string thisOutputDir = outputDir; + if (outputDir == "") { thisOutputDir += m->hasPath(flowFileName); } + string fileRoot = thisOutputDir + flowFileName.substr(0,flowFileName.find_last_of('.')); string groupFileName = fileRoot + ".shhh.groups"; ofstream groupFile; m->openOutputFile(groupFileName, groupFile); @@ -2361,7 +2368,9 @@ void ShhherCommand::writeGroups(){ void ShhherCommand::writeClusters(vector otuCounts){ try { - string otuCountsFileName = flowFileName.substr(0,flowFileName.find_last_of('.')) + ".shhh.counts"; + string thisOutputDir = outputDir; + if (outputDir == "") { thisOutputDir += m->hasPath(flowFileName); } + string otuCountsFileName = thisOutputDir + flowFileName.substr(0,flowFileName.find_last_of('.')) + ".shhh.counts"; ofstream otuCountsFile; m->openOutputFile(otuCountsFileName, otuCountsFile); -- 2.39.2