PTM Analysis

Installation

Run this code below to install MSstatsBioNet from bioconductor

if (!require("BiocManager", quietly = TRUE)) {
    install.packages("BiocManager")
}

BiocManager::install("MSstatsBioNet")

Dataset

We will be taking a subset of the dataset found in this paper. The table is the output of the MSstatsPTM function groupComparisonPTM (filtered down to the columns that are actually needed)

input = data.table::fread(system.file(
    "extdata/garrido-2024.csv",
    package = "MSstatsBioNet"
))
head(input)
#>               Protein    Label     log2FC         SE    DF      pvalue
#>                <char>   <char>      <num>      <num> <int>       <num>
#> 1: P00533_S1039_S1042 t0 vs t1 -0.3200363 0.14994312     9 0.061580951
#> 2:       P00533_S1064 t0 vs t1  0.3566531 0.08915347     9 0.003108364
#> 3:   P00533_S991_S995 t0 vs t1 -0.1229037 0.10858298     9 0.286937655
#> 4:        P00533_T693 t0 vs t1 -0.0233444 0.17724459     9 0.898113182
#> 5:   P00533_T693_S695 t0 vs t1 -0.1659957 0.15000754     9 0.297173769
#> 6:       P00533_Y1110 t0 vs t1  0.2106324 0.09279031     9 0.049364434
#>    adj.pvalue  issue
#>         <num> <lgcl>
#> 1: 0.28024590     NA
#> 2: 0.06863598     NA
#> 3: 0.57907374     NA
#> 4: 0.96083634     NA
#> 5: 0.58809108     NA
#> 6: 0.25258914     NA

ID Conversion

First, we need to convert the group comparison results to a format that can be processed by INDRA. We can use the annotateProteinInfoFromIndra function to obtain these mappings.

In the below example, we convert uniprot IDs to their corresponding Hgnc IDs. We can also extract other information, such as hgnc gene name and protein function.

library(MSstatsBioNet)
annotated_df = annotateProteinInfoFromIndra(input, "Uniprot")
head(annotated_df)
#>               Protein    Label     log2FC         SE    DF      pvalue
#>                <char>   <char>      <num>      <num> <int>       <num>
#> 1: P00533_S1039_S1042 t0 vs t1 -0.3200363 0.14994312     9 0.061580951
#> 2:       P00533_S1064 t0 vs t1  0.3566531 0.08915347     9 0.003108364
#> 3:   P00533_S991_S995 t0 vs t1 -0.1229037 0.10858298     9 0.286937655
#> 4:        P00533_T693 t0 vs t1 -0.0233444 0.17724459     9 0.898113182
#> 5:   P00533_T693_S695 t0 vs t1 -0.1659957 0.15000754     9 0.297173769
#> 6:       P00533_Y1110 t0 vs t1  0.2106324 0.09279031     9 0.049364434
#>    adj.pvalue  issue GlobalProtein UniprotId EntityNamespace EntityId
#>         <num> <lgcl>        <char>    <char>          <char>   <char>
#> 1: 0.28024590     NA        P00533    P00533            HGNC     3236
#> 2: 0.06863598     NA        P00533    P00533            HGNC     3236
#> 3: 0.57907374     NA        P00533    P00533            HGNC     3236
#> 4: 0.96083634     NA        P00533    P00533            HGNC     3236
#> 5: 0.58809108     NA        P00533    P00533            HGNC     3236
#> 6: 0.25258914     NA        P00533    P00533            HGNC     3236
#>    EntityName IsTranscriptionFactor IsKinase IsPhosphatase
#>        <char>                <lgcl>   <lgcl>        <lgcl>
#> 1:       EGFR                 FALSE     TRUE         FALSE
#> 2:       EGFR                 FALSE     TRUE         FALSE
#> 3:       EGFR                 FALSE     TRUE         FALSE
#> 4:       EGFR                 FALSE     TRUE         FALSE
#> 5:       EGFR                 FALSE     TRUE         FALSE
#> 6:       EGFR                 FALSE     TRUE         FALSE

