Revert the MQ of reads that were modified by IndelRealigner
IndelRealigner systematically adds +10 to the MQ of the reads it realigns. In some cases, that brings the resulting MQ to a value higher than MQ 60, which is the normal cap for MQ values. Since many downstream tools assume that MQ is <= 60, this may potentially cause problems.
This read filter makes it possible to revert the MQ values of all the reads touched by IndelRealigner. It works by subtracting 10 from the MQ of all reads that have an "OC" tag, which stands for "original CIGAR" and is added by IndelRealigner to any read that it realigns.
java -jar GenomeAnalysisTk.jar \ -T ToolName \ -R reference.fasta \ -I input.bam \ -o output.file \ -rf ReassignOriginalMQAfterIndelRealignmentFilter
There is currently no way to tell programmatically that a file has already been processed with this filter, so you should check the header manually before running this tool. Running it multiple times on the same BAM file would levy an unjustified penalty on realigned reads.