Entering edit mode
Srinivas Iyyer
▴
600
@srinivas-iyyer-939
Last seen 10.2 years ago
Dear group,
I am finding difficult to control edge size and color
in the following piece of code.
natt = makeNodeAttrs(
g4,
shape = "ellipse",
fillcolor= "goldenrod1",
size=0,
fontsize=8,
label = substr(nodes(g4),6, 10)
)
>lgGO = agopen(
g4,
recipEdges = "distinct",
layoutType = "dot",
nodeAttrs = natt,
name = "",
edgeAttrs=list(c(color='green',
weight=0.3)
)
)
Error in buildEdgeList(graph, recipEdges, edgeAttrs,
subGList, attrs$edge) :
STRING_ELT() can only be applied to a 'character
vector', not a 'NULL'
Here in agopen, I made a edgeAttrs list object with
color and weight attributes and I get above error.
Instead, I tried like the following:
> x = buildEdgeList(g4,
recipEdges='distinct',
edgeAttrs=list(c(color='green'))
)
Error in buildEdgeList(g4, recipEdges = "distinct",
edgeAttrs = list(c(color = "green"))) :
STRING_ELT() can only be applied to a 'character
vector', not a 'NULL'
Also when I just make a buildEdgeList object, I can
make it with wight=1 (which is default)
>x = buildEdgeList(g4,recipEdges='distinct')
>y = unlist(x)
> y[[1]]
An object of class ?pEdge?
Slot "from":
[1] "GO:0030199"
Slot "to":
[1] "GO:0030198"
Slot "attrs":
$arrowhead
[1] "open"
$weight
[1] "1"
$dir
[1] "forward"
Slot "subG":
[1] 0
How can I control, the edge global parameters.
I do not see makeEdgeAttr function just like
makeNodeAttr. Could some one help me here please. A
working code is given at bottom.
> makeEdgeAttrs
Error: object "makeEdgeAttrs" not found
##### code that works#######
g4 <- GOGraph(summary(hgOver)$GOBPID, GOBPPARENTS)
natt = makeNodeAttrs(g4, shape = "ellipse", fillcolor
= "goldenrod1",size=0,fontsize=8,label =
substr(nodes(g4),6, 10))
natt$fillcolor[summary(hgOver)$GOBPID] = "red"
lgGO = agopen(g4, recipEdges = "distinct", layoutType
= "dot",nodeAttrs = natt, name =
"",edgeAttrs=list(c(color='green')))
plot(lgGO)
###### end of code that works #######
________________________________________________________________
____________________
Never miss a thing. Make Yahoo your home page.