read filter for FLAG 0x2 in BAM file
Posted in Ask the team | Posted on 2013-01-17 18:20:24


There are 3 comments on this article. To see them or add your own, view this post on the forum


Hi, I would like to perform base quality score recalibration on only the reads that have the "properly aligned" bit (0x2) set in the FLAG column of the SAM format. Ideally, I would like to use the --read_filter argument. Below is some code that does this to my satisfaction with the PrintReads walker of GATK 2 lite. However, GATK 2 lite does not support base quality score recalibration table creation. Is there any way someone could add the code to the GATK 2 full version?

I am not sure why, but the code seems to only work with the System.out.println() line.

Thanks, Winni

/* * code written by Kiran Garimella */

package org.broadinstitute.sting.gatk.filters;

import net.sf.samtools.SAMRecord;

public class ProperPairFilter extends ReadFilter { @Override public boolean filterOut(SAMRecord samRecord) { System.out.println(samRecord.getProperPairFlag()); return !samRecord.getProperPairFlag(); } }


Return to top

There are 3 comments on this article. To see them or add your own, view this post on the forum