samtools depth -r
0
0
Entering edit mode
4 weeks ago
lz1903 • 0

Hi,

I am using samtools to compute depth at a specific region. Here is my code:

samtools depth 1.bam 2.bam 3.bam -b 1.bed 

the bed file is like this:

#chrom start end
1 1000 2000

this command output depth at each locus which is not I want.

I tried

samtools depth 1.bam 2.bam 3.bam -r 1:1000-2000 

which output same result.

I am really confused how can I output the average depth. There should be only 1 value for each bam file.

Thanks in advance!

WGS • 161 views
ADD COMMENT
0
Entering edit mode

Why don't you try to use bedtools genomecov instead? -d option, will report the coverage at every position in your BAM file. And you can also use your BED file with target regions of interest

ADD REPLY
0
Entering edit mode

Please use the formatting bar (especially the code option) to present your post better. You can use backticks for inline code (`text` becomes text), or select a chunk of text and use the highlighted button to format it as a code block. If your code has long lines with a single command, break those lines into multiple lines with proper escape sequences so they're easier to read and still run when copy-pasted. I've done it for you this time.
code_formatting

ADD REPLY
0
Entering edit mode

Thanks Ram. Will do that next time.

ADD REPLY

Login before adding your answer.

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