From: westcott Date: Fri, 4 Mar 2011 13:22:24 +0000 (+0000) Subject: bug fixes X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=commitdiff_plain;h=e840ba0e90a2b2be39e0910e4be23dde6a14cbac bug fixes --- diff --git a/Mothur.xcodeproj/project.pbxproj b/Mothur.xcodeproj/project.pbxproj index e7b832a..865f078 100644 --- a/Mothur.xcodeproj/project.pbxproj +++ b/Mothur.xcodeproj/project.pbxproj @@ -1625,7 +1625,7 @@ attributes = { ORGANIZATIONNAME = "Schloss Lab"; }; - buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "Mothur" */; + buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "mothur" */; compatibilityVersion = "Xcode 3.1"; developmentRegion = English; hasScannedForEncodings = 1; @@ -1970,14 +1970,14 @@ 1DEB928A08733DD80010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; DEPLOYMENT_LOCATION = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 3; GCC_PREPROCESSOR_DEFINITIONS = ( "MOTHUR_FILES=\"\\\"../release\\\"\"", - "VERSION=\"\\\"1.17.0\\\"\"", - "RELEASE_DATE=\"\\\"2/25/2011\\\"\"", + "VERSION=\"\\\"1.17.2\\\"\"", + "RELEASE_DATE=\"\\\"3/02/2011\\\"\"", ); GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -1986,8 +1986,8 @@ MACH_O_TYPE = mh_execute; ONLY_ACTIVE_ARCH = YES; OTHER_CPLUSPLUSFLAGS = ( - "-DUSE_READLINE", "-DBIT_VERSION", + "-DUSE_READLINE", "$(OTHER_CFLAGS)", ); OTHER_LDFLAGS = ( @@ -1995,7 +1995,7 @@ "-lreadline", ); PREBINDING = NO; - SDKROOT = macosx10.5; + SDKROOT = macosx10.6; }; name = Debug; }; @@ -2049,7 +2049,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "Mothur" */ = { + 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "mothur" */ = { isa = XCConfigurationList; buildConfigurations = ( 1DEB928A08733DD80010E9CD /* Debug */, diff --git a/listseqscommand.cpp b/listseqscommand.cpp index 360e195..4060857 100644 --- a/listseqscommand.cpp +++ b/listseqscommand.cpp @@ -259,7 +259,7 @@ int ListSeqsCommand::readFasta(){ ifstream in; m->openInputFile(fastafile, in); string name; - + while(!in.eof()){ if (m->control_pressed) { in.close(); return 0; } @@ -444,6 +444,7 @@ int ListSeqsCommand::readTax(){ names.push_back(firstCol); m->gobble(in); + } in.close(); diff --git a/normalizesharedcommand.cpp b/normalizesharedcommand.cpp index c0e7c1f..d9405a5 100644 --- a/normalizesharedcommand.cpp +++ b/normalizesharedcommand.cpp @@ -404,7 +404,7 @@ int NormalizeSharedCommand::normalize(vector& thisLookUp, o int abund = thisLookUp[i]->getAbundance(j); - float relabund = relabund = abund / (float) thisLookUp[i]->getNumSeqs(); + float relabund = abund / (float) thisLookUp[i]->getNumSeqs(); float newNorm = relabund * norm; //round to nearest int @@ -478,7 +478,7 @@ int NormalizeSharedCommand::normalize(vector& thisLook float abund = thisLookUp[i]->getAbundance(j); - float relabund = relabund = abund / (float) thisLookUp[i]->getNumSeqs(); + float relabund = abund / (float) thisLookUp[i]->getNumSeqs(); float newNorm = relabund * norm; thisLookUp[i]->set(j, newNorm, thisLookUp[i]->getGroup()); diff --git a/qualityscores.cpp b/qualityscores.cpp index 8b8e4ec..719bf3d 100644 --- a/qualityscores.cpp +++ b/qualityscores.cpp @@ -31,7 +31,7 @@ QualityScores::QualityScores(ifstream& qFile){ m = MothurOut::getInstance(); - seqName = ""; + /*seqName = ""; int score; qFile >> seqName; @@ -44,16 +44,64 @@ QualityScores::QualityScores(ifstream& qFile){ else{ seqName = seqName.substr(1); } - + cout << seqName << endl; string qScoreString = m->getline(qFile); - + cout << qScoreString << endl; istringstream qScoreStringStream(qScoreString); + int count = 0; + while(!qScoreStringStream.eof()){ + if (m->control_pressed) { break; } + qScoreStringStream >> score; + qScores.push_back(score); + cout << score << '\t' << count << endl; + count++; + } + qScores.pop_back();*/ + string scores = ""; + + while(!qFile.eof()){ + + qFile >> seqName; + + //get name + if (seqName.length() != 0) { + seqName = seqName.substr(1); + while (!qFile.eof()) { + char c = qFile.get(); + //gobble junk on line + if (c == 10 || c == 13){ break; } + } + m->gobble(qFile); + } + + //get scores + while(qFile){ + char letter=qFile.get(); + if((letter == '>')){ qFile.putback(letter); break; } + else if (isprint(letter)) { scores += letter; } + } + + m->gobble(qFile); + + break; + } + + //convert scores string to qScores + istringstream qScoreStringStream(scores); + + int score; while(!qScoreStringStream.eof()){ + + if (m->control_pressed) { break; } + qScoreStringStream >> score; qScores.push_back(score); } + qScores.pop_back(); seqLength = qScores.size(); + + } catch(exception& e) { m->errorOut(e, "QualityScores", "QualityScores"); diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index dd5bf34..d1b9a5c 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -34,7 +34,8 @@ TrimSeqsCommand::TrimSeqsCommand(){ abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; - outputTypes["qual"] = tempOutNames; + outputTypes["qfile"] = tempOutNames; + outputTypes["group"] = tempOutNames; } catch(exception& e) { m->errorOut(e, "TrimSeqsCommand", "TrimSeqsCommand"); @@ -103,7 +104,8 @@ TrimSeqsCommand::TrimSeqsCommand(string option) { //initialize outputTypes vector tempOutNames; outputTypes["fasta"] = tempOutNames; - outputTypes["qual"] = tempOutNames; + outputTypes["qfile"] = tempOutNames; + outputTypes["group"] = tempOutNames; //if the user changes the input directory command factory will send this info to us in the output parameter string inputDir = validParameter.validFile(parameters, "inputdir", false); @@ -223,13 +225,9 @@ TrimSeqsCommand::TrimSeqsCommand(string option) { temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found") { temp = "1"; } convert(temp, processors); - if ((oligoFile != "") && (groupfile != "")) { - m->mothurOut("You given both a oligos file and a groupfile, only one is allowed."); m->mothurOutEndLine(); abort = true; - } - - if(allFiles && (oligoFile == "") && (groupfile == "")){ - m->mothurOut("You selected allfiles, but didn't enter an oligos or group file. Ignoring the allfiles request."); m->mothurOutEndLine(); + if(allFiles && (oligoFile == "")){ + m->mothurOut("You selected allfiles, but didn't enter an oligos. Ignoring the allfiles request."); m->mothurOutEndLine(); } if((qAverage != 0 && qThreshold != 0) && qFileName == ""){ m->mothurOut("You didn't provide a quality file name, quality criteria will be ignored."); m->mothurOutEndLine(); @@ -319,15 +317,15 @@ int TrimSeqsCommand::execute(){ if (qFileName != "") { outputNames.push_back(trimQualFile); outputNames.push_back(scrapQualFile); - outputTypes["qual"].push_back(trimQualFile); - outputTypes["qual"].push_back(scrapQualFile); + outputTypes["qfile"].push_back(trimQualFile); + outputTypes["qfile"].push_back(scrapQualFile); } string outputGroupFileName; if(oligoFile != ""){ outputGroupFileName = outputDir + m->getRootName(m->getSimpleName(fastaFile)) + "groups"; - outputNames.push_back(outputGroupFileName); outputTypes["groups"].push_back(outputGroupFileName); + outputNames.push_back(outputGroupFileName); outputTypes["group"].push_back(outputGroupFileName); getOligos(fastaFileNames, qualFileNames); } @@ -928,7 +926,7 @@ void TrimSeqsCommand::getOligos(vector >& fastaFileNames, vector< if(qFileName != ""){ qualFileName = outputDir + m->getRootName(m->getSimpleName(qFileName)) + comboGroupName + ".qual"; outputNames.push_back(qualFileName); - outputTypes["qual"].push_back(qualFileName); + outputTypes["qfile"].push_back(qualFileName); qualFileNames[itBar->second][itPrimer->second] = qualFileName; m->openOutputFile(qualFileName, temp); temp.close(); }