Question: determining read depth for every position in a sequence
0
gravatar for blur
2.4 years ago by
blur90
European Union
blur90 wrote:

I am trying to create a table for a specific sequence, about 1900bp long and have for each nucleotide the read depth achieved by sequencing. I saw you can check read depth by:

samtools view file.bam chr 1:100-500 | wc

but that would require 1900 commands (not good...) I am sure that there is a smarter way to do this - can anyone offer any help? Thanks!

samtools rna read depth • 933 views
ADD COMMENTlink modified 2.4 years ago by Ron910 • written 2.4 years ago by blur90
1
gravatar for Medhat
2.4 years ago by
Medhat8.2k
Texas
Medhat8.2k wrote:

you should use genomeCoverageBed from bedtools

bedtools genomecov computes histograms (default), per-base reports (-d) and BEDGRAPH (-bg) summaries of feature coverage (e.g., aligned sequences) for a given genome.

that is I think exactly what you need

ADD COMMENTlink modified 2.4 years ago • written 2.4 years ago by Medhat8.2k
1
gravatar for Ron
2.4 years ago by
Ron910
United States
Ron910 wrote:

From samtools:

samtools depth input.bam >input.coverage

Refer to this post:

How to plot coverage and depth statistics of a bam file

ADD COMMENTlink written 2.4 years ago by Ron910

super! worked like a charm!

ADD REPLYlink written 2.4 years ago by blur90
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: 1629 users visited in the last hour