Hi, I am trying to do indel realignment using the GATK tool IndelRealigner. I did my alignment using bwa mem with the -M command for alternative alignments. When I go to use GATK IndelRealigner it removes all of my reads that have the potential to have secondary alignments even if the secondary alignment score is low. Everything that I have read says to align with secondary alignments kept before going into GATK, but if I do this then 95-98% of my reads are removed when performing the IndelRealigner step. I have tried the --filter_bases_not_stored, -rf NotPrimaryAlignment and still get 95-98% of my reads removed. Any input would be appreciated. Thanks
That's extremely unusual. Are you sure that those many reads are of secondary alignments? Check using
GATK applies these filters in IndelRealigner by default. Check if they are filtered out due to that
Note that indel realignment is no longer necessary for variant discovery if you plan to use a variant caller that performs a haplotype assembly step, such as HaplotypeCaller or MuTect2. However it is still required when using legacy callers such as UnifiedGenotyper or the original MuTect.