Question: Best way to find neighbors of a node in a VG graph?
1
gravatar for samantha.hao
14 months ago by
samantha.hao10
samantha.hao10 wrote:

Hi,

What is the best way to extract the neighboring nodes of a given node ID in a VG graph? I can think of a couple, but it's not clear which would be the most direct way:

  1. vg find -n ID -c 1 -x graph.xg | vg view -j - would give a json that contains the node IDs.

  2. vg stats -S graph.vg would output a table where I could search for the desired node ID lines.

There are a few more methods I can think of that indirectly give me the information by parsing a JSON, but I was wondering if there's a more direct way?

Thanks in advance,

Sam

vgteam variation graph vg • 266 views
ADD COMMENTlink modified 14 months ago by glenn.hickey220 • written 14 months ago by samantha.hao10
1
gravatar for glenn.hickey
14 months ago by
glenn.hickey220
glenn.hickey220 wrote:

vg find is probably the best. You may find the GFA output (vg view without the -j) easier to read or parse. Also note that it no longer requires an xg file, so you could use the same command on graph.vg too, and -c can be increased to pull larger subgraphs.

Python bindings to access the graph structure are in the works. They'll build on what was developed here: https://github.com/vgteam/odgi/pull/52

ADD COMMENTlink written 14 months ago by glenn.hickey220
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2388 users visited in the last hour
_