Subnetwork Query

The package provides a function getSubnetworkFromIndra that retrieves a subnetwork of proteins from the INDRA database based on differential abundance analysis results. This function may help finding off target subnetworks.

subnetwork <- getSubnetworkFromIndra(annotated_df, pvalueCutoff = 0.05, statement_types = c("Phosphorylation"), logfc_cutoff = 1, force_include_other = c("HGNC:3236"))
#> INDRA subnetwork: how are 11 selected PTM sites and 1 added entity connected to each other, with no other nodes added?
#> Warning in getSubnetworkFromIndra(annotated_df, pvalueCutoff = 0.05, statement_types = c("Phosphorylation"), : NOTICE: This function includes third-party software components
#>         that are licensed under the BSD 2-Clause License. Please ensure to
#>         include the third-party licensing agreements if redistributing this
#>         package or utilizing the results based on this package.
#>         See the LICENSE file for more details.
head(subnetwork$nodes)
#>       id entity_type entity_name namespace entity_id measured included_in_query
#> 1 P00533    ptm_site        EGFR      HGNC      3236     TRUE              TRUE
#> 2 P00533    ptm_site        EGFR      HGNC      3236     TRUE              TRUE
#> 3 P00533    ptm_site        EGFR      HGNC      3236     TRUE              TRUE
#> 4 P00533    ptm_site        EGFR      HGNC      3236     TRUE              TRUE
#> 5 P00533    ptm_site        EGFR      HGNC      3236     TRUE              TRUE
#> 6 P00533    ptm_site        EGFR      HGNC      3236     TRUE              TRUE
#>    node_role        site has_measured_sites      logFC adj.pvalue
#> 1 user_added S1039_S1042               TRUE -0.3200363 0.28024590
#> 2 user_added       S1064               TRUE  0.3566531 0.06863598
#> 3 user_added   S991_S995               TRUE -0.1229037 0.57907374
#> 4 user_added        T693               TRUE -0.0233444 0.96083634
#> 5 user_added   T693_S695               TRUE -0.1659957 0.58809108
#> 6 user_added       Y1110               TRUE  0.2106324 0.25258914
head(subnetwork$edges)
#>   source target     interaction directed site confidence evidence_count
#> 1 P28482 P00533 Phosphorylation     TRUE T693  0.7828815              5
#> 2 P00533 Q13480 Phosphorylation     TRUE Y589  0.8034668              4
#> 3 P28482 Q13480 Phosphorylation     TRUE S551  0.6600850              2
#> 4 P28482 P00533 Phosphorylation     TRUE <NA>  0.8417233              4
#> 5 P00533 Q13480 Phosphorylation     TRUE Y659  0.8030378             12
#> 6 P00533 Q13480 Phosphorylation     TRUE Y317  0.5316003              1
#>                                                               evidence_url
#> 1 https://db.indra.bio/statements/from_hash/-27349256206351689?format=html
#> 2   https://db.indra.bio/statements/from_hash/8278162666099689?format=html
#> 3  https://db.indra.bio/statements/from_hash/-4764665757498136?format=html
#> 4  https://db.indra.bio/statements/from_hash/16405949435170631?format=html
#> 5  https://db.indra.bio/statements/from_hash/28792790420132101?format=html
#> 6  https://db.indra.bio/statements/from_hash/16300905780198239?format=html
#>         statement_id backend_database query_type
#> 1 -27349256206351689            INDRA subnetwork
#> 2   8278162666099689            INDRA subnetwork
#> 3  -4764665757498136            INDRA subnetwork
#> 4  16405949435170631            INDRA subnetwork
#> 5  28792790420132101            INDRA subnetwork
#> 6  16300905780198239            INDRA subnetwork
#>                                             evidence_sources paperCount
#> 1 {"sparser": 1, "reach": 1, "pe": 1, "psp": 1, "signor": 1}          1
#> 2                {"pe": 1, "hprd": 1, "psp": 1, "signor": 1}          1
#> 3                                   {"hprd": 1, "signor": 1}          1
#> 4                                 {"sparser": 2, "reach": 2}          1
#> 5       {"pc": 1, "pe": 1, "hprd": 8, "psp": 1, "signor": 1}          1
#> 6                                              {"rlimsp": 1}          1

