In Section 4 of the spaceMap publication we refer to applying the the network analysis toolkit to the BCPLS data set. The publication explains we applied the toolkit to three different networks. Below we outline how to view the analysis of each BCPLS network discussed in the spaceMap publication.

  • prot-net: a network learned by spaceMap’s Boot.Vote fit to the CNA and protein expressions data. The analysis was previously illustrated in the spacemap R package’s vignette.
  • scggm-net: a network learned by scggm’s Boot.Vote fit to the CNA and protein expressions data. The details of applying the network analysis toolkit to scggm-net can be viewed by following this link.
  • RNA-net: a network learned by spaceMap’s Boot.Vote fit to the CNA and mRNA expressions data of BCPLS. This current document illustrates analysis of RNA-net in full detail below.

For more details about the fitting of the three networks consult the spaceMap publication. Please refer to the vignette prior to inspecting the RNA-net analysis found here. All three network analyses share virtually identical analytical steps, but this document differs in the response data and only the vignette explains in-depth what are input arguments to the toolkit.

Input

Load the gene coordinate annotations for mRNA expressions and genomic CNA.

library(Biobase)
yinfo <- pData(featureData(readRDS(file = "data/rna-expression-set.rds")))
xinfo <- pData(featureData(readRDS(file = "data/cna-expression-set.rds")))

Load the Boot.Vote CNA-mRNA network.

library(Matrix)
net <- readRDS(file = "model-fits/smap_rna_boot_vote.rds")
names(net) <- c("yy", "xy")
rownames(net$xy) <- xinfo$id; colnames(net$xy) <- yinfo$id;
rownames(net$yy) <- yinfo$id; colnames(net$yy) <- yinfo$id;

Load the degree distributions for the ensemble of bootstrapped networks.

bdeg <- readRDS(file = "model-fits/smap_rna_boot_degree.rds")
names(bdeg) <- c("xy", "yy")
colnames(bdeg$xy) <- xinfo$id; colnames(bdeg$yy) <- yinfo$id;

Load the Gene Ontology mappings for enrichment analysis.

go2eg <- readRDS("data/rna-go-bp-to-entrez-gene-list.rds")
library(AnnotationDbi)
#human readable 
process_alias <- Term(names(go2eg))

Map Annotations

Convert the Boot.Vote network into an igraph object and map the annotations onto the network.

library(spacemap)
ig <- spacemap::adj2igraph(yy = net$yy, xy = net$xy, yinfo = yinfo, xinfo = xinfo)

If we query the attribute names of the nodes in the graph, we notice that the columns of xinfo and yinfo have been applied.

vertex_attr_names(graph = ig)
## [1] "name"   "alias"  "chr"    "start"  "end"    "strand" "levels"

The igraph package has a number of ways to access the annotation information. For example, if we wish to confirm the chromosome location of GRB7, we can easily query:

vertex_attr(graph = ig, name = "chr", index = V(ig)[alias %in% "GRB7"])
## [1] "chr17"

Hub Analysis

We first prioritize the CNA- and mRNA- hubs. If the bdeg argument is specified, then we rank the hubs according to the average degree rank. Accordingly, the most highly ranked hubs will have the most consistently high degree across network ensemble.

To rank the mRNA nodes, use the rankHub command and simply specify the level = "y" argument.

ig <- rankHub(ig = ig, bdeg = bdeg$yy, level = "y")

To rank the CNA nodes, specify the level = "x" argument.

ig <- rankHub(ig = ig, bdeg = bdeg$xy, level = "x")

Alternatively, if the bdeg argument is not available, the ranking is according to degree in the final network (coded by “ig”).

tmp <- rankHub(ig = ig,  level = "x")

Identify cis and trans

Next label \(x-y\) edges as being regulated in cis or in trans. The GenomicRanges R package and the genomic coordinates chr,start,end columns of xinfo and yinfo are required for this step.

Now we can label the \(x-y\) edges with either “cis” or “trans” in the cis_trans edge attribute of ig.

ig <- cisTrans(ig = ig, level = "x-y", cw = 2e6)

Report

We then report a well-organized table, as seen in Table 3 of the spaceMap publication. The top argument allows us to control how many hubs are displayed.

