Introduction

Most phosphoproteomic studies have adopted a phosphosite-level analysis of the data. To enable phosphoproteomic data analysis at the gene level, PhosR implements both site- and gene-centric analyses for detecting changes in kinase activities and signalling pathways through traditional enrichment analyses (over-representation or rank-based gene set test, together referred to as‘1-dimensional enrichment analysis’) as well as 2- and 3-dimensional analyses.

This vignette will perform gene-centric pathway enrichment analyses on the normalised myotube phosphoproteomic dataset using both over-representation and rank–based gene set tests and also provide an example of how directPA can be used to test which kinases are activated upon different stimulations in myotubes using 2-dimensional analyses Yang et al. 2014.

Loading packages and data

First, we will load the PhosR package with few other packages will use for the demonstration purpose.

We will use RUV normalised L6 phosphopreteome data for demonstration of gene-centric pathway analysis. It contains phosphoproteome from three different treatment conditions: (1) AMPK agonist AICAR, (2) insulin (Ins), and (3) in combination (AICAR+Ins).

suppressPackageStartupMessages({
  library(calibrate)
  library(limma)
  library(directPA)
  library(org.Rn.eg.db)
  library(reactome.db)
  library(annotate)
  library(PhosR)
})
data("PhosphoSitePlus")

We will use the ppe_RUV matrix from batch_correction.

1-dimensional enrichment analysis

To enable enrichment analyses on both gene and phosphosite levels, PhosR implements a simple method called phosCollapse which reduces phosphosite level of information to the proteins for performing downstream gene-centric analyses. We will utilise two functions, pathwayOverrepresent and pathwayRankBasedEnrichment, to demonstrate 1-dimensional (over-representation and rank-based gene set test) gene-centric pathway enrichment analysis respectively.

First, extract phosphosite information from the ppe object.

sites = paste(sapply(ppe@GeneSymbol, function(x)x),";",
                 sapply(ppe@Residue, function(x)x),
                 sapply(ppe@Site, function(x)x),
                 ";", sep = "")

Then fit a linear model for each phosphosite.

f <- gsub("_exp\\d", "", colnames(ppe))
X <- model.matrix(~ f - 1)
fit <- lmFit(ppe@assays@data$normalised, X)

Extract top-differentially regulated phosphosites for each condition compared to basal.

table.AICAR <- topTable(eBayes(fit), number=Inf, coef = 1)
table.Ins <- topTable(eBayes(fit), number=Inf, coef = 3)
table.AICARIns <- topTable(eBayes(fit), number=Inf, coef = 2)

DE1.RUV <- c(sum(table.AICAR[,"adj.P.Val"] < 0.05), sum(table.Ins[,"adj.P.Val"] < 0.05), sum(table.AICARIns[,"adj.P.Val"] < 0.05))

# extract top-ranked phosphosites for each group comparison
contrast.matrix1 <- makeContrasts(fAICARIns-fIns, levels=X)  # defining group comparisons
contrast.matrix2 <- makeContrasts(fAICARIns-fAICAR, levels=X)  # defining group comparisons
fit1 <- contrasts.fit(fit, contrast.matrix1)
fit2 <- contrasts.fit(fit, contrast.matrix2)
table.AICARInsVSIns <- topTable(eBayes(fit1), number=Inf)
table.AICARInsVSAICAR <- topTable(eBayes(fit2), number=Inf)

DE2.RUV <- c(sum(table.AICARInsVSIns[,"adj.P.Val"] < 0.05), sum(table.AICARInsVSAICAR[,"adj.P.Val"] < 0.05))

o <- rownames(table.AICARInsVSIns)
Tc <- cbind(table.Ins[o,"logFC"], table.AICAR[o,"logFC"], table.AICARIns[o,"logFC"])

rownames(Tc) <- sites[match(o, rownames(ppe))]
rownames(Tc) <- gsub("(.*)(;[A-Z])([0-9]+)(;)", "\\1;\\3;", rownames(Tc))

colnames(Tc) <- c("Ins", "AICAR", "AICAR+Ins")

Summarize phosphosite-level information to proteins for the downstream gene-centric analysis.

Tc.gene <- phosCollapse(Tc, id=gsub(";.+", "", rownames(Tc)), 
                        stat=apply(abs(Tc), 1, max), by = "max")
geneSet <- names(sort(Tc.gene[,1], 
                        decreasing = TRUE))[seq(round(nrow(Tc.gene) * 0.1))]

head(geneSet)
#> [1] "PPP1R13L" "SYNPO2L"  "AHNAK"    "USP10"    "SENP7"    "ATG2A"

Prepare the Reactome annotation

pathways = as.list(reactomePATHID2EXTID)

