This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Browsing mappings for multiple BAM files

Hi all,

Thanks to helps of Biostars community, I managed to map SOLiD RNA-seq reads to a macaque genome assembly (macFas5). Now, I have 251 bam and bam.bai files to look into. I want to see whether there are any reads that map to a certain region on chromosome 11 and I have to do it for all bam files I have. So, I was wondering if there is a more practical way to check this than zooming into the same region in each bam file using IGV.

Thanks in advance.

rna-seq

2 answers

find DIR1 DIR2 -type f -name "*.bam" | while read B; do echo -n "${B} " && samtools view -c ${B} "chr11:456-789" ; done

It worked perfectly, thanks a lot!

You can use bedtools' multicov https://bedtools.readthedocs.io/en/latest/content/tools/multicov.html to do this pretty easily

bedtools multicov

Ensure that all your bam files are sorted and indexed.

Log in to answer this question.