]> git.donarmstrong.com Git - mothur.git/commitdiff
changes for 1.12.2
authorwestcott <westcott>
Fri, 30 Jul 2010 16:53:56 +0000 (16:53 +0000)
committerwestcott <westcott>
Fri, 30 Jul 2010 16:53:56 +0000 (16:53 +0000)
getoturepcommand.cpp
makefile
nast.cpp
setdircommand.cpp
sffinfocommand.cpp

index b872d1a17b16b3472f189045621b325c2b816d36..de7d761dc68169f3f0df446f42ca07cd9f3b16aa 100644 (file)
@@ -790,7 +790,8 @@ int GetOTURepCommand::processNames(string filename, string label) {
                                out << sequence << endl;
                        }
                }
-                       
+               
+               in.close();
                out.close();
                out2.close();
                
index 3f0893c5ad82d811fb4c5cf05f86f0326b4561c8..a8a0170db2642bf436dbace2f002a2f370c76d23 100644 (file)
--- a/makefile
+++ b/makefile
@@ -32,7 +32,7 @@ ifeq  ($(strip $(64BIT_VERSION)),yes)
         CXXFLAGS += -DBIT_VERSION
        
        #if you are using centos uncomment the following lines
-       #CC = g++44
+       #CXX = g++44
        #CXXFLAGS += -mtune=native -march=native -m64
 endif
 
