Closed Overcraft90 closed 4 weeks ago
It looks like the ReferencePathOverlay
thinks about a path that it can't actually get a length for and explodes. We need some kind of check in vg chunk
to detect when it doesn't actually know about the path you are asking about. The problem might be that this path exists, but isn't indexed in the ReferencePathOverlay so the lookup that vg chunk
is trying to do errors out.
Are you trying to seek to coordinates along a particular haplotype from the GBWT data and draw a visualization for it?
I think we could sort of dynamically promote it to be reference indexed when vg chunk
sees you are asking about it, since GBWT/GBZ/the ReferencePathOverlay just scan all the reference paths at load time to provide efficient position lookups.
OK, I can reproduce this with just vg.
If I make a GBZ:
vg gbwt --gbz-format --graph-name test/graph.gbz --gfa-input test/graphs/gfa_with_reference.gfa
And then ask for a path that doesn't exist:
vg chunk -x test/graph.gbz -p GRCh38#0#chr2:1-2 -c 1 >/dev/null
I get a legitimate error:
error[vg chunk]: input path GRCh38#0#chr2 not found in xg index
But if I ask for a path that does exist but isn't a reference path:
vg chunk -x test/graph.gbz -p sample1#1#chr1#0:1-2 -c 1 >/dev/null
Then it crashes:
libc++abi: terminating due to uncaught exception of type std::out_of_range: unordered_map::at: key not found
...
I was working with a small plant pangenome in GBZ format. It's loaded as a mounted file in
TubeMap
and I can navigate reference paths with no issues; however, when I attempt to switch to a non-refernce path I'm prompted with avg chunk
error as follows:I'm not quite sure to what this might be related... For reference, other haplotypes do exist as per the drop menu in the Region field, but the Legend shows only AMIGA as the reference genome (see screenshot below). Any help is much appreciated, thanks in advance!