lh3 / minigraph

Sequence-to-graph mapper and graph generator
https://lh3.github.io/minigraph
MIT License
420 stars 38 forks source link

Question about 1-1 mappings #18

Closed mrvollger closed 4 years ago

mrvollger commented 4 years ago

Hi Heng,

I have a question about 1-1 mappings. If I build a graph with for example ref and sample1 and then I align sample1 back to the graph to get its path through the graph will minigraph report a path that does not "reuse" parts of the query?

I ask because I am looking a a couple of alignments where the path length in column 7 of the GAF is much longer than the query end - query start.

If this is not supposed to happen, let me know and I will put together a minimal test case.

Thanks! Mitchell

lh3 commented 4 years ago

will minigraph report a path that does not "reuse" parts of the query?

Ideally minigraph shouldn't report such paths, but in practice, minigraph may do that in corner cases.

I ask because I am looking a a couple of alignments where the path length in column 7 of the GAF is much longer than the query end - query start.

You should check col 9 minus col 8. Col 7 is not the length of path in the alignment. It is the length of path in the reference graph. This includes unaligned sequences before the alignment start and after the alignment end.

mrvollger commented 4 years ago

Thanks! That makes perfect sense and fixes the issue I thought I was seeing, at least in this region.