In the network analysis vignette, we generated a full network of PPI with the 22 genes that had some significant number of interactions with the miRNA's. Based on this and other data, three genes came across as rather important. The previous analysis we generated the network and saved it and the gene data. We want a figure that shows their interaction network for the publication.
library(graph) library(org.Hs.eg.db) library(RCytoscape)
data(seedMRNA) seedMRNA data(PPI_seed) head(PPI_seed) nrow(PPI_seed)
Lets create our graph and get the node information from the STRING PPI data.
seed_graph <- PPI_to_graph(PPI_seed, org.Hs.eg.db) seedInfo <- seed_graph$info seedGraph <- seed_graph$graph seedGraph head(seedInfo)
Previously examining the list of PPI genes showed that there are a lot of genes that form sub-components of larger complexes. These include the CCR4-NOT transcription complex (CNOT), eukaryotic translation initiation factor 3 (EIF3), exocyst complex component (EXOC), ribosomal protein L subunits (RPL), ribosomal protein S subunits (RPS), protein phosphatase 1, 2, 3, and subunits (PPP1R, PPP2R, PPP3, PPP4).
We collapse these into single entries to make visualizing what is going on easier.
collapseString <- c("CNOT", "EIF3", "EXOC", "RPL", "RPS", "PPP1R", "PPP2R", "PPP3", "PPP4") collapse_graph <- collapseNodes(seedGraph, seedInfo, seedMRNA$SYMBOL, collapseString) collapseGraph <- collapse_graph$graph collapseInfo <- collapse_graph$info
Check that Cytoscape is running and there is a connection. If there is not, then the rest of the sections will not be run.
runCy <- FALSE try({ tmp <- RCytoscape::CytoscapeWindow("tmp") runCy <- TRUE invisible(RCytoscape::deleteWindow(tmp)) }) if (!runCy){ print("No connection to Cytoscape available, subsequent visualizations were not run") }
cw <- CytoscapeWindow("collapsed", collapseGraph) displayGraph(cw) seedNodes <- collapseInfo$nodeID[collapseInfo$SYMBOL %in% seedMRNA$SYMBOL] otherNodes <- grep("^9606", collapseInfo$nodeID, value=TRUE) otherNodes <- otherNodes[!(otherNodes %in% seedNodes)] setLayoutProperties(cw, layout.name="kamada-kawai-noweight", list(anticollisionStrength=4000, rest_length=100)) layoutNetwork(cw, "kamada-kawai-noweight") redraw(cw) setNodeLabelDirect(cw, nodes(collapseGraph), nodeData(collapseGraph, nodes(collapseGraph), "DISPLAY")) redraw(cw) setNodeColorDirect(cw, seedNodes, "#F5C46F") redraw(cw) setNodeColorDirect(cw, otherNodes, "#6FA0F5") redraw(cw) setDefaultBackgroundColor(cw, "#FFFFFF") redraw(cw) setDefaultNodeSize(cw, 60) redraw(cw) setDefaultEdgeColor(cw, "#CCCCCC") redraw(cw) setDefaultNodeFontSize(cw, "20") redraw(cw)
Note: If you want to actually get it so that the nodes do not overlap, do the following in Cytoscape:
Edge-weighted-spring-embedded
2000
and 4000
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.