Minor utility improvements to ValidateBAQ

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4809 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
depristo 2010-12-09 02:19:32 +00:00
parent a63bbb2fec
commit 722819688a
1 changed files with 9 additions and 1 deletions

View File

@ -52,6 +52,9 @@ public class ValidateBAQWalker extends ReadWalker<Integer, Integer> {
@Argument(doc="Include reads without BAQ tag", required=false)
protected boolean includeReadsWithoutBAQTag = false;
@Argument(doc="x each read is processed", required=false)
protected int magnification = 1;
int counter = 0;
BAQ baqHMM = null; // matches current samtools parameters
@ -64,9 +67,14 @@ public class ValidateBAQWalker extends ReadWalker<Integer, Integer> {
IndexedFastaSequenceFile refReader = this.getToolkit().getReferenceDataSource().getReference();
if ( (readName == null || readName.equals(read.getReadName())) && read.getReadLength() <= maxReadLen && (includeReadsWithoutBAQTag || BAQ.hasBAQTag(read) ) ) {
if ( baqHMM.excludeReadFromBAQ(read) )
return 1;
byte[] baqFromTag = BAQ.calcBAQFromTag(read, false, includeReadsWithoutBAQTag);
if (counter++ % 1000 == 0 || printEachRead) out.printf("Checking read %s (%d)%n", read.getReadName(), counter);
BAQ.BAQCalculationResult baq = baqHMM.calcBAQFromHMM(read, refReader);
BAQ.BAQCalculationResult baq = null;
for ( int i = 0; i < magnification; i++ )
baq = baqHMM.calcBAQFromHMM(read, refReader);
boolean fail = false;
boolean print = false;