index 8ed69fa6820cca9003dd8af1a0cb148c85899753..90c8383f2a8a6fb23467d6b662879dfde5fd8f49 100644 (file)
--- a/nast.cpp
+++ b/nast.cpp
@@ -99,7 +99,7 @@ void Nast::removeExtraGaps(string& candAln, string tempAln, string newTemplateAl
        
                for(int i=0; i<longAlignmentLength; i++){                               //      use the long alignment as the standard
                        int rightIndex, rightRoom, leftIndex, leftRoom;
-                       
+       
                        //      Part C of Fig. 2 from DeSantis et al.
                        if((isalpha(newTemplateAlign[i]) != isalpha(tempAln[i]))){      //if there is a discrepancy between the regapped
                                
@@ -132,12 +132,12 @@ void Nast::removeExtraGaps(string& candAln, string tempAln, string newTemplateAl
                                        if((i-leftIndex) <= (rightIndex-i)){            //      the left gap is closer - > move stuff left there's
        
                                                if(leftRoom >= insertLength){                   //      enough room to the left to move
-                       //cout << "lr newTemplateAlign = " << newTemplateAlign.length() << '\t' << i << '\t' << i+insertLength << endl;
+                       //cout << "lr newTemplateAlign = " << newTemplateAlign.length() << '\t' << i << '\t' << insertLength << endl;
                                                        string leftTemplateString = newTemplateAlign.substr(0,i);
                                                        string rightTemplateString = newTemplateAlign.substr((i+insertLength));
                                                        newTemplateAlign = leftTemplateString + rightTemplateString;
                                                        longAlignmentLength = newTemplateAlign.length();
-                       //cout << "lr candAln = " << candAln.length() << '\t' << leftIndex-insertLength+1 << '\t' << leftIndex+1 << endl;                               
+                       //cout << "lr candAln = " << candAln.length() << '\t' << leftIndex << '\t'  << endl;                            
                                                        string leftCandidateString = candAln.substr(0,(leftIndex-insertLength+1));
                                                        string rightCandidateString = candAln.substr((leftIndex+1));
                                                        candAln = leftCandidateString + rightCandidateString;
@@ -145,12 +145,12 @@ void Nast::removeExtraGaps(string& candAln, string tempAln, string newTemplateAl
                                                }
                                                else{                                                                   //      not enough room to the left, have to steal some space to
                                                
-                       //cout << "in else lr newTemplateAlign = " << newTemplateAlign.length() << '\t' << i << '\t' << i+insertLength << endl;
+                       //cout << "in else lr newTemplateAlign = " << newTemplateAlign.length() << '\t' << i << '\t' << insertLength << endl;
                                                        string leftTemplateString = newTemplateAlign.substr(0,i);       //      the right
                                                        string rightTemplateString = newTemplateAlign.substr((i+insertLength));
                                                        newTemplateAlign = leftTemplateString + rightTemplateString;
                                                        longAlignmentLength = newTemplateAlign.length();
-                       //cout << " in else lr candAln = " << candAln.length() << '\t' << leftIndex-leftRoom+1 << '\t' << rightIndex-leftIndex-1 << '\t' << rightIndex+(insertLength-leftRoom) << endl;                                 
+                       //cout << " in else lr candAln = " << candAln.length() << '\t' << " leftIndex = " << leftIndex << " leftroom = " << leftRoom << " rightIndex = " << rightIndex << '\t' << endl;                                 
                                                        string leftCandidateString = candAln.substr(0,(leftIndex-leftRoom+1));
                                                        string insertString = candAln.substr((leftIndex+1),(rightIndex-leftIndex-1));
                                                        string rightCandidateString = candAln.substr((rightIndex+(insertLength-leftRoom)));
@@ -187,6 +187,7 @@ void Nast::removeExtraGaps(string& candAln, string tempAln, string newTemplateAl
                                                }
                                        }
                                        i -= insertLength;
+       //if (i < 0) { cout << " we have a negative i = " << i << endl; }
 
                                }
                                else{
index 1bc78bdf13cd69ee3be268bef006fc74d69dce9e..001ae235dd11ff0f015ebeba76de10ee3bcb2dbf 100644 (file)
@@ -157,19 +157,8 @@ int SetDirectoryCommand::execute(){
                                if (lastChar != "\\") { tempdefault += "\\"; }  
                        #endif
                        
-                       //test to make sure directory exists
-                       tempdefault = getFullPathName(tempdefault);
-                       string inTemp = tempdefault + "temp";
-                       ofstream in;
-                       in.open(inTemp.c_str(), ios::trunc);
-                       if(!in) {
-                               m->mothurOut(tempdefault + " directory does not exist or is not writable."); m->mothurOutEndLine(); 
-                       }else{
-                               in.close();
-                               remove(inTemp.c_str());
-                               m->mothurOut("Changing default directory to " + tempdefault); m->mothurOutEndLine();  
-                               m->setDefaultPath(tempdefault);
-                       }
+                       m->mothurOut("Changing default directory to " + tempdefault); m->mothurOutEndLine();  
+                       m->setDefaultPath(tempdefault);
                }
 
                return 0;
index 38322ac86c2a2d440b0dd7f7ac097ef0abb044b2..0e860db9df44f7c5a4380469ff823c0bd999c82b 100644 (file)
@@ -562,6 +562,7 @@ int SffInfoCommand::printSffTxtSeqData(ofstream& out, seqRead& read, Header& hea
                for (int i = 0; i < read.flowIndex.size(); i++) {  sum +=  read.flowIndex[i];  out << sum << '\t'; }
                
                //make the bases you want to clip lowercase and the bases you want to keep upper case
+               if(header.clipQualRight == 0){  header.clipQualRight = read.bases.length();     }
                for (int i = 0; i < (header.clipQualLeft-1); i++) { read.bases[i] = tolower(read.bases[i]); }
                for (int i = (header.clipQualLeft-1); i < (header.clipQualRight-1); i++) {   read.bases[i] = toupper(read.bases[i]);  }
                for (int i = (header.clipQualRight-1); i < read.bases.length(); i++) {   read.bases[i] = tolower(read.bases[i]);  }
@@ -586,7 +587,7 @@ int SffInfoCommand::printFastaSeqData(ofstream& out, seqRead& read, Header& head
                string seq = read.bases;
                
                if (trim) {
-                       if(header.clipQualRight != 0){
+                       if((header.clipQualRight != 0) && ((header.clipQualRight-header.clipQualLeft) >= 0)){
                                seq = seq.substr((header.clipQualLeft-1), (header.clipQualRight-header.clipQualLeft));
                        }
                        else {
@@ -619,7 +620,7 @@ int SffInfoCommand::printQualSeqData(ofstream& out, seqRead& read, Header& heade
        try {
                
                if (trim) {
-                       if(header.clipQualRight != 0){
+                       if((header.clipQualRight != 0) && ((header.clipQualRight-header.clipQualLeft) >= 0)){
                                out << ">" << header.name << " length=" << (header.clipQualRight-header.clipQualLeft) << endl;
                                for (int i = (header.clipQualLeft-1); i < (header.clipQualRight-1); i++) {   out << read.qualScores[i] << '\t'; }
                        }