Drafts the Material-and-Methods paragraph describing the analyses stored in a
DEprot or DEprot.analyses object. All the steps that left a trace in the object are
described in the order in which they were applied (normalization or batch correction,
bottom-distribution randomization, imputation, differential analyses and, when the corresponding
object is provided, geneset enrichment), together with the parameters that affect the results and
would be needed to reproduce them. Tools are cited with numbers in the text and the reference list
is printed underneath.
The paragraph is a draft: the numbers and the parameters are read from the object, but the wording
is expected to be adapted to the study and to the style of the journal. Steps that happen upstream
of DEprot (sample preparation, LC-MS/MS acquisition, database search) are not stored in the
object; the search engine can be mentioned through quantification.software, everything else
must be added by hand.
generate.mm(
DEprot.object,
enrichment.object = NULL,
quantification.software = NULL,
quantification.reference = NULL,
geneset.database = NULL,
geneset.reference = NULL,
contrasts = NULL,
include.results.summary = TRUE,
include.package.versions = TRUE,
extra.references = NULL,
add.headers = TRUE,
wrap.width = 100,
output.file = NULL,
verbose = TRUE
)An object of class DEprot or DEprot.analyses.
An object of class DEprot.enrichResult, as generated by geneset.enrichment, to describe the enrichment analyses as well. Default: NULL (no enrichment paragraph).
String naming the software used to generate the protein intensities, version included (e.g., "MaxQuant (v2.4.2)"). Default: NULL, in which case the sentence is left generic.
String with the citation of quantification.software. When provided, it is cited in the text and becomes the first entry of the reference list. Default: NULL.
String naming the geneset collection used for the enrichment (e.g., "CORUM v5.0", "MSigDB Hallmark"). Ignored when enrichment.object is NULL. Default: NULL.
String with the citation of geneset.database. Default: NULL.
Numeric vector indicating which contrasts should be described. Default: NULL (all the contrasts available in the object).
Logical value defining whether the number of differential proteins per contrast should be reported. Default: TRUE.
Logical value defining whether the version of the packages installed in the current session should be appended to the corresponding references. Default: TRUE.
String vector of citations to append, unnumbered in the text, at the end of the reference list. Default: NULL.
Logical value defining whether the 'Material and Methods' and 'References' headers should be added. Default: TRUE.
Numeric value indicating the number of characters per line used to wrap the text. Set to NULL to keep each paragraph on a single line (useful when pasting into a word processor). Default: 100.
String with the path of a text file in which the result should be written. Default: NULL (no file written).
Logical value defining whether the text should be printed in the console. Default: TRUE.
Invisibly, a list containing:
text: string with the numbered Material-and-Methods paragraphs
references: data.frame with the number, the key and the citation of each reference
parameters: data.frame collecting the parameters mentioned in the text
full.text: string combining text and reference list, as printed and as written in output.file
# Draft for a differential analysis
mm <- generate.mm(DEprot.object = DEprot::test.toolbox$diff.exp.limma)
#> MATERIAL AND METHODS
#>
#> Protein-level label-free quantification (LFQ) intensities were processed in R (v4.6.1) (1) with the
#> DEprot package (v2.1.0) (2,3). The matrix used for the analyses covers 50 proteins across 12
#> samples and the intensities are log2-transformed. Samples are annotated by the following variables:
#> sample.id, cell, condition, combined.id, replicate. Intensities were normalized across samples by
#> mean/median-balanced quantile normalization (MBQN) (4), an implementation of quantile normalization
#> in which rank-invariant and nearly rank-invariant features are centred before the normalization, so
#> that their profile is not flattened. Features were balanced on their median and the rank-invariance
#> frequency threshold above which the balancing is applied was set to 0.5. Proteins missing in at
#> least 75% of the samples of a given 'combined.id' group were treated as missing not at random: for
#> those groups, values were drawn at random from the bottom 3% of the intensity distribution of each
#> sample (random seed 22488). This step keeps the difference between a protein that is absent in one
#> condition and a protein that was simply not detected, which the imputation would otherwise blur.
#> The remaining missing values were imputed on the randomized intensities using missForest (5), a
#> non-parametric random-forest procedure that predicts each protein from all the others and iterates
#> until the change in the imputed values stops decreasing (at most 100 iterations). The random seed
#> was set to 330344624. The mean out-of-bag error across proteins was 0.181.
#>
#> Differential protein abundance was tested on the imputed intensities using linear models with
#> empirical Bayes moderation of the protein-wise variances, as implemented in limma (6) ('ls'
#> fitting), including 'replicate' in the design to account for the paired structure of the
#> experiment. The following comparisons were performed: FBS versus 6h.DMSO (n = 4 and n = 4,
#> 'condition' variable); 6h.10nM.E2 versus 6h.DMSO (n = 4 and n = 4, 'condition' variable). P-values
#> were corrected for multiple testing with the Benjamini-Hochberg procedure (7). Proteins were called
#> differentially abundant when the adjusted p-value was below 0.05 and the absolute log2(fold change)
#> was above 1 (linear fold change of 2). Proteins with a linear fold change between 0.909 and 1.1
#> were annotated as unresponsive. These thresholds returned 4 proteins in FBS versus 6h.DMSO (2
#> enriched in FBS, 2 enriched in 6h.DMSO); 0 proteins in 6h.10nM.E2 versus 6h.DMSO (0 enriched in
#> 6h.10nM.E2, 0 enriched in 6h.DMSO). Sample similarity was inspected before and after processing
#> through the distribution of the intensities, principal component analysis and hierarchical
#> clustering of the pairwise Pearson and Spearman correlation coefficients, all computed on the same
#> matrix used for the tests.
#>
#> REFERENCES
#>
#> 1. R Core Team. R: a language and environment for statistical computing. R Foundation for
#> Statistical Computing, Vienna, Austria. https://www.R-project.org/
#> 2. Eickhoff N., Hoekman L., Bleijerveld O., Bergman A.M., Zwart W., Gregoricchio S. DEprot: a
#> comprehensive R-package for the analyses of label-free quantitation mass-spectrometry data. NAR
#> Genomics and Bioinformatics 8(1), 2026. doi: 10.1093/nargab/lqag015 [R-package v2.1.0]
#> 3. Gregoricchio S. sebastian-gregoricchio/DEprot. Zenodo. doi: 10.5281/zenodo.18233890 [R-package
#> v2.1.0]
#> 4. Brombacher E., Schad A., Kreutz C. Tail-robust quantile normalization. Proteomics 20(24),
#> 2000068, 2020. doi: 10.1002/pmic.202000068 [R-package v2.24.0]
#> 5. Stekhoven D.J., Buhlmann P. MissForest: non-parametric missing value imputation for mixed-type
#> data. Bioinformatics 28(1), 112-118, 2012. doi: 10.1093/bioinformatics/btr597 [R-package v1.6.1]
#> 6. Ritchie M.E., Phipson B., Wu D., Hu Y., Law C.W., Shi W., Smyth G.K. limma powers differential
#> expression analyses for RNA-sequencing and microarray studies. Nucleic Acids Research 43(7), e47,
#> 2015. doi: 10.1093/nar/gkv007 [R-package v3.68.5]
#> 7. Benjamini Y., Hochberg Y. Controlling the false discovery rate: a practical and powerful
#> approach to multiple testing. Journal of the Royal Statistical Society B 57(1), 289-300, 1995.
# Same, mentioning the search engine and writing the text to a file
if (FALSE) { # \dontrun{
mm <- generate.mm(DEprot.object = DEprot::test.toolbox$diff.exp.limma,
quantification.software = "MaxQuant (v2.4.2)",
quantification.reference = paste0("Cox J., Mann M. MaxQuant ",
"enables high peptide ",
"identification rates. ",
"Nature Biotechnology 26, ",
"1367-1372, 2008. ",
"doi: 10.1038/nbt.1511"),
output.file = "material.and.methods.txt")
} # }