How to calculate number of fragment and its coverage from BAM file?
1
0
Entering edit mode
4.1 years ago
star ▴ 350

I have a bam file like, It is the Paired-End sequenced data with the length 50 bp. I would like to count the number of the fragment (e.g: chromosome,start-read1,end-read2) and its coverage. I have used Bamtobed and Genomecoverage, but I am confused about which one gives me the correct number.

Many thanks in advance!

Based on BamtoBed tool -bedpe:

1       785101  785152  1       785152  785203  4
1       824806  824855  1       824932  824983  3
1       932573  932617  1       932652  932701  1

Based on GenomeCoverage:

1       785101  785203  4
1       824806  824855  3
1       824932  824983  3
1       932573  932617  1
1       932652  932701  1
rna-seq genome bedtools alignment • 1.3k views
ADD COMMENT
2
Entering edit mode
4.1 years ago
ATpoint 85k

genomecov is the way to go. You have to decide whether you want to count only the parts of the genome that actually have been sequenced (that would be the default behaviour) or to include the insert size between the pairs as well using the -pc option. In the latter case all bases between start of read1 and end of read2 would be included into the coverage for that fragment. That will give you a bedgraph (-bg) that indicates genome-wide coverage for your experiment.

ADD COMMENT
0
Entering edit mode

Thanks, ATpoint. I have checked genomecov with -bg -pc and it is similar to bamtobed outputs. But I will go for genomecov as it sums up overlap regions :

The output of bamtobed:

1       785101  785152  1       785152  785203  4
1       824806  824855  1       824932  824983  3
1       932573  932617  1       932652  932701  1
1       947595  947646  1       947664  947715  11
1       966712  966763  1       966828  966876  7
1       1146938 1146989 1       1147130 1147181 16
1       1237055 1237103 1       1237215 1237265 9
1       1237055 1237103 1       1237215 1237266 1
1       1303125 1303176 1       1303311 1303358 24

The genomecov:

1       785101  785203  4
1       824806  824983  3
1       932573  932701  1
 1       947595  947715  11
1       966712  966876  7
1       1146938 1147181 16
1       1237055 1237266 10
1       1303125 1303358 24
ADD REPLY

Login before adding your answer.

Traffic: 2419 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