Skip to contents

Tutorial

Time ~10 min  ·  Level Beginner  ·  Prerequisites Your First Analysis

Analytical Data

Analytical data, such as pre-processed measurement data (e.g., peak areas), can be imported from various software platforms. MRMhub currently supports data import from INTEGRATOR (the bundled peak picker, via import_data_mrmhub()), Agilent MassHunter Quantitative Analysis (CSV), Skyline (CSV), and generic wide- or long-format CSV files.

When importing data files generated by these platforms, it is important not to manually edit the files before importing. Manual edits can lead to file corruption or accidental errors in the data. MRMhub emphasises reproducible and automated workflows, so manual editing of data files is discouraged.

library(mrmhub)
# Add analysis data from file generated by MRMhub
mexp <- MRMhubExperiment()
mexp <- import_data_mrmhub(mexp, 
                           path = "datasets/sPerfect_MRMhub.tsv", 
                           import_metadata = TRUE)

# Add analysis data from a CSV file (replaces all previous data)
mexp2 <- MRMhubExperiment()
mexp2 <- import_data_csv_wide(mexp2,
                        path = "data/plain_wide_dataset.csv",
                        variable_name = "area",
                        import_metadata = TRUE)

See Importing analytical data for more details on importing analysis data.

Metadata

Metadata, referring to analysis metadata, i.e., data that describe/annotates the analytical data at analysis/sample and feature level, are essential data in the MRMhub workflow.

Metadata can be retrieved from the imported analysis data file as far as available. More commonly, additional or all required metadata needs to be imported from other sources. Which metadata tables are required depends on the intended processing workflow, see Data and Metadata in MRMhub for an overview of metadata categories.

Integrity of metadata and data is key for accurate and reproducible data processing. MRMhub therefore inspects imported data and metadata for completeness and for consistency of IDs used across different metadata tables. A summary of identified errors, warnings and notes is reported after import.

Preparing metadata

Metadata can be imported from Excel Sheets, CSV files, or R data frames. Furthermore, a specific metadata template file can be used to prepare metadata in a structured way.

Preparation of metadata is often a manual step, where the information is collected from various sources. To support this process, MRMhub provides metadata templates in Excel format. These templates contain column headers and instructions on how to use. In the beginning, it is recommended to start from a metadata template and fill in the required information. Templates for all metadata types supported by MRMhub can be obtained via:

Importing metadata

Specific metadata can be imported table by table, from CSV files:

mexp <- import_metadata_analyses(mexp, 
                                 path = "datasets/analysis_metadata.csv", 
                                 excl_unmatched_analyses = TRUE, 
                                 ignore_warnings = TRUE)

mexp <- import_metadata_features(mexp, 
                                 path = "datasets/feature_metadata.csv",
                                 ignore_warnings= TRUE )

Metadata can also be obtained from Excel workbook sheets, which allows to store all metadata in one file.
In this case below we add metadata on internal standard and response curves to the MRMhubExperiment object

mexp <- import_metadata_istds(mexp, 
                              path = "datasets/metadata_tables.xlsx", 
                              sheet = "ISTDs",
                              ignore_warnings= TRUE)

Lastly, metadata can be obtained directly from R data.frame objects, allowing users to prepare metadata in R or to obtain them from, e.g., databases or a LIMS. Below we import metadata on quality control samples:

df_qcinfo <- readr::read_table(file = "datasets/qc_metadata.txt")
mexp <- import_metadata_qcconcentrations(mexp, table = df_qcinfo)

Metadata from the MSOrganiser template

Another option to import metadata is via the ‘MRMhub MSOrganiser’ template, an Excel file (.xlsx). See Metadata import.

Next steps