Reputation: 31
I am trying to open an GML format file but couldn't work. Basically, I use a code called ChemTraYzer to produce some files related to GML, i.e. a .gml file and a folder with some required pictures. Here is the .gml file:
graph [
hierarchic 1
label ""
directed 1
node [
id "C"
graphics
[
image "reac.pic/spec_0.png"
]
]
node [
id "[CH3]"
graphics
[
image "reac.pic/spec_2.png"
]
]
node [
id "O"
graphics
[
image "reac.pic/spec_1.png"
]
]
node [
id "[OH]"
graphics
[
image "reac.pic/spec_5.png"
]
]
edge [
source "C"
target "[CH3]"
weight 1
LabelGraphics
[
text "[0]"
fontSize 32
]
]
edge [
source "C"
target "O"
weight 1
LabelGraphics
[
text "[0]"
fontSize 32
]
]
edge [
source "[OH]"
target "[CH3]"
weight 1
LabelGraphics
[
text "[0]"
fontSize 32
]
]
edge [
source "[OH]"
target "O"
weight 1
LabelGraphics
[
text "[0]"
fontSize 32
]
]
]
And a folder called reac.pic which contains some images related to this gml file.
It is expected to export a picture like the following:
I know some Python packages like Networkx or Java programmes like Gephi may be able to open the GML file as required. However, I tried a lot of times but couldn't succeed. I would appreciate it very much if anyone can help me with it. Many thanks!
Upvotes: 2
Views: 1195
Reputation: 46
The graph you have posted has no layout. What you need is additional software to convert it to the figure you have posted. As described in the original ChemTraYzer publication (doi: 10.1021/acs.jctc.5b00201), the yEd software does a pretty good job (https://www.yworks.com/products/yed). I have tried using some python libraries for doing the layout, but it is really hard to get good looking graph layouts automatically. Therefore, I am using the automatic layout algorithms of yEd (hierarchical in this case) and rearrange nodes and edges manually.
Upvotes: 3
Reputation: 2765
Your graph seems to be hierarchical and Gephi has withdrawn support for hierarchical graphs, see here. Apart from that I doubt that the Gephi GML importer will be able to read the linked images. There is a workaround by using a plugin but only works for Gephi 0.8.2
Upvotes: 0