Question: Calculating number of reads in a specific region from sam file
0
gravatar for ag1194
3.2 years ago by
ag11940
ag11940 wrote:

Hi,

Hi I have a mapped sequencing data in sam format (RNA). I want to calculate number of reads are on one region (let's say exon 10), then number of gene are on another region (lets say exon 11), then compare these two read number for each gene.

So basically I have a table who contains two region for each gene, and I want to calculate reads on each region to compare.

Is there any tool I can do such calculation?

Thanks a lot!

-A

sequencing rna-seq • 1.5k views
ADD COMMENTlink modified 3.2 years ago by geek_y10k • written 3.2 years ago by ag11940

Hi,

You can use HTseq count tool for getting the number of reads assigned to genes or exons.

Refer this link (http://www-huber.embl.de/HTSeq/doc/overview.html)

ADD REPLYlink written 3.2 years ago by bioinforesearchquestions270

I want to check the reads falls into specific region though. Not a defined exon.

ADD REPLYlink written 3.2 years ago by ag11940

bedtools coverage with a -d option should report that

ADD REPLYlink written 3.2 years ago by microfuge1.4k

great, let me check. Thanks!

ADD REPLYlink written 3.2 years ago by ag11940

Goutham's answer seems most appropriate. Bedtools will give the depth and not the number of reads. I commented too soon.

ADD REPLYlink written 3.2 years ago by microfuge1.4k

If your comfortable with python pysam will let you do this pretty eaily

ADD REPLYlink written 3.2 years ago by vakul.mohanty240
3
gravatar for geek_y
3.2 years ago by
geek_y10k
Barcelona
geek_y10k wrote:

Use featureCounts.

Make an SAF file with regions of interest.

GeneID  Chr Start   End Strand
497097  chr1    3204563 3207049 -
497097  chr1    3411783 3411982 -
497097  chr1    3660633 3661579 -

.

featureCounts -F SAF -T <int> -a regions.saf -o counts.txt <in.bam>

You could also count paired-end reads as one fragment using -p

ADD COMMENTlink modified 3.2 years ago • written 3.2 years ago by geek_y10k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 868 users visited in the last hour