inFASTA.seekg(pDataArray->start-1); pDataArray->m->gobble(inFASTA);
}
- pDataArray->count = pDataArray->end;
-
AlignmentDB* templateDB = new AlignmentDB(pDataArray->templateFileName, pDataArray->search, pDataArray->kmerSize, pDataArray->gapOpen, pDataArray->gapExtend, pDataArray->match, pDataArray->misMatch, pDataArray->threadID);
//moved this into driver to avoid deep copies in windows paralellized version
alignment = new NeedlemanOverlap(pDataArray->gapOpen, pDataArray->match, pDataArray->misMatch, longestBase);
}
- int count = 0;
+ pDataArray->count = 0;
for(int i = 0; i < pDataArray->end; i++){ //end is the number of sequences to process
if (pDataArray->m->control_pressed) { break; }
}
Sequence temp = templateDB->findClosestSequence(candidateSeq);
- Sequence* templateSeq = &temp;
+ Sequence* templateSeq = new Sequence(temp.getName(), temp.getAligned());
float searchScore = templateDB->getSearchScore();
//rerun alignment
Sequence temp2 = templateDB->findClosestSequence(copy);
- Sequence* templateSeq2 = &temp2;
+ Sequence* templateSeq2 = new Sequence(temp2.getName(), temp2.getAligned());
searchScore = templateDB->getSearchScore();
//check if any better
if (copy->getNumBases() > candidateSeq->getNumBases()) {
candidateSeq->setAligned(copy->getAligned()); //use reverse compliments alignment since its better
- templateSeq = templateSeq2;
+ delete templateSeq;
+ templateSeq = templateSeq2;
delete nast;
nast = nast2;
needToDeleteCopy = true;
}else{
wasBetter = "\treverse complement did NOT produce a better alignment so it was not used, please check sequence.";
delete nast2;
+ delete templateSeq2;
delete copy;
}
}
report.print();
delete nast;
+ delete templateSeq;
if (needToDeleteCopy) { delete copy; }
- count++;
+ pDataArray->count++;
}
delete candidateSeq;
//report progress
- if((count) % 100 == 0){ pDataArray->m->mothurOut(toString(count)); pDataArray->m->mothurOutEndLine(); }
+ if((pDataArray->count) % 100 == 0){ pDataArray->m->mothurOutJustToScreen(toString(pDataArray->count)+"\n"); }
}
//report progress
- if((count) % 100 != 0){ pDataArray->m->mothurOut(toString(count)); pDataArray->m->mothurOutEndLine(); }
+ if((pDataArray->count) % 100 != 0){ pDataArray->m->mothurOutJustToScreen(toString(pDataArray->count)+"\n"); }
delete alignment;
delete templateDB;