xhubs <- reportHubs(ig, top = 30, level = "x")
hub # cis/ # trans Potential # cis cis genes
5q34 (160-170 Mb) 0 / 188 4
10p15.1-15.3 (0.42-4 Mb) 0 / 55 7
17q12 (38-38 Mb) 4 / 36 24 PNMT, ERBB2, TCAP, GRB7
10p14-15.1 (4-12 Mb) 1 / 61 9 FLJ45983
5q14.3 (88-89 Mb) 0 / 97 1
5q14.3 (89-91 Mb) 0 / 72 1
9p22.3-23 (9.4-15 Mb) 2 / 36 5 SH3GL2, GLDC
8q21.2-22.1 (87-96 Mb) 0 / 17 5
10p11.1-10q11.21 (39-43 Mb) 0 / 8 7
1p22.2-22.3 (86-90 Mb) 0 / 12 8
15q13.1-15.1 (29-43 Mb) 0 / 7 10
16q23.1-24.3 (78-89 Mb) 0 / 6 10
9p21.3-22.3 (15-20 Mb) 0 / 7 7
5q34 (170-170 Mb) 0 / 8 4
14q11.2-12 (22-26 Mb) 0 / 2 11
5q35.2 (170-180 Mb) 0 / 2 6
16q22.1-22.2 (68-71 Mb) 0 / 1 9

Similarly, we can report the top 10 mRNA hubs, their degrees in the final network, and a description of each hub, if the description column was specified in yinfo.

yhubs <- reportHubs(ig, top = 10, level = "y")
hub degree
FOXA1 7
DARC 9
ESR1 9
COL10A1 7
FOXC1 9
SFRP1 6
SPDEF 5
FAT2 6
GABRP 4
TRIM29 7

GO-neighbor percentage

A CNA neighborhood comprises all mRNA nodes that are directly connected to a CNA hub by an edge. CNA neighborhoods represent direct perturbations to the proteome by amplifications or deletions in the DNA. To quantify their functional relevance, we compute a score called the GO-neighbor percentage. Two mRNA nodes are called GO-neighbors if they share a common GO term in the same CNA neighborhood. We postulate that a high percentage of GO-neighbors within a CNA neighborhood associates the CNA hub with more functional meaning. These scores, as presented in Figure 5 of the publication, can be generated with a GO mapping to the mRNAs as follows.

hgp <- xHubEnrich(ig = ig, go2eg = go2eg)
hub degree neighbor_percentage
1p22.2-22.3 12 33.33333
10p11.1-10q11.21 8 62.50000
10p14-15.1 62 54.83871
10p15.1-15.3 55 50.90909
14q11.2-12 2 0.00000
15q13.1-15.1 7 0.00000
16q23.1-24.3 6 33.33333
17q12 40 65.00000
5q34 188 66.48936
5q34 8 25.00000
5q35.2 2 0.00000
5q14.3 97 64.94845
5q14.3 72 54.16667
8q21.2-22.1 17 64.70588
9p21.3-22.3 7 42.85714
9p22.3-23 38 57.89474

Module Analysis

There are many criteria to define modules of a network. This toolkit allows users to import the module membership information by themselves (see mods argument in modEnrich).

In the spaceMap publication, we use the edge-betweenness algorithm in igraph.

library(igraph)
mods <- cluster_edge_betweenness(ig)

The main goal of module analysis is identifying modules that are functionally enriched. The modEnrich function will test for significantly over-represented GO-terms (or any other valid functional grouping) within a module using hyper-geometric tests.

In the current example, only the mRNA nodes have functional mapping and we specify this through the levels = "y" argument. If both predictors and responses have functional mapping in the go2eg argument, then we can specify levels = c("y","x"). Other arguments are available to control the enrichment testing; see modEnrich for more details.

outmod <- modEnrich(ig = ig, mods = mods, levels = "y", go2eg = go2eg, process_alias = process_alias, prefix = "R")

The output of the module analysis is a list of 3 objects.

