This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Subset a GAM (graph alignment) file

I would like to subset a GAM file to contain less reads so I can visualize it with Sequence Tube Map.

I've tried

vg view -a myreads.gam | head -n1000 | vg view -G -J

but it doesn't recognize the standard input.

I was hoping that something like samtools view -s 0.1 bamfile.bam

Thanks

pangenome vg vgteam

1 answer

For the first 1000 reads:

vg view -a myreads.gam | head -n1000 | vg view -a -G -J - > myreads_1000.gam

For downsampling like samtools

vg filter myreads.gam -d 0.1 > myreads_0.1.gam

Log in to answer this question.