expandComplexes | R Documentation |
These are general functions to expand vertices by their attributes, i.e. create a separate vertex for each attribute value.
expandComplexes(
graph,
v.attr,
keep.parent.attr = "^pathway",
expansion.method = c("normal", "duplicate"),
missing.method = c("keep", "remove", "reconnect")
)
makeGeneNetwork(
graph,
v.attr = "genes",
keep.parent.attr = "^pathway",
expansion.method = "duplicate",
missing.method = "remove"
)
graph |
An annotated igraph object. |
v.attr |
Name of the attribute which vertices are expanded to. |
keep.parent.attr |
A (List of) |
expansion.method |
If |
missing.method |
How to deal with vertices with no attribute values. |
These functions can be very useful when merging networks constructed from different databases. For example, to match a network created from Reactome to a KEGG network, you can expand metabolite vertices by "miriam.kegg.compound" attribute.
A new graph with vertices expanded.
makeGeneNetwork
returns a graph, where nodes are genes, and edges represent
participation in succesive reactions.
Ahmed Mohamed
Other Network processing methods:
makeMetaboliteNetwork()
,
makeReactionNetwork()
,
reindexNetwork()
,
rmSmallCompounds()
,
simplifyReactionNetwork()
,
vertexDeleteReconnect()
## Make a gene network from a reaction network.
data(ex_sbml) # A bipartite metbaolic network.
rgraph <- makeReactionNetwork(ex_sbml, simplify=TRUE)
ggraph <- makeGeneNetwork(rgraph)
## Expand vertices into their contituent genes.
data(ex_kgml_sig) # Ras and chemokine signaling pathways in human
ggraph <- expandComplexes(ex_kgml_sig, v.attr = "miriam.ncbigene",
keep.parent.attr= c("^pathway", "^compartment"))
## Create a separate vertex for each compartment. This is useful in duplicating
## metabolite vertices in a network.
## Not run:
graph <- expandComplexes(graph, v.attr = "compartment",
keep.parent.attr = "all",
expansion.method = "duplicate",
missing.method = "keep")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.