Browsing mappings for multiple BAM files
2
0
Entering edit mode
3.5 years ago
gokberk ▴ 70

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 • 756 views
ADD COMMENT
1
Entering edit mode

You can extract the mapped reads on a given region using samtools : Extract Reads From A Bam File That Fall Within A Given Region

ADD REPLY
2
Entering edit mode
3.5 years ago
find DIR1 DIR2 -type f -name "*.bam" | while read B; do echo -n "${B} " && samtools view -c ${B} "chr11:456-789" ; done
ADD COMMENT
0
Entering edit mode

It worked perfectly, thanks a lot!

ADD REPLY
2
Entering edit mode
3.5 years ago
Zee ▴ 40

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.

ADD COMMENT

Login before adding your answer.

Traffic: 830 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6