This is a test version of Biostars. For the public version, visit https://www.biostars.org.
what is the output of 'samtools coverage'

Hello everybody,

I wanted to calculate and generate coverage stats for my bam file and i used samtools coverage -m input.bam

This generated a histogram for each chromosome in the command line but it is a little bit hard to understand the output of it. what is the y axis of these histograms. it is shown only in percentages and how is it calculated? any help would be appreciated.

I am also wondering about how i can transfer these histograms from the bash command line into images.

Thank you so much in advance.

example

bam samtools coverage bamfiles

1 answer

http://www.htslib.org/doc/samtools-coverage.html

Coverage is defined as the percentage of positions within each bin with at least one base aligned against it.

where a 'bin' is a column in your terminal

how i can transfer these histograms from the bash command line into images.

https://unix.stackexchange.com/questions/138804/

Thank you so much. Is there a way also transfer the data that was used for generating these images (histograms). this does not give me enough freedom to edit the images.

Thank you so much. Is there a way also transfer the data that was used for generating these images (histograms).

don't use option -m ....

It is not the same output. Without -m, it gives only the stats for each chromosome as a whole

then you should just parse the output of samtools depth and aggregate the output with any tool like R, awk, etc...

Log in to answer this question.