Question: Calculating Depth From A List Of Bam Files
0
gravatar for Maria333
5.4 years ago by
Maria33310
European Union
Maria33310 wrote:

Hi everyone,

Since I am very new to Linux I would really appreciate a bit of help. I am using samtools depth to calculate the depth from a list of bam files i have already downloaded. Even though I get the outputs, I get zeros only when calculating the depth which is not normal. This means all my samples have no deletions, duplications or any other problems. Can anyone think of what the problem might be?

Thank you in advance

samtools • 2.7k views
ADD COMMENTlink modified 5.4 years ago by Devon Ryan91k • written 5.4 years ago by Maria33310
3

You could also try using the genomecov tool in BEDtools:

bedtools genomecov -d -ibam your_file.bam > output.txt

ADD REPLYlink modified 5.4 years ago • written 5.4 years ago by Neil Pearson30
1

Could you give an example of the command you're using and the output you're receiving?

ADD REPLYlink written 5.4 years ago by Devon Ryan91k

Thank you for your reply. Basically it's not just a command, I have written a script in R and connect that to Linux. But the final command is: samtools depth -b $region -f bamlist > depth.txt

The ouput I'm receiving has all the samples as the first row and underneath there are columns full of zeros instead of 1 or 2 etc.

ADD REPLYlink written 5.4 years ago by Maria33310

Do you receive the same results if you do that directly from the command line? Does this occur for all regions and what do things look like if you just open the files in IGV and look at one of the regions?

ADD REPLYlink written 5.4 years ago by Devon Ryan91k

I run everything on the shell anyway but I am only using one region. The option "$region" is because I have specified the region before in the script i.e region="..". Also I am not using IGV for now.

ADD REPLYlink written 5.4 years ago by Maria33310

Right, have a look at that region in IGV or some other viewer (or even samtools view -c somefile.bam region) to see if this is reasonable output or not. You haven't given us enough information to be able to determine if this is the correct result or not.

ADD REPLYlink written 5.4 years ago by Devon Ryan91k

I will do that, thank you very much for your replies anyway!

ADD REPLYlink written 5.4 years ago by Maria33310
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: 529 users visited in the last hour