I want to be able to extract, from BAM files, the reads that, for a given position, contain the variant (and conversely but separately, the ones that contain the reference). I've played around with various tools and searched the tubes, without finding any convenient way to do this. It doesn't seem like too odd a task to perform, so maybe my google fu is just failing me here.
Are you looking for all reads containing some variant at, say, chr1:1000 or instead all those that contain a variant in base 20 of their alignment? I assume the former, which is much quicker to do, but figured I'd ask.
The former, if I understand you correctly. I have a specific variant and I want to examine the reads that support that variant and compare to the reads that instead show the reference allele at the same position.