Skip to content

added min depth as command line option#2235

Merged
daviesrob merged 2 commits into
samtools:developfrom
vasudeva8:cov1
Jul 22, 2025
Merged

added min depth as command line option#2235
daviesrob merged 2 commits into
samtools:developfrom
vasudeva8:cov1

Conversation

@vasudeva8

Copy link
Copy Markdown
Contributor

Fixes #1563
Added min-depth command line option with default value 1. With this value, it works as previous versions.
When value other than 1 is given, new value is used for the min depth check and any position in a file which has depth below it are ignored. The quality values for such positions are also ignored.
Note: The depth is per file / input.

@daviesrob daviesrob self-assigned this Jul 17, 2025
@daviesrob

Copy link
Copy Markdown
Member

This currently treats each file separately for depth filtering purposes, however as the output is for the sum over all files I think it should count a location if the sum of all positions comes over the threshold. This would be similar to running:

samtools merge -o - file1.bam file2.bam | samtools coverage --min-depth 2 -

I suspect the program is mostly used with only one input, but if you do supply more that one I'd guess it's with the intention of seeing the coverage over the merged files.

@vasudeva8

Copy link
Copy Markdown
Contributor Author

Updated to use depth based on all input files.

@daviesrob daviesrob merged commit fb1d450 into samtools:develop Jul 22, 2025
6 checks passed
@vasudeva8 vasudeva8 deleted the cov1 branch July 22, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minimum depth threshold for "samtools coverage"?

2 participants