toQCMetric: Create an 'MzQCqualityMetric' object from two inputs

View source: R/conversion.R

toQCMetricR Documentation

Create an 'MzQCqualityMetric' object from two inputs

Description

Create an 'MzQCqualityMetric' object from two inputs

Usage

toQCMetric(id, value, on_violation = c("error", "warn"))

Arguments

id

The CV accession

value

The data, as computed by some QC software in the required format.

on_violation

What to do when 'value' is not of the correct type (according to the given 'id')? Default: "error"; or "warn"

Details

The inputs are:

  • an ID of a QC metric, e.g. "MS:4000059" (number of MS1 spectra)

  • a value

The value must be in the correct format depending on the metric. The value type (see below) is checked (a warning/error is given if mismatching): The following requirements for values apply:

  • single value: R single value; the unit is obtained from the CVs 'has_units'

  • n-tuple: an R vector, e.g. using c(1,2,3), i.e. all values have the same type; the unit is obtained from the CVs 'has_units'

  • table: an R data.frame(); all columns defined using CVs 'has_column' must be present (a warning/error is given otherwise)

  • matrix: an R matrix, i.e. all values have the same type; the unit is obtained from the CVs 'has_units'

Upon violation, an error (default) or a warning is emitted:

   toQCMetric(id = "MS:4000059", value = data.frame(n = 1)) # errors: wrong value format
 

Value

An MzQCanalysisSoftware object

Examples

   toQCMetric(id = "MS:4000059", value = 13405) # number of MS1 spectra


rmzqc documentation built on May 29, 2024, 12:06 p.m.