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?
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?
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.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.