MSstatsTMTPTM Example: An example workflow and analysis of the MSstatsTMTPTM package

Devon Kohler (



This Vignette provides an example workflow for how to use the package MSstatsTMTPTM. It also provides examples and an analysis of how adjusting for global protein levels allows for better interpretations of PTM modeling results.


To install this package, start R (version “4.0”) and enter:

if (!requireNamespace("BiocManager", quietly = TRUE))


1. Workflow

1.1 Raw Data Format

The first step is to load in the raw dataset for both the PTM and Protein datasets. This can be the output of the MSstatsTMT converter functions: PDtoMSstatsTMTFormat, SpectroMinetoMSstatsTMTFormat, and OpenMStoMSstatsTMTFormat. Both the PTM and protein datasets must include the following columns: ProteinName, PeptideSequence, Charge, PSM, Mixture, TechRepMixture, Run, Channel, Condition, BioReplicate, and Intensity.

1.2 proteinSummarization

After loading in the input data, the next step is to use the proteinSummarization function from MSstatsTMT. This provides the summarized dataset needed to model the protein/PTM abundance. The summarization for PTM and Protein datasets should be done separately. The function will summarize the Protein dataset up to the protein level and will summarize the PTM dataset up to the PTM level. The different summarizations are caused by adding the PTM site into the ProteinName field. For details about normalization and imputation options in proteinSummarization please review the package documentation here: MSstatsTMT Package.

1.3 groupComparisonTMTPTM

After the two datasets are summarized, both the summarized PTM and protein datasets should be used in the modeling function groupComparisonTMTPTM. First a full pairwise comparison is made between all conditions in the experiment.

Optionally, a specific contrast matrix can be defined. Below is an example of a contrast matrix and how it is passed into the groupComparisonTMTPTM function.

The modeling function will return a list consisting of three dataframes.One each for the PTM-level, Protein-level, and adjusted PTM-level group comparison result.

1.4 Example Volcano Plot

The models from the groupComparisonTMTPTM function can be used in the model visualization function, groupComparisonPlots, from the base MSstats. Below is a Volcano Plot for the Adjusted PTM model. Note: the input for groupComparisonPlots should be one data.frame from output of groupComparisonTMTPTM.

2. Analysis

2.1 How to adjust PTMs for changes in global protein levels?

In order to adjust the PTM abundance for global protein abundance there are two main steps. First the PTM and global protein datasets must be modeled and then the resulting model parameters are combined. The combination is done using the formulas below:

Log2FC: \(\log_2FC_{PTM} - \log_2FC_{Protein}\)

SE: \(\sqrt{SE_{PTM}^2 + SE_{Protein}^2}\)

DF: \((SE_{PTM}^2 + SE_{Protein}^2)^2 \biggm/ (\frac{SE_{PTM}^2}{DF_{PTM}} + \frac{SE_{Protein}^2}{DF_{Protein}})\)

Please see the package MSstatsPTM for further explanation of adjustment strategy and formulas.

2.2 Example PTM

#> Drew the Profile plot with summarization for  Protein_2391_Y40 ( 1  of  1 )

In the plots above the data points for the PTM Protein_2391_Y40 and Protein Protein_2391 are shown for all conditions. To take a look at a specific comparison, the input data can be filtered.

The example above shows the added insight of adjusting for Protein level. Originally the PTM model shows a small positive log2FC of 0.144. However, the global protein abundance changed strongly in the negative direction, -0.508. When the PTM is adjusted for the global the log2FC is increased to 0.652, which is a much larger absolute change than without adjustment. The change in abundance of this PTM may have been marked as insignificant without adjusting for protein levels. Note the change in SE and DF once the PTM model is adjusted.

Additionally, there are other situations where the PTM log2FC will be reduced after adjustment.

Note - In this example Protein_1076 was only available in one run of the global protein experiment.

In this example the PTM model originally showed a large log2FC of 0.242, however most of this log2FC was due to the global protein abundance change which was 0.356. Once adjusted, the PTM shows a much smaller log2FC of -0.114. Without adjustment a potentially incorrect inference could have been drawn for this PTM.

From these two examples the added insight into PTM abundance change from protein adjustment can be observed. If the goal of the experiment is to find the true abundance change due to PTMs than removing the effect of the protein is very important.

Session information

#> R Under development (unstable) (2021-03-18 r80099)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 20.04.2 LTS
#> Matrix products: default
#> BLAS:   /home/biocbuild/bbs-3.13-bioc/R/lib/
#> LAPACK: /home/biocbuild/bbs-3.13-bioc/R/lib/
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=C              
#>  [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            
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> other attached packages:
#> [1] dplyr_1.0.5         MSstats_3.23.1      MSstatsTMT_1.9.2   
#> [4] MSstatsTMTPTM_1.1.2
#> loaded via a namespace (and not attached):
#>  [1] sass_0.3.1            tidyr_1.1.3           jsonlite_1.7.2       
#>  [4] splines_4.1.0         foreach_1.5.1         gtools_3.8.2         
#>  [7] bslib_0.2.4           assertthat_0.2.1      statmod_1.4.35       
#> [10] highr_0.8             yaml_2.2.1            ggrepel_0.9.1        
#> [13] numDeriv_2016.8-1.1   pillar_1.5.1          backports_1.2.1      
#> [16] lattice_0.20-41       glue_1.4.2            limma_3.47.10        
#> [19] doSNOW_1.0.19         digest_0.6.27         minqa_1.2.4          
#> [22] colorspace_2.0-0      htmltools_0.5.1.1     preprocessCore_1.53.2
#> [25] Matrix_1.3-2          plyr_1.8.6            pkgconfig_2.0.3      
#> [28] broom_0.7.5           purrr_0.3.4           scales_1.1.1         
#> [31] snow_0.4-3            lme4_1.1-26           tibble_3.1.0         
#> [34] farver_2.1.0          generics_0.1.0        ggplot2_3.3.3        
#> [37] ellipsis_0.3.1        cli_2.3.1             survival_3.2-10      
#> [40] magrittr_2.0.1        crayon_1.4.1          ps_1.6.0             
#> [43] evaluate_0.14         fansi_0.4.2           nlme_3.1-152         
#> [46] MASS_7.3-53.1         gplots_3.1.1          tools_4.1.0          
#> [49] data.table_1.14.0     minpack.lm_1.2-1      lifecycle_1.0.0      
#> [52] matrixStats_0.58.0    stringr_1.4.0         munsell_0.5.0        
#> [55] compiler_4.1.0        jquerylib_0.1.3       caTools_1.18.1       
#> [58] rlang_0.4.10          debugme_1.1.0         grid_4.1.0           
#> [61] nloptr_1.2.2.2        rstudioapi_0.13       iterators_1.0.13     
#> [64] marray_1.69.0         labeling_0.4.2        bitops_1.0-6         
#> [67] rmarkdown_2.7         boot_1.3-27           gtable_0.3.0         
#> [70] codetools_0.2-18      lmerTest_3.1-3        DBI_1.1.1            
#> [73] reshape2_1.4.4        R6_2.5.0              gridExtra_2.3        
#> [76] knitr_1.31            utf8_1.2.1            KernSmooth_2.23-18   
#> [79] stringi_1.5.3         parallel_4.1.0        Rcpp_1.0.6           
#> [82] vctrs_0.3.6           tidyselect_1.1.0      xfun_0.22