]> git.donarmstrong.com Git - mothur.git/blobdiff - chimeraslayercommand.cpp
minor bug in chimera maligner
[mothur.git] / chimeraslayercommand.cpp
index cf082f87a2721650d50ffed24c4a0a55a3ffa469..9b49a4f3b4fdad3b1468abbbe512067b25c6c023 100644 (file)
@@ -635,7 +635,7 @@ int ChimeraSlayerCommand::driver(linePair* filePos, string outputFName, string f
                
                        Sequence* candidateSeq = new Sequence(inFASTA);  m->gobble(inFASTA);
                        string candidateAligned = candidateSeq->getAligned();
-                               
+                       
                        if (candidateSeq->getName() != "") { //incase there is a commented sequence at the end of a file
                                
                                if (candidateSeq->getAligned().length() != templateSeqsLength) {  
@@ -698,15 +698,16 @@ int ChimeraSlayerCommand::driver(linePair* filePos, string outputFName, string f
                                }
                                count++;
                        }
-                       delete candidateSeq;
                        
                        #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
                                unsigned long int pos = inFASTA.tellg();
+                       //cout << candidateSeq->getName() << '\t' << pos << endl;
                                if ((pos == -1) || (pos >= filePos->end)) { break; }
                        #else
                                if (inFASTA.eof()) { break; }
                        #endif
                        
+                       delete candidateSeq;
                        //report progress
                        if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
                }