lh3 / minigraph

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

Self-loop and cycles in rGFA #63

Open gsc74 opened 2 years ago

gsc74 commented 2 years ago

@lh3 In rGFA file (test\MT.gfa) there is a self loop, So can we expect graph generated with minigraph -cxggs or minigraph --ggen to contain self-loops or cycles?

lh3 commented 2 years ago

The example just shows that minigraph can handle cycles. I don't think the current minigraph can generate cycles (I haven't checked), but it can generate inversions, which may be more difficult to handle downstream.

gsc74 commented 2 years ago

Thanks!

gsc74 commented 2 years ago

@lh3 I've checked hprc-v1.0-minigraph-chm13.gfa graph from hprc, by converting to vg format;

vg convert -gv hprc-v1.0-minigraph-chm13.gfa -t 128 > hprc-v1.0-vg-chm13.vg

followed by;

vg stats -A hprc-v1.0-vg-chm13.vg

It shows graph is cyclic

glennhickey commented 2 years ago

Note: vg stats -A checks for both "reversing" and "non-reversing" cycles, ie if you can start at some node, walk on the graph, and get back to your starting node in either orientation, it will report "cyclic". This also means that a single inversion would be enough to have your graph considered cyclic by this tool.

gsc74 commented 2 years ago

Thanks!