Network Visualization

Visualize the subnetwork on your browser

previewNetworkInBrowser(subnetwork$nodes, subnetwork$edges, displayLabelType = "entity_name")

Session info

sessionInfo()
#> R version 4.6.1 (2026-06-24)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 26.04.1 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.32.so;  LAPACK version 3.12.0
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> time zone: Etc/UTC
#> tzcode source: system (glibc)
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] MSstatsConvert_1.23.5 rmarkdown_2.32        shiny_1.14.0         
#> [4] MSstatsBioNet_1.5.4   MSstats_4.21.1        BiocStyle_2.41.0     
#> 
#> loaded via a namespace (and not attached):
#>  [1] tidyselect_1.2.1      viridisLite_0.4.3     dplyr_1.2.1          
#>  [4] farver_2.1.2          S7_0.2.2              bitops_1.1-0         
#>  [7] fastmap_1.2.0         promises_1.5.0        XML_3.99-0.25        
#> [10] digest_0.6.39         mime_0.13             lifecycle_1.0.5      
#> [13] survival_3.8-12       statmod_1.5.2         magrittr_2.0.5       
#> [16] compiler_4.6.1        r2r_0.1.2             rlang_1.3.0          
#> [19] sass_0.4.10           tools_4.6.1           yaml_2.3.12          
#> [22] data.table_1.18.6.1   knitr_1.52            stopwords_2.3        
#> [25] htmlwidgets_1.6.4     curl_8.0.0            marray_1.91.0        
#> [28] xml2_1.6.0            RColorBrewer_1.1-3    KernSmooth_2.23-27   
#> [31] purrr_1.2.2           sys_3.4.3             grid_4.6.1           
#> [34] preprocessCore_1.75.1 caTools_1.18.4        xtable_1.8-8         
#> [37] ggplot2_4.0.3         scales_1.4.0          gtools_3.9.5         
#> [40] MASS_7.3-66           cli_3.6.6             crayon_1.5.3         
#> [43] reformulas_0.4.4      generics_0.1.4        otel_0.2.0           
#> [46] httr_1.4.9            minqa_1.2.8           cachem_1.1.0         
#> [49] splines_4.6.1         parallel_4.6.1        BiocManager_1.30.27  
#> [52] vctrs_0.7.3           boot_1.3-32           Matrix_1.7-6         
#> [55] jsonlite_2.0.0        ggrepel_0.9.8         maketools_1.3.2      
#> [58] limma_3.99.0          plotly_4.12.1         lgr_0.5.2            
#> [61] tidyr_1.3.2           jquerylib_0.1.4       glue_1.8.1           
#> [64] nloptr_2.2.1          stringi_1.8.9         gtable_0.3.6         
#> [67] later_1.4.8           lme4_2.0-6            mlapi_0.1.1          
#> [70] tibble_3.3.1          pillar_1.11.1         htmltools_0.5.9      
#> [73] gplots_3.3.0          float_0.3-4           rsparse_0.5.3        
#> [76] R6_2.6.1              Rdpack_2.6.6          evaluate_1.0.5       
#> [79] lattice_0.23-1        rentrez_1.2.4         rbibutils_2.4.1      
#> [82] backports_1.5.1       RhpcBLASctl_0.23-42   memoise_2.0.1        
#> [85] httpuv_1.6.17         bslib_0.12.0          text2vec_0.6.6       
#> [88] Rcpp_1.1.2            nlme_3.1-171          checkmate_2.3.4      
#> [91] xfun_0.61             buildtools_1.0.0      pkgconfig_2.0.3