Hi all,
I am trying to count the number of reads (or alignments) for specific genomic locations in a bam file. I don't want reads with skipped region from the reference. I am using samtools and awk to do it now, but I hope to do it quicker.
samtools view input.bam chr10:18000-20000 | awk '($6 !~ /[N*]/)' | wc -l
Is there a way to make this process faster?
Instead of run samtools+awk for every location, should I just go through the bam files once? Would the alternative be faster?
Thanks, Woody