]> git.donarmstrong.com Git - mothur.git/commitdiff
fixed problem with chimera.slayer realigner
authorwestcott <westcott>
Fri, 18 Jun 2010 11:37:36 +0000 (11:37 +0000)
committerwestcott <westcott>
Fri, 18 Jun 2010 11:37:36 +0000 (11:37 +0000)
chimerarealigner.cpp
makefile
nast.cpp

index 9a25162bd60fcd35b25c18073947f1a8f6502673..a07e43392a1d96727d4870154bccef452119755b 100644 (file)
@@ -34,9 +34,9 @@ void ChimeraReAligner::reAlign(Sequence* query, vector<results> parents) {
 
                        //take query and break apart into pieces using breakpoints given by results of parents
                        for (int i = 0; i < parents.size(); i++) {
-                       
                                int length = parents[i].nastRegionEnd - parents[i].nastRegionStart+1;
                                string q = qAligned.substr(parents[i].nastRegionStart, length);
+       
                                Sequence* queryFrag = new Sequence(query->getName(), q);
 
                                queryParts.push_back(queryFrag);
@@ -55,10 +55,13 @@ void ChimeraReAligner::reAlign(Sequence* query, vector<results> parents) {
 
                        //align each peice to correct parent from results
                        for (int i = 0; i < queryParts.size(); i++) {
-                               alignment = new NeedlemanOverlap(-2.0, match, misMatch, longest+1); //default gapopen, match, mismatch, longestbase
+                               if ((queryParts[i]->getUnaligned() == "") || (parentParts[i]->getUnaligned() == "")) {;}
+                               else {
+                                       alignment = new NeedlemanOverlap(-2.0, match, misMatch, longest+1); //default gapopen, match, mismatch, longestbase
                                
-                               Nast nast(alignment, queryParts[i], parentParts[i]);
-                               delete alignment;
+                                       Nast nast(alignment, queryParts[i], parentParts[i]);
+                                       delete alignment;
+                               }
                        }
 
                        //recombine pieces to form new query sequence
@@ -78,7 +81,7 @@ void ChimeraReAligner::reAlign(Sequence* query, vector<results> parents) {
                        
                        //make sure you don't cutoff end of query 
                        if (parents[parents.size()-1].nastRegionEnd < (qAligned.length()-1)) {  newQuery += qAligned.substr(parents[parents.size()-1].nastRegionEnd+1);  }
-               
+                       
                        //set query to new aligned string
                        query->setAligned(newQuery);
 
index ef5cfe7ebb9550c5b5fa275e128f1ff013585e33..3e831124a7cc7a026dcad63df44da4a0674d186b 100644 (file)
--- a/makefile
+++ b/makefile
@@ -463,7 +463,7 @@ mothur : \
                ./logsd.o\\r
                ./geom.o\\r
                ./setlogfilecommand.o\\r
-               -o mothur\r
+               -o ../Release/mothur\r
 \r
 clean : \r
                rm \\r
index 50d3b2440f3a2523257d20faabba51098b345cd4..9e26b11a7708590389f59b1c82e76ebca72f1bc1 100644 (file)
--- a/nast.cpp
+++ b/nast.cpp
@@ -38,13 +38,12 @@ Nast::Nast(Alignment* method, Sequence* cand, Sequence* temp) : alignment(method
 
 void Nast::pairwiseAlignSeqs(){        //      Here we call one of the pairwise alignment methods to align our unaligned candidate
                                                                //      and template sequences
-       try {
-
+       try {   
                alignment->align(candidateSeq->getUnaligned(), templateSeq->getUnaligned());
 
                string candAln = alignment->getSeqAAln();
                string tempAln = alignment->getSeqBAln();
-       
+
                if(candAln == ""){
 
                        candidateSeq->setPairwise("");
@@ -91,6 +90,11 @@ void Nast::removeExtraGaps(string& candAln, string tempAln, string newTemplateAl
 //     here we do steps C-F of Fig. 2 from DeSantis et al.
        try {
        
+               //cout << candAln << endl;
+               //cout << tempAln << endl;
+               //cout << newTemplateAlign << endl;
+               //cout << endl;
+               
                int longAlignmentLength = newTemplateAlign.length();    
        
                for(int i=0; i<longAlignmentLength; i++){                               //      use the long alignment as the standard