I've been following the vg guide on regenotyping a VCF using a graph reference with alignments to it. In their docs, they describe the following set of commands:
# Re-construct the same graph as before but with `-a`
vg construct -r small/x.fa -v small/x.vcf.gz -a > xa.vg
# Index the graph with `-L' to preserve alt paths in the xg
vg index xa.vg -x xa.xg -L
# Compute the support (we could also reuse aln.pack from above)
vg pack -x xa.xg -g aln.gam -o aln.pack
# Genotype the VCF (use -v)
vg call xa.xg -k aln.pack -v small/x.vcf.gz > genotypes.vcf
But how is the aln.gam
meant to be constructed for this particular use case? The docs also say that if you want to use vg giraffe
, one should use autoindex
and then align your reads using giraffe
to the resulting .gbz
. However, I tried doing this, and then following the steps above, but the tool crashes since there are two apparently different graphs: the .gbz
the aln.gam
is aligned to, and the .xg
from the above commands. Despite using the exact same VCF to create them, it seems they don't work together.
What's the "right" way to both use giraffe
to align short reads to a graph, and then also trying to regenotype the existing VCF itself using these alignments?