path_names = as.list(reactomePATHID2NAME)
name_id = match(names(pathways), names(path_names))
names(pathways) = unlist(path_names)[name_id]

pathways = pathways[which(grepl("Rattus norvegicus", names(pathways), ignore.case = TRUE))]

pathways = lapply(pathways, function(path) {
    gene_name = unname(getSYMBOL(path, data = "org.Rn.eg"))
    toupper(unique(gene_name))
})

Perform 1D gene-centric pathway analysis

path1 <- pathwayOverrepresent(geneSet, annotation=pathways, 
                                universe = rownames(Tc.gene), alter = "greater")
path2 <- pathwayRankBasedEnrichment(Tc.gene[,1], 
                                    annotation=pathways, 
                                    alter = "greater")

Next, we will compare enrichment of pathways (in negative log10 p-values) between the two 1-dimensional pathway enrichment analysis. On the scatter plot, the x-axis and y-axis refer to the p-values derived from the rank-based gene set test and over-representation test, respectively. We find several expected pathways, while these highly enriched pathways are largely in agreement between the two types of enrichment analyses.

lp1 <- -log10(as.numeric(path2[names(pathways),1]))
lp2 <- -log10(as.numeric(path1[names(pathways),1]))
plot(lp1, lp2, ylab="Overrepresentation (-log10 pvalue)", xlab="Rank-based enrichment (-log10 pvalue)", main="Comparison of 1D pathway analyses", xlim = c(0, 10))

# select highly enriched pathways
sel <- which(lp1 > 1.5 & lp2 > 0.9)
textxy(lp1[sel], lp2[sel], gsub("_", " ", gsub("REACTOME_", "", names(pathways)))[sel])

2- and 3-dimensional signalling pathway analysis

One key aspect in studying signalling pathways is to identify key kinases that are involved in signalling cascades. To identify these kinases, we make use of kinase-substrate annotation databases such as PhosphoSitePlus and Phospho.ELM. These databases are included in the PhosR and directPA packages already. To access them, simply load the package and access the data by data(“PhosphoSitePlus”) and data(“PhosphoELM”).

The 2- and 3-dimensional analyses enable the investigation of kinases regulated by different combinations of treatments. We will introduce more advanced methods implemented in the R package directPA for performing “2 and 3-dimentional” direction site-centric kinase activity analyses.

# 2D direction site-centric kinase activity analyses
par(mfrow=c(1,2))
dpa1 <- directPA(Tc[,c(1,3)], direction=0, 
                 annotation=lapply(PhosphoSite.rat, function(x){gsub(";[STY]", ";", x)}), 
                 main="Direction pathway analysis")
dpa2 <- directPA(Tc[,c(1,3)], direction=pi*7/4, 
                 annotation=lapply(PhosphoSite.rat, function(x){gsub(";[STY]", ";", x)}), 
                 main="Direction pathway analysis")


# top activated kinases
dpa1$pathways[1:5,]
#>        pvalue       size
#> AKT1   6.207001e-09 9   
#> MAPK1  0.00057404   9   
#> PRKACA 0.0006825021 25  
#> PRKAA1 0.000965093  6   
#> MAPK3  0.006670176  10
dpa2$pathways[1:5,]
#>         pvalue     size
#> PRKAA1  0.00463462 6   
#> AKT1    0.02942273 9   
#> CSNK2A1 0.2193148  12  
#> CDK5    0.2607434  5   
#> MAPK1   0.2767886  9

There is also a function called perturbPlot2d implemented in kinasePA for testing and visualising activity of all kinases on all possible directions. Below are the demonstration from using this function.

z1 <- perturbPlot2d(Tc=Tc[,c(1,2)], 
                    annotation=lapply(PhosphoSite.rat, function(x){gsub(";[STY]", ";", x)}),
                    cex=1, xlim=c(-2, 4), ylim=c(-2, 4), 
                    main="Kinase perturbation analysis")

z2 <- perturbPlot2d(Tc=Tc[,c(1,3)], annotation=lapply(PhosphoSite.rat, function(x){gsub(";[STY]", ";", x)}),
                    cex=1, xlim=c(-2, 4), ylim=c(-2, 4), 
                    main="Kinase perturbation analysis")

z3 <- perturbPlot2d(Tc=Tc[,c(2,3)], annotation=lapply(PhosphoSite.rat, function(x){gsub(";[STY]", ";", x)}),
                    cex=1, xlim=c(-2, 4), ylim=c(-2, 4), 
                    main="Kinase perturbation analysis")

SessionInfo

