Samtools Depth Option For More Than One Bam Files
1
1
Entering edit mode
10.1 years ago
Maria333 ▴ 20

Hi everyone,

I've been stuck on this for several days. I want to use the samtools depth command but not only for a single bam file. I need to find a way to include all my bam files downloaded in the command.

Has anyone got an idea of how i can do this??

Thank you in advance, Maria

samtools • 7.6k views
ADD COMMENT
3
Entering edit mode
10.1 years ago

The usage says that you can link multiple files, make sure the specify the options before the bam files

Usage: samtools depth [options] in1.bam [in2.bam [...]]
Options:
   -b <bed>            list of positions or regions
   -f <list>           list of input BAM filenames, one per line [null]
   -l <int>            minQLen
   -q <int>            base quality threshold
   -Q <int>            mapping quality threshold
   -r <chr:from-to>    region
ADD COMMENT
1
Entering edit mode

Be warned though, samtools depth (at least as of version 1.1-30-g7f47a7c) doesn't combine the depth info across bam files for samples (same SM tag) occurring in multiple files.
I expected it to output one column per sample since most other commands work that way, but instead it outputs one column per bam file.

ADD REPLY
0
Entering edit mode

Hey, If my command is :

samtools depth -a -f list.txt > all.depth

and list.txt looks like this:

F1.bam
F2.bam
...
F10.bam

Is samtools output in the same order?

I mean is the third column F1.bam, the fourth F2.bam, and so on?

enter image description here

ADD REPLY

Login before adding your answer.

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