]> git.donarmstrong.com Git - mothur.git/commitdiff
Merge remote-tracking branch 'origin'
authorSarah Westcott <mothur.westcott@gmail.com>
Fri, 2 Aug 2013 12:43:49 +0000 (08:43 -0400)
committerSarah Westcott <mothur.westcott@gmail.com>
Fri, 2 Aug 2013 12:43:49 +0000 (08:43 -0400)
Mothur.xcodeproj/project.pbxproj
aligncommand.cpp
classifyotucommand.cpp
otuhierarchycommand.cpp
qualityscores.cpp
screenseqscommand.h
seqsummarycommand.cpp

index b09bab447e3307bc279189d5e5b5dae30a677e7a..0b945f5e899372cc6e5cbe16ce8ef4abaa96d738 100644 (file)
                        outputFiles = (
                                "$(TARGET_BUILD_DIR)/$(INPUT_FILE_BASE).o",
                        );
-                       script = "/usr/local/bin/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 */
 
index f9c0436c62874864279e533a3258d72bf2f6cf2d..f757a7920bb337883a2a7773f35ed533d2186c80 100644 (file)
@@ -558,6 +558,7 @@ int AlignCommand::driver(linePair* filePos, string alignFName, string reportFNam
                        if (m->control_pressed) {  break; }
                        
                        Sequence* candidateSeq = new Sequence(inFASTA);  m->gobble(inFASTA);
+            cout  << candidateSeq->getAligned() << endl;
                        report.setCandidate(candidateSeq);
 
                        int origNumBases = candidateSeq->getNumBases();
index 170c234ac245e6c32e3174ad80145fbcc359f2f2..76d7504aa04b0170629b0f022a882be94ceacfc0 100644 (file)
@@ -616,9 +616,10 @@ int ClassifyOtuCommand::process(ListVector* processList) {
                        //add this bins taxonomy to summary
                        if (basis == "sequence") {
                                for(int j = 0; j < names.size(); j++) {  
-                    int numReps = 1;
-                    if (countfile != "") {  numReps = ct->getNumSeqs(names[j]); }
-                    for(int k = 0; k < numReps; k++) {  taxaSum->addSeqToTree(names[j], noConfidenceConTax);  }
+                    //int numReps = 1;
+                    //if (countfile != "") {  numReps = ct->getNumSeqs(names[j]); }
+                    //for(int k = 0; k < numReps; k++) {  taxaSum->addSeqToTree(names[j], noConfidenceConTax);  }
+                    taxaSum->addSeqToTree(names[j], noConfidenceConTax);
                 }
                        }else { //otu
                 map<string, bool> containsGroup; 
index dc026decc9db9916513fcbd1d41fe23298173717..a294a77c69a8cd5582a38cf7394c510a1e5ccccb 100644 (file)
@@ -180,18 +180,10 @@ int OtuHierarchyCommand::execute(){
                
                        if (m->control_pressed) {  return 0; }
                        
-                       string names = lists[0].get(i); 
-                       
-                       //parse bin
-                       while (names.find_first_of(',') != -1) { 
-                               string name = names.substr(0,names.find_first_of(','));
-                               names = names.substr(names.find_first_of(',')+1, names.length());
-                               littleBins[name] = i;  
-                       }
-                       
-                       //get last name
-                       littleBins[names] = i;
-               }
+                       string bin = lists[0].get(i);
+            vector<string> names; m->splitAtComma(bin, names);
+                       for (int j = 0; j < names.size(); j++) { littleBins[names[j]] = i; }
+        }
                
                ofstream out;
         map<string, string> variables; 
@@ -207,24 +199,19 @@ int OtuHierarchyCommand::execute(){
                
                        if (m->control_pressed) { outputTypes.clear(); out.close(); m->mothurRemove(outputFileName); return 0; }
                        
-                       string names = lists[1].get(i);
+                       string binnames = lists[1].get(i);
+            vector<string> names; m->splitAtComma(binnames, names);
+            
                        
                        //output column 1
-                       if (output == "name")   {   out << names << '\t';       }
-                       else                                    {       out << i << '\t';               }
+                       if (output == "name")   {   out << binnames << '\t';    }
+                       else                                    {       out << (i+1) << '\t';           }
                        
                        map<int, int> bins; //bin numbers in little that are in this bin in big
                        map<int, int>::iterator it;
                        
                        //parse bin
-                       while (names.find_first_of(',') != -1) { 
-                               string name = names.substr(0,names.find_first_of(','));
-                               names = names.substr(names.find_first_of(',')+1, names.length());
-                               bins[littleBins[name]] = littleBins[name];  
-                       }
-                       
-                       //get last name
-                       bins[littleBins[names]] = littleBins[names]; 
+                       for (int j = 0; j < names.size(); j++) { bins[littleBins[names[j]]] = littleBins[names[j]];   }
                        
                        string col2 = "";
                        for (it = bins.begin(); it != bins.end(); it++) {
index 26492245e2b9805144125052d57045a834bc3f95..0408b83ebaf0d79f31e5290278fa29e567c1cb87 100644 (file)
@@ -32,22 +32,22 @@ QualityScores::QualityScores(ifstream& qFile){
                m = MothurOut::getInstance();
 
                int score;
-               seqName = getSequenceName(qFile);
+               seqName = getSequenceName(qFile); m->gobble(qFile);
                
         if (m->debug) { m->mothurOut("[DEBUG]: name = '" + seqName + "'\n.");  }
         
                if (!m->control_pressed) {
-            string qScoreString = m->getline(qFile);
+            string qScoreString = m->getline(qFile); m->gobble(qFile);
             
             if (m->debug) { m->mothurOut("[DEBUG]: scores = '" + qScoreString + "'\n.");  }
             
             while(qFile.peek() != '>' && qFile.peek() != EOF){
                 if (m->control_pressed) { break; }
-                string temp = m->getline(qFile);
+                string temp = m->getline(qFile); m->gobble(qFile);
                 if (m->debug) { m->mothurOut("[DEBUG]: scores = '" + temp + "'\n.");  }
                 qScoreString +=  ' ' + temp;
             }
-            //cout << "done reading " << endl; 
+            //cout << "done reading " << endl;
             istringstream qScoreStringStream(qScoreString);
             int count = 0;
             while(!qScoreStringStream.eof()){
@@ -68,7 +68,7 @@ QualityScores::QualityScores(ifstream& qFile){
         }
                
                seqLength = qScores.size();
-               //cout << "seqlength = " << seqLength << '\t' << count << endl;
+               //cout << "seqlength = " << seqLength  << endl;
                
        }
        catch(exception& e) {
index aeaddae1300207aff7ef713858e9ee760be52e12..18a55ac1b584dc0bce91c4f0f950d164e03fb983 100644 (file)
@@ -74,8 +74,8 @@ private:
 
        bool abort;
        string fastafile, namefile, groupfile, alignreport, outputDir, qualfile, taxonomy, countfile, contigsreport, summaryfile;
-       int startPos, endPos, maxAmbig, maxHomoP, minLength, maxLength, processors, criteria, minOverlap, oStart, oEnd, mismatches, maxN, maxInsert;
-    float minSim, minScore;
+       int startPos, endPos, maxAmbig, maxHomoP, minLength, maxLength, processors, minOverlap, oStart, oEnd, mismatches, maxN, maxInsert;
+    float minSim, minScore, criteria;
        vector<string> outputNames;
        vector<string> optimize;
        map<string, int> nameMap;
index 27bb8d95190fb66ea03510cf266d2d53824d988c..e6b037b6bcafafa6c7ccf5aafa9731de3d7ba864 100644 (file)
@@ -364,7 +364,7 @@ int SeqSummaryCommand::execute(){
                int size = startPosition.size();
                
                //find means
-               double meanStartPosition, meanEndPosition, meanSeqLength, meanAmbigBases, meanLongHomoPolymer;
+               unsigned long long meanStartPosition, meanEndPosition, meanSeqLength, meanAmbigBases, meanLongHomoPolymer;
                meanStartPosition = 0; meanEndPosition = 0; meanSeqLength = 0; meanAmbigBases = 0; meanLongHomoPolymer = 0;
                for (int i = 0; i < size; i++) {
                        meanStartPosition += startPosition[i];
@@ -374,8 +374,9 @@ int SeqSummaryCommand::execute(){
                        meanLongHomoPolymer += longHomoPolymer[i];
                }
                 
-               //this is an int divide so the remainder is lost
-               meanStartPosition /= (float) size; meanEndPosition /= (float) size; meanLongHomoPolymer /= (float) size; meanSeqLength /= (float) size; meanAmbigBases /= (float) size;
+        double meanstartPosition, meanendPosition, meanseqLength, meanambigBases, meanlongHomoPolymer;
+                
+               meanstartPosition /= (double) size; meanendPosition /= (double) size; meanlongHomoPolymer /= (double) size; meanseqLength /= (double) size; meanambigBases /= (double) size;
                                
                int ptile0_25   = int(size * 0.025);
                int ptile25             = int(size * 0.250);
@@ -399,7 +400,7 @@ int SeqSummaryCommand::execute(){
                m->mothurOut("75%-tile:\t" + toString(startPosition[ptile75]) + "\t" + toString(endPosition[ptile75]) + "\t" + toString(seqLength[ptile75]) + "\t" + toString(ambigBases[ptile75]) + "\t" + toString(longHomoPolymer[ptile75]) + "\t" + toString(ptile75+1)); m->mothurOutEndLine();
                m->mothurOut("97.5%-tile:\t" + toString(startPosition[ptile97_5]) + "\t" + toString(endPosition[ptile97_5]) + "\t" + toString(seqLength[ptile97_5]) + "\t" + toString(ambigBases[ptile97_5]) + "\t" + toString(longHomoPolymer[ptile97_5]) + "\t" + toString(ptile97_5+1)); m->mothurOutEndLine();
                m->mothurOut("Maximum:\t" + toString(startPosition[ptile100]) + "\t" + toString(endPosition[ptile100]) + "\t" + toString(seqLength[ptile100]) + "\t" + toString(ambigBases[ptile100]) + "\t" + toString(longHomoPolymer[ptile100]) + "\t" + toString(ptile100+1)); m->mothurOutEndLine();
-               m->mothurOut("Mean:\t" + toString(meanStartPosition) + "\t" + toString(meanEndPosition) + "\t" + toString(meanSeqLength) + "\t" + toString(meanAmbigBases) + "\t" + toString(meanLongHomoPolymer)); m->mothurOutEndLine();
+               m->mothurOut("Mean:\t" + toString(meanstartPosition) + "\t" + toString(meanendPosition) + "\t" + toString(meanseqLength) + "\t" + toString(meanambigBases) + "\t" + toString(meanlongHomoPolymer)); m->mothurOutEndLine();
 
                if ((namefile == "") && (countfile == "")) {  m->mothurOut("# of Seqs:\t" + toString(numSeqs)); m->mothurOutEndLine(); }
                else { m->mothurOut("# of unique seqs:\t" + toString(numSeqs)); m->mothurOutEndLine(); m->mothurOut("total # of seqs:\t" + toString(startPosition.size())); m->mothurOutEndLine(); }
@@ -543,7 +544,7 @@ int SeqSummaryCommand::MPICreateSummary(int start, int num, vector<int>& startPo
                                }
                                
                                //for each sequence this sequence represents
-                               for (int i = 0; i < num; i++) {
+                               for (int j = 0; j < num; j++) {
                                        startPosition.push_back(current.getStartPos());
                                        endPosition.push_back(current.getEndPos());
                                        seqLength.push_back(current.getNumBases());