I've been trying to get a .dot
file into iGraph
, but I run into some issues and only get it semi-working.
Here's the .dotfile:
digraph "" {
0 [color="[ 1. 0.7812 0.4975 1. ]", copynr=1, gene=None, label=3473, type=tf, typeLabel="tf D*-e"];
1 [color="(0.0, 0.90196078431372551, 0.5490196078431373, 1.0)", copynr=1, exporting=False, gene=None, label=3472, type=pump, typeLabel="i-pC"];
2 [color="(1.0, 0.62527233115468439, 0.0, 1.0)", copynr=1, gene=None, label=3473, type=enz, typeLabel="A >\nC"];
3 [color="[ 1. 0.65253176 0.41555882 1. ]", copynr=1, gene=None, label=3474, type=tf, typeLabel="tf C-i"];
4 [color="(0.0, 0.0, 0.94563279857397498, 1.0)", copynr=1, gene=None, label=3474, type=enz, typeLabel="B >\nA+D*"];
5 [color="(0.0, 0.0, 1.0, 1.0)", copynr=1, exporting=False, gene=None, label=3473, type=pump, typeLabel="i-pA"];
6 [color="(0.0, 0.45098039215686275, 0.77450980392156865, 1.0)", copynr=1, exporting=False, gene=None, label=3474, type=pump, typeLabel="i-pB"];
7 [color="[ 0.82352922 0.5208 0.33166667 1. ]", copynr=1, gene=None, label=3472, type=tf, typeLabel="tf B-i"];
8 [color="(0.22454142947501579, 1.0, 0.74320050600885512, 1.0)", copynr=1, gene=None, label=3472, type=enz, typeLabel="C >\nB+D*"];
9 [color="(0.0, 0.53529411764705859, 1.0, 1.0)", copynr=1, gene=None, label=3531, type=enz, typeLabel="C >\nA+D*"];
self [marker=1157];
0 -> 2 [effect="0.171502525962", effect_apo="0.0673415230763", strength="0.622317743898"];
0 -> 4 [effect="0.171502525962", effect_apo="0.0673415230763", strength="0.622317743898"];
3 -> 9 [effect="0.294786035872", effect_apo="0.284853949868", strength="0.962982478672"];
3 -> 6 [effect="0.294786035872", effect_apo="0.284853949868", strength="0.962982478672"];
3 -> 7 [effect="0.294786035872", effect_apo="0.284853949868", strength="0.962982478672"];
7 -> 1 [effect="0.0602136016303", effect_apo="0.0998341322605", strength="1.39594437271"];
7 -> 9 [effect="0.0602136016303", effect_apo="0.0998341322605", strength="1.39594437271"];
7 -> 7 [effect="0.0602136016303", effect_apo="0.0998341322605", strength="1.39594437271"];
}
Here's what I have so far in R:
library(sna)
library(igraph)
g.dot <- read.dot("GRN_0000000002_apo_dot.dot")
g.graph <- graph.adjacency(g.dot)
plot(g.graph)
As you can see in the picture, it somehow uses the edge attributes as node-names, and therefor fails to actually have 1 copy of vertex 9 and 7. Also, all the attributes from the edges (color, label) are nowhere to be found.
Resulting iGraph plot
Any idea how to actually do this? I'm afraid I only have .dot files, so this is what I have to use.