]> git.donarmstrong.com Git - mothur.git/commitdiff
finished the chimera.slayer split function
authorwestcott <westcott>
Tue, 15 Feb 2011 17:47:03 +0000 (17:47 +0000)
committerwestcott <westcott>
Tue, 15 Feb 2011 17:47:03 +0000 (17:47 +0000)
chimeraslayer.cpp
chimeraslayercommand.cpp

index eae6acf4e20b717d5327722ec22085fa96ecc0af..eb00b59a324e5ef93850fa2a0aa16e1a0216a9dc 100644 (file)
@@ -510,15 +510,15 @@ Sequence* ChimeraSlayer::print(ostream& out, ostream& outAcc, data_results leftP
                                                        for (int i = (rightPiece.spotMap[rightPiece.results[0].winLStart]-1); i < newAligned.length(); i++) { newAligned[i] = '.'; }
                                                }else { //both sides are chimeric, keep longest piece
                                                        
-                                                       int lengthLeftLeft = leftPiece.spotMap[leftPiece.results[0].winLStart] - leftPiece.spotMap[leftPiece.results[0].winLEnd];
-                                                       int lengthLeftRight = leftPiece.spotMap[leftPiece.results[0].winRStart] - leftPiece.spotMap[leftPiece.results[0].winREnd];
+                                                       int lengthLeftLeft = leftPiece.spotMap[leftPiece.results[0].winLEnd] - leftPiece.spotMap[leftPiece.results[0].winLStart];
+                                                       int lengthLeftRight = leftPiece.spotMap[leftPiece.results[0].winREnd] - leftPiece.spotMap[leftPiece.results[0].winRStart];
                                                        
                                                        int longest = 1; // leftleft = 1, leftright = 2, rightleft = 3 rightright = 4
                                                        int length = lengthLeftLeft;
                                                        if (lengthLeftLeft < lengthLeftRight) { longest = 2;  length = lengthLeftRight; }
                                                        
-                                                       int lengthRightLeft = rightPiece.spotMap[rightPiece.results[0].winLStart] - rightPiece.spotMap[rightPiece.results[0].winLEnd];
-                                                       int lengthRightRight = rightPiece.spotMap[rightPiece.results[0].winRStart] - rightPiece.spotMap[rightPiece.results[0].winREnd];
+                                                       int lengthRightLeft = rightPiece.spotMap[rightPiece.results[0].winLEnd] - rightPiece.spotMap[rightPiece.results[0].winLStart];
+                                                       int lengthRightRight = rightPiece.spotMap[rightPiece.results[0].winREnd] - rightPiece.spotMap[rightPiece.results[0].winRStart];
                                                        
                                                        if (lengthRightLeft > length) { longest = 3; length = lengthRightLeft;  }
                                                        if (lengthRightRight > length) { longest = 4; }
@@ -626,15 +626,15 @@ Sequence* ChimeraSlayer::print(MPI_File& out, MPI_File& outAcc, data_results lef
                                                        for (int i = (rightPiece.spotMap[rightPiece.results[0].winLStart]-1); i < newAligned.length(); i++) { newAligned[i] = '.'; }
                                                }else { //both sides are chimeric, keep longest piece
                                                        
-                                                       int lengthLeftLeft = leftPiece.spotMap[leftPiece.results[0].winLStart] - leftPiece.spotMap[leftPiece.results[0].winLEnd];
-                                                       int lengthLeftRight = leftPiece.spotMap[leftPiece.results[0].winRStart] - leftPiece.spotMap[leftPiece.results[0].winREnd];
+                                                       int lengthLeftLeft = leftPiece.spotMap[leftPiece.results[0].winLEnd] - leftPiece.spotMap[leftPiece.results[0].winLStart];
+                                                       int lengthLeftRight = leftPiece.spotMap[leftPiece.results[0].winREnd] - leftPiece.spotMap[leftPiece.results[0].winRStart];
                                                        
                                                        int longest = 1; // leftleft = 1, leftright = 2, rightleft = 3 rightright = 4
                                                        int length = lengthLeftLeft;
                                                        if (lengthLeftLeft < lengthLeftRight) { longest = 2;  length = lengthLeftRight; }
                                                        
-                                                       int lengthRightLeft = rightPiece.spotMap[rightPiece.results[0].winLStart] - rightPiece.spotMap[rightPiece.results[0].winLEnd];
-                                                       int lengthRightRight = rightPiece.spotMap[rightPiece.results[0].winRStart] - rightPiece.spotMap[rightPiece.results[0].winREnd];
+                                                       int lengthRightLeft = rightPiece.spotMap[rightPiece.results[0].winLEnd] - rightPiece.spotMap[rightPiece.results[0].winLStart];
+                                                       int lengthRightRight = rightPiece.spotMap[rightPiece.results[0].winREnd] - rightPiece.spotMap[rightPiece.results[0].winRStart];
                                                        
                                                        if (lengthRightLeft > length) { longest = 3; length = lengthRightLeft;  }
                                                        if (lengthRightRight > length) { longest = 4; }
index 0e07ffcdf13ea64e963477df3da5ebd8b26a38e6..a331908c1ddb09609d469ceb186ce659f1e21f08 100644 (file)
@@ -14,7 +14,7 @@
 //**********************************************************************************************************************
 vector<string> ChimeraSlayerCommand::getValidParameters(){     
        try {
-               string AlignArray[] =  {"fasta", "processors","trim","trimera", "name","window", "include","template","numwanted", "ksize", "match","mismatch", 
+               string AlignArray[] =  {"fasta", "processors","trim","split", "name","window", "include","template","numwanted", "ksize", "match","mismatch", 
                        "divergence", "minsim","mincov","minbs", "minsnp","parents", "iters","outputdir","inputdir", "search","realign" };
                vector<string> myArray (AlignArray, AlignArray+(sizeof(AlignArray)/sizeof(string)));
                return myArray;
@@ -71,7 +71,7 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option)  {
                
                else {
                        //valid paramters for this command
-                       string Array[] =  {"fasta", "processors","name", "include","trim", "trimera","window", "template","numwanted", "ksize", "match","mismatch", 
+                       string Array[] =  {"fasta", "processors","name", "include","trim", "split","window", "template","numwanted", "ksize", "match","mismatch", 
                        "divergence", "minsim","mincov","minbs", "minsnp","parents", "iters","outputdir","inputdir", "search","realign" };
                        vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
                        
@@ -273,7 +273,7 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option)  {
                        temp = validParameter.validFile(parameters, "trim", false);                             if (temp == "not found") { temp = "f"; }
                        trim = m->isTrue(temp); 
                        
-                       temp = validParameter.validFile(parameters, "trimera", false);                          if (temp == "not found") { temp = "f"; }
+                       temp = validParameter.validFile(parameters, "split", false);                            if (temp == "not found") { temp = "f"; }
                        trimera = m->isTrue(temp); 
                        
                        search = validParameter.validFile(parameters, "search", false);                 if (search == "not found") { search = "distance"; }
@@ -312,7 +312,7 @@ void ChimeraSlayerCommand::help(){
                m->mothurOut("When using MPI, the processors parameter is set to the number of MPI processes running. \n");
                #endif
                m->mothurOut("The trim parameter allows you to output a new fasta file containing your sequences with the chimeric ones trimmed to include only their longest piece, default=F. \n");
-               m->mothurOut("The trimera parameter allows you to check both peices of non-chimeric sequence for chimeras, thus looking for trimeras and quadmeras. default=F. \n");
+               m->mothurOut("The split parameter allows you to check both pieces of non-chimeric sequence for chimeras, thus looking for trimeras and quadmeras. default=F. \n");
                m->mothurOut("The window parameter allows you to specify the window size for searching for chimeras, default=50. \n");
                m->mothurOut("The increment parameter allows you to specify how far you move each window while finding chimeric sequences, default=5.\n");
                m->mothurOut("The numwanted parameter allows you to specify how many sequences you would each query sequence compared with, default=15.\n");