## single value
toQCMetric(id = "MS:4000059", value = 13405) # number of MS1 spectra
## n-tuple
toQCMetric(id = "MS:4000051", value = c(31.3, 35.99, 38.44)) # XIC-FWHM quantiles
## table
toQCMetric(id = "MS:4000063", # MS2 known precursor charges fractions
value = list("MS:1000041" = 1:3,
"UO:0000191" = c(0.7, 0.6, 0.8)))
## test an invalid CV accession/id
toQCMetric(id = "MS:0000", value = "ID_is_not_valid", allow_unknown_id = TRUE)
# \donttest{
## matrix (MS:4000006): there is no example in the CV yet, so this cannot be tested)
#toQCMetric(id = "MS:400000?", value = matrix(1:12, nrow = 3, ncol = 4)) # ???
# does not work since the 'id' is not derived from a valid value type
#toQCMetric(id = "MS:0000000", value = "ID_is_not_valid")
# does not work, since the ID is unknown and 'allow_unknown_id' is FALSE by default
#toQCMetric(id = "MS:0000", value = "ID_is_not_valid")
# }
Run the code above in your browser using DataLab