R/plotPath.R
layoutVertexByAttr.Rd
This function generates a layout for igraph objects, keeping vertices with the same attribute (ex: in the same pathway, etc) close to each other.
layoutVertexByAttr(
graph,
attr.name,
cluster.strength = 1,
layout = layout.auto
)
An annotated igraph object.
The attribute name by which vertices are laid out.
A number indicating tie strengths between vertices with the same attribute. The larger it is, the closer the vertices will be.
A layout function, ideally a force-directed layout fuction, such as
layout_with_fr
and layout_with_kk
.
A two-column matrix indicating the x and y postions of vertices.
Other Plotting methods:
colorVertexByAttr()
,
plotAllNetworks()
,
plotClassifierROC()
,
plotClusterMatrix()
,
plotCytoscapeGML()
,
plotNetwork()
,
plotPathClassifier()
,
plotPaths()
data("ex_kgml_sig")
v.layout <- layoutVertexByAttr(ex_kgml_sig, "pathway")
#> This graph was created by an old(er) igraph version.
#> ℹ Call `igraph::upgrade_graph()` on it to use with the current igraph version.
#> For now we convert it on the fly...
plotNetwork(ex_kgml_sig, vertex.color="pathway", layout=v.layout)
v.layout <- layoutVertexByAttr(ex_kgml_sig, "pathway", cluster.strength=5)
plotNetwork(ex_kgml_sig, vertex.color="pathway", layout=v.layout)