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.2 (2022-10-31)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Big Sur ... 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.9.1          annotate_1.76.0      XML_3.99-0.12       
#>  [4] reactome.db_1.82.0   org.Rn.eg.db_3.16.0  AnnotationDbi_1.60.0
#>  [7] IRanges_2.32.0       S4Vectors_0.36.0     Biobase_2.58.0      
#> [10] BiocGenerics_0.44.0  directPA_1.5         limma_3.54.0        
#> [13] calibrate_1.7.7      MASS_7.3-58.1       
#> 
#> loaded via a namespace (and not attached):
#>   [1] colorspace_2.0-3            ggsignif_0.6.4             
#>   [3] class_7.3-20                rprojroot_2.0.3            
#>   [5] circlize_0.4.15             XVector_0.38.0             
#>   [7] GenomicRanges_1.50.1        GlobalOptions_0.1.2        
#>   [9] ggdendro_0.1.23             fs_1.5.2                   
#>  [11] proxy_0.4-27                ggpubr_0.5.0               
#>  [13] bit64_4.0.5                 fansi_1.0.3                
#>  [15] cachem_1.0.6                knitr_1.41                 
#>  [17] jsonlite_1.8.3              broom_1.0.1                
#>  [19] png_0.1-8                   pheatmap_1.0.12            
#>  [21] BiocManager_1.30.19         compiler_4.2.2             
#>  [23] httr_1.4.4                  backports_1.4.1            
#>  [25] Matrix_1.5-1                fastmap_1.1.0              
#>  [27] cli_3.4.1                   htmltools_0.5.3            
#>  [29] tools_4.2.2                 igraph_1.3.5               
#>  [31] coda_0.19-4                 gtable_0.3.1               
#>  [33] glue_1.6.2                  GenomeInfoDbData_1.2.9     
#>  [35] reshape2_1.4.4              dplyr_1.0.10               
#>  [37] Rcpp_1.0.9                  carData_3.0-5              
#>  [39] statnet.common_4.7.0        jquerylib_0.1.4            
#>  [41] pkgdown_2.0.6               vctrs_0.5.1                
#>  [43] Biostrings_2.66.0           preprocessCore_1.60.0      
#>  [45] xfun_0.35                   stringr_1.4.1              
#>  [47] network_1.18.0              lifecycle_1.0.3            
#>  [49] rstatix_0.7.1               dendextend_1.16.0          
#>  [51] zlibbioc_1.44.0             scales_1.2.1               
#>  [53] BiocStyle_2.26.0            pcaMethods_1.90.0          
#>  [55] ragg_1.2.4                  MatrixGenerics_1.10.0      
#>  [57] SummarizedExperiment_1.28.0 RColorBrewer_1.1-3         
#>  [59] yaml_2.3.6                  memoise_2.0.1              
#>  [61] gridExtra_2.3               ggplot2_3.4.0              
#>  [63] sass_0.4.4                  reshape_0.8.9              
#>  [65] stringi_1.7.8               RSQLite_2.2.19             
#>  [67] highr_0.9                   desc_1.4.2                 
#>  [69] e1071_1.7-12                shape_1.4.6                
#>  [71] GenomeInfoDb_1.34.3         rlang_1.0.6                
#>  [73] pkgconfig_2.0.3             systemfonts_1.0.4          
#>  [75] bitops_1.0-7                matrixStats_0.63.0         
#>  [77] evaluate_0.18               lattice_0.20-45            
#>  [79] ruv_0.9.7.1                 purrr_0.3.5                
#>  [81] bit_4.0.5                   tidyselect_1.2.0           
#>  [83] GGally_2.1.2                plyr_1.8.8                 
#>  [85] magrittr_2.0.3              R6_2.5.1                   
#>  [87] generics_0.1.3              DelayedArray_0.24.0        
#>  [89] DBI_1.1.3                   pillar_1.8.1               
#>  [91] KEGGREST_1.38.0             abind_1.4-5                
#>  [93] RCurl_1.98-1.9              tibble_3.1.8               
#>  [95] crayon_1.5.2                car_3.1-1                  
#>  [97] utf8_1.2.2                  rmarkdown_2.18             
#>  [99] viridis_0.6.2               grid_4.2.2                 
#> [101] blob_1.2.3                  digest_0.6.30              
#> [103] xtable_1.8-4                tidyr_1.2.1                
#> [105] textshaping_0.3.6           munsell_0.5.0              
#> [107] viridisLite_0.4.1           bslib_0.4.1