names(outmod)
## [1] "ig"   "etab" "eraw"
  • ig is the input igraph network object updated with a “process_id” attribute for nodes affiliated with a significant GO-term. The “process_id” and “module” attributes together are useful for visualizing which nodes are enriched for a specific biological function.

  • etab is the polished module enrichment table to report significant GO terms, the representation of the GO term in the module relative to the size of the GO term, and which CNA hubs belong to the module. The top ten hits as in Table S.9 of the spaceMap publication’s supplementary materials are as follows:

outmod$etab[1:10,]
Module (size) GO Category GO Obs./ Total X-hubs (hits)
R10 (56) glucose homeostasis 6/16
chemokine-mediated signaling pathway 6/23
response to lipopolysaccharide 6/33
inflammatory response 8/60
R11 (37) adaptive immune response 6/23
immune response 8/59
R13 (39) epidermis development 8/22
R6 (32) heart development 5/23 16q23.1-24.3 (6)
R7 (67) cellular nitrogen compound metabolic process 6/27 17q12 (38)
R8 (66) collagen catabolic process 7/19
  • eraw contains details for each (module, GO-term) pair that was subjected to the hyper-geometric test. This output gives the user more control by reporting all tests, the relative over-representation of a GO-term in that module, the raw P-value, and the adjusted P-value.
outmod$eraw[1:5,]
Module process_id process_alias GO Obs./Total P_value Adjusted_P_value
R1 GO:0007568 aging 2/23 0.0173451 0.5671556
R1 GO:0043066 negative regulation of apoptotic process 2/38 0.0445685 0.8834413
R1 GO:0000122 negative regulation of transcription from RNA polymerase II promoter 0/58 1.0000000 1.0000000
R1 GO:0000165 MAPK cascade 0/30 1.0000000 1.0000000
R1 GO:0000186 activation of MAPKK activity 0/25 1.0000000 1.0000000

Export for Visualization

There are many tools for network visualization. In the publication of spaceMap, we exported the annotated igraph network object ig to the “graphml” format, which maintained all the attributes associated with nodes when read into Cytoscape for visualization.

filename <- "~/repos/neta-bcpls/neta/spacemap-rna-boot-vote.graphml"
#delete nodes without edges from the graph object
vis <- delete_vertices(graph = outmod$ig, v = V(outmod$ig)[igraph::degree(outmod$ig) == 0])
igraph::write_graph(graph = vis, file = filename, format = "graphml")

Here we list all the attributes associated with the nodes that can be used in tandem with Cytoscape’s filtering functions to identify specific nodes of interest.

vertex_attr_names(outmod$ig)
##  [1] "name"             "alias"            "chr"             
##  [4] "start"            "end"              "strand"          
##  [7] "levels"           "rank_hub"         "mean_rank_hub"   
## [10] "sd_rank_hub"      "ncis"             "ntrans"          
## [13] "regulates_in_cis" "potential_cis"    "module"          
## [16] "R"

We describe some of the most useful attributes for visualization:

  • ‘name’: the unique node ID
  • ‘alias’: the node alias (e.g. gene symbol ERBB2)
  • ‘chr,start,end,strand’: the gene coordinates of nodes
  • ‘description’: any note (e.g. breast cancer oncogene)
  • ‘levels’: indicates whether the node belongs to predictors “x” or responses “y”
  • ‘rank_hub’: the rank of the hub within its level (e.g. a value of “1” for a node of level “x” means that it is the most consistently high degree \(x\) node in the network. )
  • ‘regulates_in_cis’: list of genes regulated in cis
  • ‘module’: the module ID that the node belongs to.
  • ‘process_id’: the significant GO-term(s) associated with the node.

Also the edge attributes are exported to ‘graphml’ format.

edge_attr_names(outmod$ig)
## [1] "levels"    "cis_trans"
  • ‘levels’ indicates whether an edge is \(x-y\) or \(y-y\).
  • ‘cis_trans’ indicates whether an edge is regulated in cis or in trans.

Summary

This toolkit is useful for analyzing and summarizing the output of the spaceMap model fit in the context of integrative genomics. The biological context mapped onto the network object can easily be exported to existing network visualization tools like Cytoscape.

Copyright © 2017 Regents of the University of California. All rights reserved.