toQCMetric | R Documentation |
Create an 'MzQCqualityMetric' object from two inputs
toQCMetric(id, value, on_violation = c("error", "warn"))
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" |
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
An MzQCanalysisSoftware object
toQCMetric(id = "MS:4000059", value = 13405) # number of MS1 spectra
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.