sessionInfo()
#> R version 4.2.0 (2022-04-22)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Big Sur/Monterey 10.16
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> attached base packages:
#> [1] stats4    stats     graphics  grDevices utils     datasets  methods  
#> [8] base     
#> 
#> other attached packages:
#>  [1] PhosR_1.5.2          annotate_1.74.0      XML_3.99-0.9        
#>  [4] reactome.db_1.79.0   org.Rn.eg.db_3.15.0  AnnotationDbi_1.58.0
#>  [7] IRanges_2.30.0       S4Vectors_0.34.0     Biobase_2.56.0      
#> [10] BiocGenerics_0.42.0  directPA_1.5         limma_3.52.0        
#> [13] calibrate_1.7.7      MASS_7.3-56         
#> 
#> loaded via a namespace (and not attached):
#>   [1] colorspace_2.0-3            ggsignif_0.6.3             
#>   [3] ellipsis_0.3.2              class_7.3-20               
#>   [5] rprojroot_2.0.3             circlize_0.4.15            
#>   [7] XVector_0.36.0              GenomicRanges_1.48.0       
#>   [9] GlobalOptions_0.1.2         ggdendro_0.1.23            
#>  [11] fs_1.5.2                    proxy_0.4-26               
#>  [13] ggpubr_0.4.0                bit64_4.0.5                
#>  [15] fansi_1.0.3                 cachem_1.0.6               
#>  [17] knitr_1.39                  jsonlite_1.8.0             
#>  [19] broom_0.8.0                 png_0.1-7                  
#>  [21] pheatmap_1.0.12             BiocManager_1.30.17        
#>  [23] compiler_4.2.0              httr_1.4.3                 
#>  [25] backports_1.4.1             Matrix_1.4-1               
#>  [27] fastmap_1.1.0               cli_3.3.0                  
#>  [29] htmltools_0.5.2             tools_4.2.0                
#>  [31] igraph_1.3.1                coda_0.19-4                
#>  [33] gtable_0.3.0                glue_1.6.2                 
#>  [35] GenomeInfoDbData_1.2.8      reshape2_1.4.4             
#>  [37] dplyr_1.0.9                 Rcpp_1.0.8.3               
#>  [39] carData_3.0-5               statnet.common_4.6.0       
#>  [41] jquerylib_0.1.4             pkgdown_2.0.3              
#>  [43] vctrs_0.4.1                 Biostrings_2.64.0          
#>  [45] preprocessCore_1.58.0       xfun_0.31                  
#>  [47] stringr_1.4.0               network_1.17.1             
#>  [49] lifecycle_1.0.1             rstatix_0.7.0              
#>  [51] dendextend_1.15.2           zlibbioc_1.42.0            
#>  [53] scales_1.2.0                BiocStyle_2.24.0           
#>  [55] pcaMethods_1.88.0           ragg_1.2.2                 
#>  [57] MatrixGenerics_1.8.0        SummarizedExperiment_1.26.1
#>  [59] RColorBrewer_1.1-3          yaml_2.3.5                 
#>  [61] memoise_2.0.1               gridExtra_2.3              
#>  [63] ggplot2_3.3.6               sass_0.4.1                 
#>  [65] reshape_0.8.9               stringi_1.7.6              
#>  [67] RSQLite_2.2.14              highr_0.9                  
#>  [69] desc_1.4.1                  e1071_1.7-9                
#>  [71] shape_1.4.6                 GenomeInfoDb_1.32.1        
#>  [73] rlang_1.0.2                 pkgconfig_2.0.3            
#>  [75] systemfonts_1.0.4           bitops_1.0-7               
#>  [77] matrixStats_0.62.0          evaluate_0.15              
#>  [79] lattice_0.20-45             ruv_0.9.7.1                
#>  [81] purrr_0.3.4                 bit_4.0.4                  
#>  [83] tidyselect_1.1.2            GGally_2.1.2               
#>  [85] plyr_1.8.7                  magrittr_2.0.3             
#>  [87] R6_2.5.1                    generics_0.1.2             
#>  [89] DelayedArray_0.22.0         DBI_1.1.2                  
#>  [91] pillar_1.7.0                KEGGREST_1.36.0            
#>  [93] abind_1.4-5                 RCurl_1.98-1.6             
#>  [95] tibble_3.1.7                crayon_1.5.1               
#>  [97] car_3.0-13                  utf8_1.2.2                 
#>  [99] rmarkdown_2.14              viridis_0.6.2              
#> [101] grid_4.2.0                  blob_1.2.3                 
#> [103] digest_0.6.29               xtable_1.8-4               
#> [105] tidyr_1.2.0                 textshaping_0.3.6          
#> [107] munsell_0.5.0               viridisLite_0.4.0          
#> [109] bslib_0.3.1