Hello Everyone,
I am trying to count reads mapping to introns in my RNA-Seq data. I have used the bedtools multicov to count the alignments in the indexed BAM file. Below are the command line that I have used. However, when I visualize the aligned reads using IGV, I have noticed that the program is only counting reads mapped to the boundary exons and not intronic reads. I have also tried – f to ensure a minimum of 10% read overlap within an intron but get same resuts. I am very new to using these tools. Any ideas on why it is counting boundary exon reads and any suggestions on tools to just count reads within an intron will be very helpful.
bedtools intersect -abam test.sorted.bam -b intron.bed -split >intron.bam
samtools sort intron.bam intron.sorted
samtools index intron.sorted.bam
bedtools multicov -bams intron.sorted.bam -bed intron.bed
Thanks,
Rajiv
VarunRegardsThanks for all the help.Nothing for chrI.Should be 6 since the intron feature is on +ve strand. What am I missing here??Of course I am using it as bam and not bed and then I use coverage bed with -s optionThis command gives me this outputHi Ariel,Thanks for your reply. Also I want to count the reads in my introns to be in strand specific way.
bedtools intersect -u -split -f 0.5 -a SRR1029143_Aligned.sortedByCoord.out.bam -b known_yeast_introns.bed -bed | head
chrI 87396 87446 SRR1029143.505365 255 - 87396 87446 0,0,0 1 50, 0,
chrI 87418 87467 SRR1029143.10559369 255 + 87418 87467 0,0,0 1 49, 0,
chrI 87456 87506 SRR1029143.3390263 255 + 87456 87506 0,0,0 1 50, 0,
chrI 87458 87507 SRR1029143.9988740 255 + 87458 87507 0,0,0 1 49, 0,
chrI 87462 87512 SRR1029143.7233972 255 - 87462 87512 0,0,0 1 50, 0,
chrI 87463 87512 SRR1029143.158693 255 + 87463 87512 0,0,0 1 49, 0,
chrI 87468 87518 SRR1029143.7312705 255 + 87468 87518 0,0,0 1 50, 0,
chrI 87472 87521 SRR1029143.4940539 255 + 87472 87521 0,0,0 1 49, 0,
bedtools intersect -u -split -f 0.5 -a SRR1029143_Aligned.sortedByCoord.out.bam -b known_yeast_introns.bed |bedtools coverage -s -a known_yeast_introns.bed -b stdin | head
chrI 87387 87500 + 0 0 113 0.0000000
chrI 139187 139218 + 0 0 31 0.0000000
chrI 142253 142619 + 0 0 366 0.0000000