vignettes/web/site_gene_analysis.Rmd
site_gene_analysis.RmdWhile 1, 2, and 3D pathway analyses are useful for data generated from experiments with different treatment/conditions, analysis designed for time-course data may be better suited to analysis experiments that profile multiple time points.
Here, we will apply ClueR which is an R package
specifically designed for time-course proteomic and phosphoproteomic
data analysis Yang
et al. 2015.
We will load the PhosR package with few other packages we will use for this tutorial.
suppressPackageStartupMessages({
library(parallel)
library(ggplot2)
library(ClueR)
library(reactome.db)
library(org.Mm.eg.db)
library(annotate)
library(PhosR)
})We will load a dataset integrated from two time-course datasets of early and intermediate insulin signalling in mouse liver upon insulin stimulation to demonstrate the time-course phosphoproteomic data analyses.
data("phospho.liver.Ins.TC.ratio.RUV.pe")
ppe <- phospho.liver.Ins.TC.ratio.RUV.pe
ppe
#> class: PhosphoExperiment
#> dim: 800 90
#> metadata(0):
#> assays(1): Quantification
#> rownames(800): LARP7;256; SRSF10;131; ... SIK3;493; GSK3A;21;
#> rowData names(0):
#> colnames(90): Intensity.Liver_Ins_0s_Bio7 Intensity.Liver_Ins_0s_Bio8
#> ... Intensity.Liver_Ins_10m_Bio5 Intensity.Liver_Ins_10m_Bio6
#> colData names(0):Let us start with gene-centric analysis. Such analysis can be
directly applied to proteomics data. It can also be applied to
phosphoproteomic data by using the phosCollapse function to
summarise phosphosite information to proteins.
# take grouping information
grps <- sapply(strsplit(colnames(ppe), "_"),
function(x)x[3])
# select differentially phosphorylated sites
sites.p <- matANOVA(ppe@assays@data$Quantification,
grps)
ppm <- meanAbundance(ppe@assays@data$Quantification, grps)
sel <- which((sites.p < 0.05) & (rowSums(abs(ppm) > 1) != 0))
ppm_filtered <- ppm[sel,]
# summarise phosphosites information into gene level
ppm_gene <- phosCollapse(ppm_filtered,
gsub(";.+", "", rownames(ppm_filtered)),
stat = apply(abs(ppm_filtered), 1, max), by = "max")
# perform ClueR to identify optimal number of clusters
pathways = as.list(reactomePATHID2EXTID)
pathways = pathways[which(grepl("R-MMU", names(pathways), ignore.case = TRUE))]
pathways = lapply(pathways, function(path) {
gene_name = unname(getSYMBOL(path, data = "org.Mm.eg"))
toupper(unique(gene_name))
})
RNGkind("L'Ecuyer-CMRG")
set.seed(123)
c1 <- runClue(ppm_gene, annotation=pathways,
kRange = seq(2,10), rep = 5, effectiveSize = c(5, 100),
pvalueCutoff = 0.05, alpha = 0.5)
# Visualise the evaluation results
data <- data.frame(Success=as.numeric(c1$evlMat), Freq=rep(seq(2,10), each=5))
myplot <- ggplot(data, aes(x=Freq, y=Success)) +
geom_boxplot(aes(x = factor(Freq), fill="gray")) +
stat_smooth(method="loess", colour="red", size=3, span = 0.5) +
xlab("# of cluster") +
ylab("Enrichment score") +
theme_classic()
myplot
set.seed(123)
best <- clustOptimal(c1, rep=5, mfrow=c(2, 3), visualize = TRUE)
Phosphosite-centric analyses will perform using kinase-substrate annotation information from PhosphoSitePlus.
data("PhosphoSitePlus")
RNGkind("L'Ecuyer-CMRG")
set.seed(1)
PhosphoSite.mouse2 = mapply(function(kinase) {
gsub("(.*)(;[A-Z])([0-9]+;)", "\\1;\\3", kinase)
}, PhosphoSite.mouse)
# perform ClueR to identify optimal number of clusters
c3 <- runClue(ppm_filtered, annotation=PhosphoSite.mouse2, kRange = 2:10, rep = 5, effectiveSize = c(5, 100), pvalueCutoff = 0.05, alpha = 0.5)
# Visualise the evaluation results
data <- data.frame(Success=as.numeric(c3$evlMat), Freq=rep(2:10, each=5))
myplot <- ggplot(data, aes(x=Freq, y=Success)) + geom_boxplot(aes(x = factor(Freq), fill="gray"))+
stat_smooth(method="loess", colour="red", size=3, span = 0.5) + xlab("# of cluster")+ ylab("Enrichment score")+theme_classic()
myplot
set.seed(1)
best <- clustOptimal(c3, rep=10, mfrow=c(2, 3), visualize = TRUE)
# Finding enriched pathways from each cluster
best$enrichList
#> size
#> [1,] "PRKACA" "0.000184676866298047" "5"
#> substrates
#> [1,] "NR1H3;196;|MARCKS;163;|PRKACA;339;|ITPR1;1755;|SIK3;493;"
#>
#> $`cluster 3`
#> kinase pvalue size
#> [1,] "Humphrey.Akt" "0.000162969329853963" "5"
#> [2,] "Yang.Akt" "0.000165386907010959" "6"
#> substrates
#> [1,] "TSC2;939;|PFKFB2;486;|FOXO3;252;|FOXO1;316;|GSK3A;21;"
#> [2,] "AKT1S1;247;|TSC2;939;|PFKFB2;486;|FOXO3;252;|FOXO1;316;|GSK3A;21;"
sessionInfo()
#> R version 4.6.0 (2026-04-24)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 24.04.4 LTS
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0
#>
#> Random number generation:
#> RNG: L'Ecuyer-CMRG
#> Normal: Inversion
#> Sample: Rejection
#>
#> locale:
#> [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
#> [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
#> [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
#> [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: UTC
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats4 parallel stats graphics grDevices utils datasets
#> [8] methods base
#>
#> other attached packages:
#> [1] PhosR_1.20.0 annotate_1.90.0 XML_3.99-0.23
#> [4] org.Mm.eg.db_3.23.0 reactome.db_1.96.0 AnnotationDbi_1.74.0
#> [7] IRanges_2.46.0 S4Vectors_0.50.1 Biobase_2.72.0
#> [10] BiocGenerics_0.58.1 generics_0.1.4 ClueR_1.4.2
#> [13] ggplot2_4.0.3
#>
#> loaded via a namespace (and not attached):
#> [1] DBI_1.3.0 gridExtra_2.3
#> [3] rlang_1.2.0 magrittr_2.0.5
#> [5] otel_0.2.0 matrixStats_1.5.0
#> [7] e1071_1.7-17 compiler_4.6.0
#> [9] RSQLite_3.53.1 mgcv_1.9-4
#> [11] reshape2_1.4.5 png_0.1-9
#> [13] systemfonts_1.3.2 vctrs_0.7.3
#> [15] stringr_1.6.0 pkgconfig_2.0.3
#> [17] shape_1.4.6.1 crayon_1.5.3
#> [19] fastmap_1.2.0 backports_1.5.1
#> [21] XVector_0.52.0 labeling_0.4.3
#> [23] rmarkdown_2.31 preprocessCore_1.74.0
#> [25] ragg_1.5.2 network_1.20.0
#> [27] purrr_1.2.2 bit_4.6.0
#> [29] xfun_0.58 cachem_1.1.0
#> [31] jsonlite_2.0.0 blob_1.3.0
#> [33] DelayedArray_0.38.2 broom_1.0.13
#> [35] R6_2.6.1 stringi_1.8.7
#> [37] bslib_0.11.0 RColorBrewer_1.1-3
#> [39] limma_3.68.4 GGally_2.4.0
#> [41] car_3.1-5 GenomicRanges_1.64.0
#> [43] jquerylib_0.1.4 Rcpp_1.1.1-1.1
#> [45] Seqinfo_1.2.0 SummarizedExperiment_1.42.0
#> [47] knitr_1.51 splines_4.6.0
#> [49] Matrix_1.7-5 igraph_2.3.2
#> [51] tidyselect_1.2.1 abind_1.4-8
#> [53] yaml_2.3.12 viridis_0.6.5
#> [55] plyr_1.8.9 lattice_0.22-9
#> [57] tibble_3.3.1 withr_3.0.2
#> [59] KEGGREST_1.52.0 S7_0.2.2
#> [61] coda_0.19-4.1 evaluate_1.0.5
#> [63] desc_1.4.3 ggstats_0.13.0
#> [65] proxy_0.4-29 circlize_0.4.18
#> [67] Biostrings_2.80.1 pillar_1.11.1
#> [69] BiocManager_1.30.27 ggpubr_0.6.3
#> [71] MatrixGenerics_1.24.0 carData_3.0-6
#> [73] scales_1.4.0 BiocStyle_2.40.0
#> [75] xtable_1.8-8 class_7.3-23
#> [77] glue_1.8.1 pheatmap_1.0.13
#> [79] tools_4.6.0 dendextend_1.19.1
#> [81] ggsignif_0.6.4 fs_2.1.0
#> [83] grid_4.6.0 tidyr_1.3.2
#> [85] colorspace_2.1-2 nlme_3.1-169
#> [87] Formula_1.2-5 cli_3.6.6
#> [89] ruv_0.9.7.1 textshaping_1.0.5
#> [91] S4Arrays_1.12.0 viridisLite_0.4.3
#> [93] ggdendro_0.2.0 dplyr_1.2.1
#> [95] pcaMethods_2.4.0 gtable_0.3.6
#> [97] rstatix_0.7.3 sass_0.4.10
#> [99] digest_0.6.39 SparseArray_1.12.2
#> [101] htmlwidgets_1.6.4 farver_2.1.2
#> [103] memoise_2.0.1 htmltools_0.5.9
#> [105] pkgdown_2.2.0 lifecycle_1.0.5
#> [107] httr_1.4.8 statnet.common_4.13.0
#> [109] statmod_1.5.2 GlobalOptions_0.1.4
#> [111] bit64_4.8.2 MASS_7.3-65