Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mosdepth in multiple region #152

Open
johjoon opened this issue Jul 15, 2021 · 1 comment
Open

mosdepth in multiple region #152

johjoon opened this issue Jul 15, 2021 · 1 comment

Comments

@johjoon
Copy link

johjoon commented Jul 15, 2021

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.

@brentp
Copy link
Owner

brentp commented Jul 15, 2021

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

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

No branches or pull requests

2 participants