ngraph_fromRCX {ndexr} | R Documentation |
This function creates an ngraph object from a supplied RCX
object.
RCX objects store the CX data as a named list of data.frames containing metaData and all aspects of the network.
The ngraph class inherits from igraph and contains the complete (R)CX information as graph, node and edge attributes.
All igraph
functionality is available, e.g. access nodes and edges of igraph g via V(g) and E(g) and their attributes via V(g)$attribute
ngraph_fromRCX(rcx, verbose = FALSE)
rcx |
RCX object |
verbose |
logical; whether to print out extended feedback |
The following rules apply to convert from RCX
to ngraph:
nodes receive the "@id" value as name. All other information in aspects node and nodeAttributes are saved as node attributes, access via V(g). Data goes from long format (column n containing attribute name and column v containing attribute value) to wide format (columns for each unique n with cells contianing v).
edges are connected via their "s"art and "t"arget fields. The "@id" and "i"nteraction attribute are stored as is and all edgeAttributes are saved as node attributes, access via E(g). Data goes from long format (column n containing attribute name and column v containing attribute value) to wide format (columns for each unique n with cells contianing v).
all other aspect data is stored as graph attributes, access via g$aspect
An ngraph object could look like this:
> str(ngraph) IGRAPH DN-- 5 11 -- PLK3 signaling events + attr: name (g/c), description (g/c), version (g/c), ndex:sourceFormat (g/c), name (v/c), @id (v/n), n | (v/c), test (v/c), relatedTo (v/x), @id (e/n), i (e/c) + edges (vertex names): [1] 60714376->60714377 60714381->60714377 60714384->60714377 60714377->60714376 60714377->60714381 60714377->60714381 [7] 60714377->60714384 60714377->60714384 60714377->60714395 60714377->60714395 60714377->60714395 > V(ngraph) + 5/5 vertices, named: [1] 60714376 60714377 60714381 60714384 60714395 > V(ngraph)$n [1] "CCNE1" "PLK3" "MPIP3" "CHK2" "P53" > E(ngraph) + 11/11 edges (vertex names): [1] 60714376->60714377 60714381->60714377 60714384->60714377 60714377->60714376 60714377->60714381 60714377->60714381 [7] 60714377->60714384 60714377->60714384 60714377->60714395 60714377->60714395 60714377->60714395 > E(ngraph)$i [1] "neighbor-of" "neighbor-of" "neighbor-of" [4] "controls-expression-of" "controls-phosphorylation-of" "controls-state-change-of" [7] "controls-phosphorylation-of" "controls-state-change-of" "controls-phosphorylation-of" [10] "controls-state-change-of" "neighbor-of"
returns object of class ngraph if successfull, NULL otherwise
ngraph_toRCX
rcx_fromJSON
rcx_toJSON
RCX
igraph
## Establish a server connection ndexcon = ndex_connect() ## Find one of your networks and get its UUID networks = ndex_find_networks(ndexcon) networkId = networks[1,"externalId"] ## Get the network data rcx = ndex_get_network(ndexcon, networkId) ## Convert to nGraph ngraph = ngraph_fromRCX(rcx)