Can I use vg tools to calculate the depth for a bed range file like with samtools depth?
2
0
Entering edit mode
13 months ago
carolynzy ▴ 10

Hi, I have some gam files produce by vg call and I want to know the mean/min/max depth for some ranges stored in a bed file. I could surject the gam file to the reference genome and convert to bam file, and then use samtools depth to calculate those statistics. However, maybe there is a way to do that with vg tools so that I don't need to do the convert steps?

Thanks for your help!

vg • 1.1k views
ADD COMMENT
0
Entering edit mode

Thanks a lot! I will try these options immediately.

ADD REPLY
1
Entering edit mode
13 months ago
glenn.hickey ▴ 520

The closest thing to samtools depth is vg depth. vg depth doesn't accept bed files, but you can use it (with -k) to compute the coverage at each position in the whole chromosome (or genome) pretty quickly. Then you could pull out the intervals of interest with something like bedTools.

If you want to extract a bed region from your gam, you can use vg gamsort and vg chunk, but this will be much slower than depth. vg view cannot subset GAMs, so the above suggestion of using it will not work at all.

ADD COMMENT
1
Entering edit mode
13 months ago

Another option would be to use vg pack to compute node-level coverages in a .pack format and then use vg pack --as-table to print them out. There would be another layer of translation to get from a BED region to node IDs though.

ADD COMMENT

Login before adding your answer.

Traffic: 1853 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6