]> git.donarmstrong.com Git - mothur.git/commitdiff
Merge remote-tracking branch 'origin'
authorSarahsWork <sarahswork@141-213-168-227.vpn.umnet.umich.edu>
Mon, 18 Mar 2013 17:37:37 +0000 (13:37 -0400)
committerSarahsWork <sarahswork@141-213-168-227.vpn.umnet.umich.edu>
Mon, 18 Mar 2013 17:37:37 +0000 (13:37 -0400)
makecontigscommand.cpp
seqerrorcommand.cpp
sequence.cpp
trimseqscommand.cpp

index 7d7184f7806b671830dfaa4303af72558d2db70e..b1e78ae091a13a020360137303b3143a5d9536f6 100644 (file)
@@ -30,7 +30,7 @@ vector<string> MakeContigsCommand::setParameters(){
                CommandParameter pmismatch("mismatch", "Number", "", "-1.0", "", "", "","",false,false); parameters.push_back(pmismatch);
                CommandParameter pgapopen("gapopen", "Number", "", "-2.0", "", "", "","",false,false); parameters.push_back(pgapopen);
                CommandParameter pgapextend("gapextend", "Number", "", "-1.0", "", "", "","",false,false); parameters.push_back(pgapextend);
-        CommandParameter pthreshold("insert", "Number", "", "25", "", "", "","",false,false); parameters.push_back(pthreshold);
+        CommandParameter pthreshold("insert", "Number", "", "20", "", "", "","",false,false); parameters.push_back(pthreshold);
         CommandParameter pdeltaq("deltaq", "Number", "", "6", "", "", "","",false,false); parameters.push_back(pdeltaq);
                CommandParameter pprocessors("processors", "Number", "", "1", "", "", "","",false,false,true); parameters.push_back(pprocessors);
         CommandParameter pformat("format", "Multiple", "sanger-illumina-solexa-illumina1.8+", "illumina1.8+", "", "", "","",false,false,true); parameters.push_back(pformat);
@@ -70,7 +70,7 @@ string MakeContigsCommand::getHelpString(){
         helpString += "The deltaq parameter allows you to specify the delta allowed between quality scores of a mismatched base.  For example in the overlap, if deltaq=5 and in the alignment seqA, pos 200 has a quality score of 30 and the same position in seqB has a quality score of 20, you take the base from seqA (30-20 >= 5).  If the quality score in seqB is 28 then the base in the consensus will be an N (30-28<5) The default is 6.\n";
                helpString += "The gapopen parameter allows you to specify the penalty for opening a gap in an alignment. The default is -2.0.\n";
                helpString += "The gapextend parameter allows you to specify the penalty for extending a gap in an alignment.  The default is -1.0.\n";
-        helpString += "The insert parameter allows you to set a quality scores threshold. In the case where we are trying to decide whether to keep a base or remove it because the base is compared to a gap in the other fragment, if the base has a quality score below the threshold we eliminate it. Default=25.\n";
+        helpString += "The insert parameter allows you to set a quality scores threshold. In the case where we are trying to decide whether to keep a base or remove it because the base is compared to a gap in the other fragment, if the base has a quality score equal to or below the threshold we eliminate it. Default=20.\n";
         helpString += "The processors parameter allows you to specify how many processors you would like to use.  The default is 1. \n";
         helpString += "The allfiles parameter will create separate group and fasta file for each grouping. The default is F.\n";
         helpString += "The trimoverlap parameter allows you to trim the sequences to only the overlapping section. The default is F.\n";
@@ -287,7 +287,7 @@ MakeContigsCommand::MakeContigsCommand(string option)  {
                        m->mothurConvert(temp, gapExtend); 
             if (gapExtend > 0) { m->mothurOut("[ERROR]: gapextend must be negative.\n"); abort=true; }
                        
-            temp = validParameter.validFile(parameters, "insert", false);      if (temp == "not found"){       temp = "25";                    }
+            temp = validParameter.validFile(parameters, "insert", false);      if (temp == "not found"){       temp = "20";                    }
                        m->mothurConvert(temp, insert); 
             if ((insert < 0) || (insert > 40)) { m->mothurOut("[ERROR]: insert must be between 0 and 40.\n"); abort=true; }
 
@@ -961,12 +961,12 @@ int MakeContigsCommand::driver(vector<string> files, string outputFasta, string
                     contig += seq1[i];
                 }else if (((seq1[i] == '.') || (seq1[i] == '-')) && ((seq2[i] != '-') && (seq2[i] != '.'))) { //seq1 is a gap and seq2 is a base, choose seq2, unless quality score for base is below insert. In that case eliminate base
                     if (thisfqualfile != "") {
-                        if (scores2[BBaseMap[i]] < insert) { } //
+                        if (scores2[BBaseMap[i]] <= insert) { } //
                         else { contig += seq2[i];  }
                     }else { contig += seq2[i]; } //with no quality info, then we keep it?
                 }else if (((seq2[i] == '.') || (seq2[i] == '-')) && ((seq1[i] != '-') && (seq1[i] != '.'))) { //seq2 is a gap and seq1 is a base, choose seq1, unless quality score for base is below insert. In that case eliminate base
                     if (thisfqualfile != "") {
-                        if (scores1[ABaseMap[i]] < insert) { } //
+                        if (scores1[ABaseMap[i]] <= insert) { } //
                         else { contig += seq1[i];  }
                     }else { contig += seq1[i]; } //with no quality info, then we keep it?
                 }else if (((seq1[i] != '-') && (seq1[i] != '.')) && ((seq2[i] != '-') && (seq2[i] != '.'))) { //both bases choose one with better quality
index 00897dcfee5881be8dfd37d00bbbe705a3d034f3..2bd7054afc33c4f0600683a1b8ebe50a2fd338c4 100644 (file)
@@ -666,7 +666,7 @@ int SeqErrorCommand::createProcesses(string filename, string qFileName, string r
                        int misMatchSize;
                        in >> misMatchSize; m->gobble(in);
                        if (misMatchSize > misMatchCounts.size()) {     misMatchCounts.resize(misMatchSize, 0); }
-                       for (int j = 0; j < misMatchCounts.size(); j++) {
+                       for (int j = 0; j < misMatchSize; j++) {
                                in >> tempNum; misMatchCounts[j] += tempNum;
                        }
                        m->gobble(in);
index 224ecb10cb1529db7d6bdb10c268be047dae5834..4c631a23451d4d9723aec3a29bed423737b243ba 100644 (file)
@@ -772,6 +772,8 @@ void Sequence::trim(int length){
        if(numBases > length){
                unaligned = unaligned.substr(0,length);
                numBases = length;
+        aligned = "";
+        isAligned = 0;
        }
        
 }
index 7140b56c6b5866321a763675b7b4f75bd1d618e7..a103626f7dd9fbed1074f7132175651360bfe464 100644 (file)
@@ -1852,7 +1852,13 @@ bool TrimSeqsCommand::keepFirstTrim(Sequence& sequence, QualityScores& qscores){
                if(qscores.getName() != ""){
                        qscores.trimQScores(-1, keepFirst);
                }
+
+//        sequence.printSequence(cout);cout << endl;
+        
                sequence.trim(keepFirst);
+        
+//        sequence.printSequence(cout);cout << endl << endl;;
+
                return success;
        }
        catch(exception& e) {