Skip to contents

Imports metadata from a MIDAR template (.xlsm/.xlsx) file and associates it with analysis data.

Usage

import_metadata_midarxlm(
  data = NULL,
  path,
  ignore_warnings = FALSE,
  excl_unmatched_analyses = FALSE
)

Arguments

data

A MidarExperiment object

path

File name and path of the MIDAR template (.xlsm/.xlsx) file

ignore_warnings

Ignore warnings from data validation and proceed with importing metadata

excl_unmatched_analyses

Exclude analyses (samples) that have no matching metadata

Value

An updated MidarExperiment object

Examples

mexp <- MidarExperiment()

mexp <- import_data_masshunter(
  data = mexp,
  path = system.file("extdata", "Example_MHQuant_Small.csv", package = "midar"),
  import_metadata = TRUE)
#>  Imported 65 analyses with 16 features
#>  `feature_area` selected as default feature intensity. Modify with `set_intensity_var()`.
#>  Analysis metadata associated with 65 analyses.
#>  Feature metadata associated with 16 features.

mexp <- import_metadata_midarxlm(
 data = mexp,
 path = system.file("extdata", "Example_Metadata_Small.xlsm", package = "midar"),
 excl_unmatched_analyses = FALSE)
#>  Analysis metadata associated with 65 analyses.
#>  Feature metadata associated with 16 features.
#>  Internal Standard metadata associated with 2 ISTDs.
#>  Response curve metadata associated with 12 analyses.

print(mexp)
#> 
#> ── MidarExperiment ─────────────────────────────────────────────────────────────
#> Title:
#> 
#> Processing status: Annotated raw AREA values
#> 
#> ── Annotated Raw Data ──
#> 
#> • Analyses: 65
#> • Features: 16
#> • Raw signal used for processing: `feature_area`
#> 
#> ── Metadata ──
#> 
#> • Analyses/samples: 
#> • Features/analytes: 
#> • Internal standards: 
#> • Response curves: 
#> • Calibrants/QC concentrations: 
#> • Study samples: 
#> 
#> ── Processing Status ──
#> 
#> • Isotope corrected: 
#> • ISTD normalized: 
#> • ISTD quantitated: 
#> • Drift corrected variables: 
#> • Batch corrected variables: 
#> • Feature filtering applied: 
#> 
#> ── Exclusion of Analyses and Features ──
#> 
#> • Analyses manually excluded (`analysis_id`): NA