DOI

Universal Imports + High Quality QC + Differential Expression Analysis = Awesomeness.

Workflow example

knitr::opts_chunk$set(echo = TRUE,
                      message = FALSE,
                      warning = FALSE,
                      collapse = TRUE,
                      comment = "#>", 
                      fig.width = 6, fig.height = 6)

Setup

library(devtools)
library(tibble)
library(plotly)
library(stringr)
devtools::install_github("MassDynamics/MassExpression")
library(MassExpression)
utils::packageVersion("MassExpression")

Internal data available

data(package="MassExpression")

Run workflow with sample data

intensities <- mq_lfq_data$intensities
design <- mq_lfq_data$design
parameters <- mq_lfq_data$parameters
normalisation_method <- parameters[parameters[,1] == "UseNormalisationMethod",2]
species <- parameters[parameters[,1] == "Species",2]
labellingMethod <- parameters[parameters[,1] == "LabellingMethod",2]


results <- runGenericDiscovery(experimentDesign = design, 
                               proteinIntensities = intensities, 
                               normalisationMethod = normalisation_method, 
                               species = species, 
                               labellingMethod = labellingMethod)

IntensityExperiment <- results$IntensityExperiment
CompleteIntensityExperiment <-  results$CompleteIntensityExperiment
longIntensityDT <- results$longIntensityDT
design <- colData(CompleteIntensityExperiment)

results is a list containing two SummarizedExperiment objects:

Generate vignette

tools::buildVignettes(dir = ".", tangle=TRUE)

Save output to display in the app and create QC reports

output_folder <- "path/to/output/folder"

saveOutput(IntensityExperiment = IntensityExperiment, 
CompleteIntensityExperiment = CompleteIntensityExperiment,
longIntensityDT = longIntensityDT, 
outputFolder =  output_folder)

Render QC

# Render and save QC report 
qc_report <- system.file("rmd","QC_report.Rmd", package = "MassExpression")

rmarkdown::render(qc_report,
                  params = list(listInt = results,
                                experiment = "Mass Dynamics QC report",
                                output_figure = file.path(output_folder, "figure_html/"),
                                format = "html"),
                  output_file = file.path(output_folder, "QC_Report.html"),
                  output_format=rmarkdown::html_document(
                            self_contained=FALSE,
                            lib_dir=file.path(output_folder,"qc_report_files"),
                            code_folding= "hide",
                            theme="united",
                            toc = TRUE,
                            toc_float = TRUE,
                            fig_caption= TRUE,
                            df_print="paged"))
# Render PDF
rmarkdown::render(qc_report,
                  params = list(listInt = results,
                                experiment = "Mass Dynamics QC report",
                                output_figure = file.path(output_folder_pdf, "figure_pdf/"),
                                format = "pdf"),
                  output_file = file.path(output_folder_pdf, "QC_Report.pdf"),
                  output_format=rmarkdown::pdf_document(
                    toc = TRUE,
                    fig_caption= TRUE))

Session Information

sessionInfo()


MassDynamics/MassExpression documentation built on May 7, 2023, 11:29 a.m.