Thank you for your answer - There are definitely aligned reads on the chromosome in the bam files I've found to give nothing using -a although they may not be near the region I've been specifying. Is this just done to make the files smaller?
In the documentation for samtools (http://www.htslib.org/doc/samtools.html) the depth command has the following options:
-a : Output all positions (including those with zero depth)
-a -a, -aa : Output absolutely all positions, including unused reference sequences. Note that when used in conjunction with a BED file the -a option may sometimes operate as if -aa was specified if the reference sequence has coverage outside of the region specified in the BED file.
I was wondering why there needs to be these two options and what unused reference sequences means? Why is the reference sequence sometimes unused vs. simply having no coverage there i.e. zero depth?
Many thanks!
1 answer
It means that -a alone will return zeros for the regions on a chomosome where you have reads aligned but the given region is empty = no coverage. Given a chromosome had no reads at all, -aa would return 0 for every position while -a alone would report nothing at all. Unused in this context means no coverage at any position of that chromosome/reference sequence.
I do not know what you mean. Please give reproducible examples.
Sorry for not being clear - I think I may understand now. If you specify any specific region which has no coverage and only use -a there will be no output but if it has any coverage within the sepcified region the output will be 0 for that base using -a? I thought there would only be no output with -a if nowhere on the chromosome had any coverage which isn't true of my files but I was specifying specific regions. Anyway, thanks again!
Log in to answer this question.
See here: https://github.com/samtools/samtools/issues/374