This tutorial demonstrates how to create a pathway enrichment map using the results from ActivePathways. An enrichment map is a technique for visualizing enriched pathways derived from omics data analysis and EnrichmentMap is a Cytoscape app for creating such visualizations (1). This tutorial uses results from the main ActivePathways vignette. ActivePathways creates the files for EnrichmentMap. To follow instructions in this vignette, use any Cytoscape files written by ActivePathways or follow the main ActivePathways vignette, ensuring that the Cytoscape files are saved in an accessible location. For further information on enrichment maps, see the protocol paper in Nature Protocols (2).
Recall that ActivePathways
writes four files to be used in Cytoscape.
files <- c(system.file('extdata', 'pathways.txt', package='ActivePathways'),
system.file('extdata', 'subgroups.txt', package='ActivePathways'),
system.file('extdata', 'pathways.gmt', package='ActivePathways'),
system.file('extdata', 'legend.pdf', package ='ActivePathways'))
# Not run.
res <- ActivePathways(dat, gmt, cytoscape.file.dir='path/to/results/directory')
The files written are:
pathways.txt
contains the list of significant pathways and the associated p-values. Note that only terms with p.val <= significant
are written, even if the option return.all=TRUE
is specified.
subgroups.txt
contains a matrix indicating the columns of the original scores matrix which contributed significant pathways. A value of 1 indicates that the pathway is also significant if ActivePathways is run on the p-values in that column, indicating that the pathway would be also identified by only analysing that dataset alone.
pathways.gmt
contains a shortened version of the supplied GMT file which includes only the significant pathways and associated genes. This abridged file can accelerate the process of creating the network using Cytoscape.
legend.pdf
is a graphics file of PDF format that displays the color legend that can be used as a reference to the generated Cytoscape network.
cat(paste(readLines(files[1])[1:3], collapse='\n'))
## term.id term.name adjusted.p.val
## REAC:2424491 DAP12 signaling 4.49126833230489e-05
## REAC:422475 Axon guidance 0.0202896586319552
cat(paste(readLines(files[2])[1:5], collapse='\n'))
## term.id CDS X3UTR promCore combined instruct
## REAC:2424491 1 0 0 0 piechart: attributelist="CDS,X3UTR,promCore,combined" colorlist="#FF0000FF,#80FF00FF,#00FFFFFF,#8000FFFF" showlabels=FALSE
## REAC:422475 0 1 1 0 piechart: attributelist="CDS,X3UTR,promCore,combined" colorlist="#FF0000FF,#80FF00FF,#00FFFFFF,#8000FFFF" showlabels=FALSE
## REAC:177929 1 0 0 0 piechart: attributelist="CDS,X3UTR,promCore,combined" colorlist="#FF0000FF,#80FF00FF,#00FFFFFF,#8000FFFF" showlabels=FALSE
## REAC:2559583 1 0 0 0 piechart: attributelist="CDS,X3UTR,promCore,combined" colorlist="#FF0000FF,#80FF00FF,#00FFFFFF,#8000FFFF" showlabels=FALSE
cat(paste(readLines(files[3])[1], collapse='\n'))
## REAC:2424491 DAP12 signaling IL17RD PSMC1 PDGFRB PSMD14 TNRC6C CD80 DUSP10 SPTBN4 PIP5K1B NRG1 TNRC6A FGF22 ADCY5 CHUK PSME2 CUL3 NRG2 PSMB8 PSMA2 PSMB3 PSMD13 AC010132.3 PIK3CB FGF18 PRKCE FN1 SHC2 RBX1 PSMD5 FGF19 NF1 ARRB1 FGFR1 PRKACG FGB PSME1 VAV1 PSMD3 ITGA2B HBEGF ERBB3 FGF3 KSR2 PPP2R5C VAV3 PPP2CB IL5RA PSMB9 CDKN1B RASA2 PPP2R5E PIK3AP1 PSMF1 FOXO4 PSMC3 PSMA6 AL358075.4 FGF2 ICOS IL2RB BTC ADCY2 RAPGEF2 CDKN1A DUSP6 ERBB4 PTK2 MET FGA TSC2 NRAS SPTB SPRED3 TNRC6B FOXO3 GSK3A FGF1 IL3RA PIP5K1A IL2RA GFRA4 PSMD1 TEK RICTOR PSMD10 CASP9 CAMK2G RASAL3 PPP2R1A PSMB6 FGF6 IL3 MAPKAP1 SYK CNKSR1 RASGRF2 GRIN2C PSMB7 CD86 ADCY3 TLN1 PSMC4 HRAS MLST8 VAV2 LAMTOR2 THEM4 DUSP7 RASGRF1 CALM3 RAP1B PSMC2 KSR1 RAC1 ADCY1 JAK1 SPRED2 PDE1A FGF10 PSME4 EGF PDE1B GRIN2A IRS2 VWF PIK3CD FGFR4 PHB AKT1 IQGAP1 PTPRA PSMB1 PRKAR1B KL PRKCD PSMD9 PSMB2 EGFR MAP2K2 PRKAR2B KRAS CAMK2D SRC PIK3CA NRTN IL2 CAMK2B KIT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CAM1 RASGRP4 PSMD12 PSMB5 TP53 WDR83 NRG4 PRKACB MAP2K1 MOV10 PIP5K1C NRG3 CALM2 PTEN UBA52 PSMD7 RNASE1 PSPN GFRA3 PSMD11 INS RASGRP1 AGO2 HGF PSME3
Open Cytoscape and ensure the EnrichmentMap and enchancedGraphics apps are installed. Apps may be installed by clicking Apps -> App Manager in Cytoscape. When the apps are installed, open the Apps menu again and click Enrichment Map. In the window that opens, click the Add Data Set from Files button (The ‘+’) in the top left, change the Analysis Type to ‘Generic/gProfiler’ and upload the pathways.txt
and pathways.gmt
files.
Click Build to create the network.
P.S. To make network more visually appealing, the Edge Cutoff slider in the EnrichmentMap tab of the Control Panel can be adjusted to determine the similarity coefficient (we recommend 0.5 or 0.6) and reduce the number of edges, the scale in the Tool Panel (View > Show Tool Panel) can be used to resize nodes, and the layout can be changed in the Layout tab (yFilesLayouts can be installed in apps, Layout > yFilesLayouts).
Adjusting the Similarity Coefficient
Adjusting the Node Size
To upload the subgroups.txt
table, go to File > Import > Table > File and import the subgroups.txt
file.
Click the Style tab in the Control panel and ensure the Image/Chart1 property is available. Under the Image/Chart 1 property, set the Column to ‘instruct’ and the Mapping Type to ‘passthrough’.
This setting colours the pathway nodes according to the columns (types of evidence) in which the pathway is found to be enriched when considering the initial p-value matrix only one column at a time.
For the sake of convenience, ActivePathways generates the file Legend.pdf which can be added to the enrichment map using an image editing tool.
Merico, Daniele, et al. “Enrichment map: a network-based method for gene-set enrichment visualization and interpretation.” PloS one 5.11 (2010): e13984.
Reimand, Jüri, et al. “Pathway enrichment analysis and visualization of omics data using g: Profiler, GSEA, Cytoscape and EnrichmentMap.” Nature protocols 14.2 (2019): 482.