expandComplexes {NetPathMiner} | R Documentation

## Expand reactions / complexes into their gene constituents.

### Description

These are general functions to expand vertices by their attributes, i.e. create a separate vertex for each attribute value.

### Usage

    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")

### Arguments

`graph` | An annotated igraph object.
`v.attr` | Name of the attribute which vertices are expanded to.
`keep.parent.attr` | A (List of) `regex` experssions representing attributes to be inherited by daughter vertices. If `"all"` is passed, all parent attributes are inherited.
`expansion.method` | If `"duplicate"`, attribute values sharing more than one parent vertex are duplicated for each vertex they participate in. For exmaple, if one gene G1 catalyzes reactions R1, R2; then G1##R1, and G1##R2 vertices are created. If `"normal"` only one vertex (G1) is created, and inherit all R1 and R2 connections and attributes.
`missing.method` | How to deal with vertices with no attribute values. `"keep"` retains the parent node, `"remove"` simply deletes the vertex, and `"reconnect"` removes the vertex and connect its neighbours to each other (to prevent graph cuts).

### Details

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.

### Value

A new graph with vertices expanded.

`makeGeneNetwork` returns a graph, where nodes are genes, and edges represent participation in succesive reactions.

### Author(s)

Ahmed Mohamed

### See Also

Other Network processing methods: `makeMetaboliteNetwork`, `makeReactionNetwork`, `reindexNetwork`, `rmSmallCompounds`, `simplifyReactionNetwork`, `vertexDeleteReconnect`

### Examples

     ## 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)

[Package NetPathMiner version 1.23.0 Index]