Metadata
Metadata in this context refers to analysis metadata, i.e., data that annotate the analytical data. Metadata can be retrieved from the imported analysis data file as far as available, or can be imported from separate files or R data frames.
Integrity of metadata and data is instrumental for correct and smooth post processing of data. Midar therefore inspects imported data/metadata for completness of data and consistency of IDs used across differet metadata tables. After importing metadata a summary of identified error, warnings and notes cocerning metadata is printed to the console, to allow user to identify and adress possible issues.
Metadata formats and temples
The structure and required/optional columns for each metadata type is descrived in the Manual and in the help of the correspoding import functions.
To obtain templates for metadata, a Excel file containing all template metadata table templates can be saved.
midar::save_metadata_templates()
Importing metadata from files/sheets
First we import the analysis data as outlined in “Importing data”. In this case we explicitly do not not import any metadata present in the analysis data, i.e., we only import the peak areas.
library(midar)
mexp <- midar::MidarExperiment()
data_path <- "datasets/sPerfect_MRMkit.tsv"
mexp <- import_data_mrmkit(data = mexp, path = data_path, import_metadata = TRUE)
Now we can add corresponding metadata file-by-file
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 imported from sheets of an Excel workbook, which
allows to store all metadata in one file.
In this case below we add metadata on internal standard and response
curves to the MidarExperiment object
mexp <- import_metadata_istds(mexp,
path = "datasets/metadata_tables.xlsx",
sheet = "ISTDs",
ignore_warnings= TRUE)
Furthermore, metadata can be imported from R data.frame
objects, thus allowing users to obtain metadata from additional sources,
e.g. from databases or a LIMS.
df_qcinfo <- readr::read_table(file = "datasets/qc_metadata.txt")
mexp <- import_metadata_qcconcentrations(mexp, table = df_qcinfo)
Importing MSOrganiser metedata file template
Another option to import metadata is via the MSOrganiser template file, a macro-based (XLSM) Excel file. This template offers tables for all metadata types supported by MiDAR, with options to do perform checks on validatiy and integrity of the metadata.
The template can be obtained from https://github.com/SLINGhub/midar or via a midar function
midar::save_metadata_msorganiser_template()
Only the metadata tables required by the intended processing workflow need to be completed. With following import function all completed tables will be imported.
mexp <- import_metadata_msorganiser(mexp,
path = "datasets/sPerfect_Metadata.xlsm",
ignore_warnings= TRUE)