]> git.donarmstrong.com Git - mothur.git/commitdiff
1.19.0
authorwestcott <westcott>
Mon, 9 May 2011 15:52:45 +0000 (15:52 +0000)
committerwestcott <westcott>
Mon, 9 May 2011 15:52:45 +0000 (15:52 +0000)
Mothur.xcodeproj/project.pbxproj
listseqscommand.cpp
mothurout.cpp
qualityscores.cpp
splitmatrix.cpp
trimseqscommand.cpp

index 321c130ca8efed7cfad93ec56d1f38d52d0311a5..4d37747693cceafd0d66ea97075c0ca07cc94ec0 100644 (file)
                                GCC_OPTIMIZATION_LEVEL = 0;
                                GCC_PREPROCESSOR_DEFINITIONS = (
                                        "MOTHUR_FILES=\"\\\"../release\\\"\"",
-                                       "VERSION=\"\\\"1.18.1\\\"\"",
-                                       "RELEASE_DATE=\"\\\"4/15/2011\\\"\"",
+                                       "VERSION=\"\\\"1.19.0\\\"\"",
+                                       "RELEASE_DATE=\"\\\"5/9/2011\\\"\"",
                                );
                                GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
                                GCC_MODEL_TUNING = "";
                                GCC_OPTIMIZATION_LEVEL = 0;
                                GCC_PREPROCESSOR_DEFINITIONS = (
-                                       "VERSION=\"\\\"1.18.1\\\"\"",
-                                       "RELEASE_DATE=\"\\\"4/15/2011\\\"\"",
+                                       "VERSION=\"\\\"1.19.0\\\"\"",
+                                       "RELEASE_DATE=\"\\\"5/9/2011\\\"\"",
                                );
                                GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
index 21cb4c7f622e95bc4a44689ce8ef605703444ec2..d60470cdebcc70114afcb79cc08edbb333816292 100644 (file)
@@ -257,11 +257,11 @@ int ListSeqsCommand::readFasta(){
                m->openInputFile(fastafile, in);
                string name;
                
-               ofstream out;
-               string newFastaName = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "numsAdded.fasta";
-               m->openOutputFile(newFastaName, out);
-               int count = 1;
-               string lastName = "";
+               //ofstream out;
+               //string newFastaName = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "numsAdded.fasta";
+               //m->openOutputFile(newFastaName, out);
+               //int count = 1;
+               //string lastName = "";
                
                while(!in.eof()){
                        
@@ -269,20 +269,20 @@ int ListSeqsCommand::readFasta(){
                        
                        Sequence currSeq(in);
                        name = currSeq.getName();
-                       if (lastName == "") { lastName = name; }
-                       if (name != lastName) { count = 1; }
-                       lastName = name;
+                       //if (lastName == "") { lastName = name; }
+                       //if (name != lastName) { count = 1; }
+               //      lastName = name;
                        
-                       Sequence newSeq(name+"_"+toString(count), currSeq.getAligned());
-                       newSeq.printSequence(out);
+                       //Sequence newSeq(name+"_"+toString(count), currSeq.getAligned());
+                       //newSeq.printSequence(out);
                        
                        if (name != "") {  names.push_back(name);  }
                        
                        m->gobble(in);
-                       count++;
+                       //count++;
                }
                in.close();     
-               out.close();
+               //out.close();
                
                return 0;
 
index 2b06799f3c91f58c3c72ed63c2a6098d0473675e..c2ef698db8ed4d9c0769fcd4295a27a886c65bfc 100644 (file)
@@ -438,12 +438,12 @@ string MothurOut::getline(ifstream& fileHandle) {
        
                string line = "";
                
-               while (!fileHandle.eof())       {
+               while (fileHandle)      {
                        //get next character
                        char c = fileHandle.get(); 
                        
                        //are you at the end of the line
-                       if ((c == '\n') || (c == '\r') || (c == '\f')){  break; }       
+                       if ((c == '\n') || (c == '\r') || (c == '\f') || (c == EOF)){  break;   }       
                        else {          line += c;              }
                }
                
index 3f8722f34f83416aa143f21a5a81e99c7329a7d8..c9c65042843bffddf5c6d3d7acca4ab38754ac5e 100644 (file)
@@ -278,7 +278,7 @@ bool QualityScores::stripQualWindowAverage(Sequence& sequence, int stepSize, int
                
                int end = windowSize;
                int start = 0;
-               
+
                if(seqLength < windowSize) {    return 0;       }
                        
                while(start < seqLength){
@@ -300,6 +300,9 @@ bool QualityScores::stripQualWindowAverage(Sequence& sequence, int stepSize, int
                
                if(end == -1){  end = seqLength;        }
                
+               //failed first window
+               if (end < windowSize) { return 0; }
+                       
                sequence.setUnaligned(rawSequence.substr(0,end));
                trimQScores(-1, end);
                
index 80f311dc61cbd8d52342ee55d39c2284b161761d..8ccb867e250aed20816be57d779d6105316109f9 100644 (file)
@@ -186,6 +186,7 @@ int SplitMatrix::createDistanceFilesFromTax(map<string, int>& seqGroup, int numG
                for (int i = 0; i < numGroups; i++) { 
                        
                        string options = "fasta=" + (fastafile + "." + toString(i) + ".temp") + ", processors=" + toString(processors) + ", cutoff=" + toString(distCutoff);
+                       if (outputDir != "") { options += ", outputdir=" + outputDir; }
                        
                        Command* command = new DistanceCommand(options);
                        
index f685a427d4dfc87d92e45b4aa82342bfd6ff3d16..d8a0d1d00aaf58768d887134ffb29aa3d4e5275c 100644 (file)
@@ -497,7 +497,7 @@ int TrimSeqsCommand::driverCreateTrim(string filename, string qFileName, string
                        int currentSeqsDiffs = 0;
 
                        Sequence currSeq(inFASTA); m->gobble(inFASTA);
-
+                       
                        QualityScores currQual;
                        if(qFileName != ""){
                                currQual = QualityScores(qFile);  m->gobble(qFile);
@@ -546,7 +546,7 @@ int TrimSeqsCommand::driverCreateTrim(string filename, string qFileName, string
                                        else if(qRollAverage != 0)      {       success = currQual.stripQualRollingAverage(currSeq, qRollAverage);      }
                                        else if(qWindowAverage != 0){   success = currQual.stripQualWindowAverage(currSeq, qWindowStep, qWindowSize, qWindowAverage);   }
                                        else                                            {       success = 1;                            }
-                                       
+                               
                                        //you don't want to trim, if it fails above then scrap it
                                        if ((!qtrim) && (origLength != currSeq.getNumBases())) {  success = 0; }