This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Question about `vg giraffe`

When I use vg giraffe to align reads to a graph and generate a BAM file, is there a way to determine the positions aligned to any genome (non-reference genomes) in the graph?

vg

1 answer

The easiest way is to align the reads to the graph in GAM or GAF format. Then you select sample sample as the reference using vg gbwt:

vg gbwt --set-reference sample -g output.gbz --gbz-format -Z input.gbz

And then you convert the mappings to BAM using vg surject with the output graph. If the sample is diploid, both haplotypes will be used as references.

If you want to consider only one haplotype (e.g. 1), you can select path names for that haplotype using:

vg paths -L -S sample -x output.gbz | grep "#1#" > paths.txt

Then you can provide the path name list to vg surject using option --into-paths paths.txt.

Log in to answer this question.