mosdepth
mosdepth copied to clipboard
mosdepth in multiple region
hello,
I came across a trouble. I have to calculate the depth in all autosomes, in other words, I have to exclude the MT area. I want to know whether the " mosdepth" can calculate this directly. Of course, I can extract these from the bam file and the using mosdepth to calculate depth, but as you see it's time consumed.
Hope for your answer. Thanks a lot.
hi, you can do this by passing a bed file of just the chromosomes you want. You can make it from the fai (fasta index) something like this:
awk '($2 > 20000 ){ print $1"\t0\t"$2 }' $fai > regions.bed
you can filter to your exact chromosomes with awk or after.
then use that as the argument to --by for mosdepth.
Then regions.dist.txt will contain the depths of interest.
-B