Entering edit mode
3.4 years ago
lz1903
▴
10
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!
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 interestPlease use the formatting bar (especially the
code
option) to present your post better. You can use backticks for inline code (`text` becomestext
), 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.Thanks Ram. Will do that next time.