reindexNetwork: Replaces current vertex ids with chosen attribute.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/netProcess.R

Description

This function allows users to replace vertex ids with another attribute, calculating connectivities based on the new attribute.

Usage

1
reindexNetwork(graph, v.attr)

Arguments

graph

An annotated igraph object.

v.attr

Name of the attribute to use as vertex ids.

Details

This 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 reindex the vertices by "miriam.kegg.compound" attribute. Another usage is to remove duplicated vertices (in case of different subcellular compartments, for example). if a network has ATP_membrane & ATP_cytoplasm vertices, reindexing by chemical name will collapse them into one 'ATP' vertex.

Value

A new graph with vertices expanded.

Author(s)

Ahmed Mohamed

See Also

Other Network processing methods: expandComplexes, makeMetaboliteNetwork, makeReactionNetwork, rmSmallCompounds, simplifyReactionNetwork, vertexDeleteReconnect

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 ## 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)

NetPathMiner documentation built on Nov. 8, 2020, 8:20 p.m.