From 7d072eaea23af798162774c79c97dbf4c25ad687 Mon Sep 17 00:00:00 2001 From: pschloss Date: Fri, 11 Feb 2011 22:10:56 +0000 Subject: [PATCH] mod to seq.error to allow for degenerate bases in the ref sequences --- seqerrorcommand.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/seqerrorcommand.cpp b/seqerrorcommand.cpp index b31c4e0..af044fe 100644 --- a/seqerrorcommand.cpp +++ b/seqerrorcommand.cpp @@ -417,20 +417,22 @@ void SeqErrorCommand::getReferences(){ ifstream referenceFile; m->openInputFile(referenceFileName, referenceFile); + int numAmbigSeqs = 0; + while(referenceFile){ Sequence currentSeq(referenceFile); int numAmbigs = currentSeq.getAmbigBases(); - - if(numAmbigs != 0){ - m->mothurOut("Warning: " + toString(currentSeq.getName()) + " has " + toString(numAmbigs) + " ambiguous bases, these bases will be removed\n"); - currentSeq.removeAmbigBases(); - } + if(numAmbigs > 0){ numAmbigSeqs++; } referenceSeqs.push_back(currentSeq); m->gobble(referenceFile); } - numRefs = referenceSeqs.size(); - referenceFile.close(); + + if(numAmbigSeqs != 0){ + m->mothurOut("Warning: " + toString(numAmbigSeqs) + " reference sequences have ambiguous bases, these bases will be ignored\n"); + } + + numRefs = referenceSeqs.size(); } catch(exception& e) { m->errorOut(e, "SeqErrorCommand", "getReferences"); @@ -454,7 +456,7 @@ Compare SeqErrorCommand::getErrors(Sequence query, Sequence reference){ Compare errors; for(int i=0;i