]> git.donarmstrong.com Git - mothur.git/commitdiff
bug fixes
authorwestcott <westcott>
Fri, 4 Mar 2011 13:22:24 +0000 (13:22 +0000)
committerwestcott <westcott>
Fri, 4 Mar 2011 13:22:24 +0000 (13:22 +0000)
Mothur.xcodeproj/project.pbxproj
listseqscommand.cpp
normalizesharedcommand.cpp
qualityscores.cpp
trimseqscommand.cpp

index e7b832a17057bccc6a5c2647adebfcdfcaeea2ca..865f078d99ea2504c19c97befe28ead0d6a2254e 100644 (file)
                        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;
                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;
                                MACH_O_TYPE = mh_execute;
                                ONLY_ACTIVE_ARCH = YES;
                                OTHER_CPLUSPLUSFLAGS = (
-                                       "-DUSE_READLINE",
                                        "-DBIT_VERSION",
+                                       "-DUSE_READLINE",
                                        "$(OTHER_CFLAGS)",
                                );
                                OTHER_LDFLAGS = (
                                        "-lreadline",
                                );
                                PREBINDING = NO;
-                               SDKROOT = macosx10.5;
+                               SDKROOT = macosx10.6;
                        };
                        name = Debug;
                };
                        defaultConfigurationIsVisible = 0;
                        defaultConfigurationName = Release;
                };
-               1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "Mothur" */ = {
+               1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "mothur" */ = {
                        isa = XCConfigurationList;
                        buildConfigurations = (
                                1DEB928A08733DD80010E9CD /* Debug */,
index 360e1955bab31055c4ad06f71c933a4228058386..406085728838262b79100a70133600639e6c47a2 100644 (file)
@@ -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();
                
index c0e7c1f7f037cf1f0d87ab169408825a547c5982..d9405a5129dd238ee2992a2986289ffffd6ed167 100644 (file)
@@ -404,7 +404,7 @@ int NormalizeSharedCommand::normalize(vector<SharedRAbundVector*>& 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<SharedRAbundFloatVector*>& 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());
index 8b8e4ec22c68ea406ddcafeee6e4a1abb280566a..719bf3dc6c44cd3880ebc8b1c4d3dc352a448ee1 100644 (file)
@@ -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");
index dd5bf3460debcc3e2fd5b6af736b0e123c7890ae..d1b9a5c43549991bd3876164a318b8d9accb54ce 100644 (file)
@@ -34,7 +34,8 @@ TrimSeqsCommand::TrimSeqsCommand(){
                abort = true; calledHelp = true; 
                vector<string> 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<string> 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<vector<string> >& 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();
                                        }