isValidMzQC: Checks validity (= completeness) of mzQC objects - or lists...

View source: R/mzQC.R

isValidMzQCR Documentation

Checks validity (= completeness) of mzQC objects - or lists (JSON arrays) thereof

Description

Note: Returns TRUE for empty lists!

Usage

isValidMzQC(x, ...)

Arguments

x

An mzQC refclass (or list of them), each will be subjected to isValidMzQC()

...

Ellipsis, for recursive argument splitting

Details

You can pass multiple arguments, which are all checked individually. All of them need to be valid, for TRUE to be returned. The reason for combining both list support for arguments and ellipsis (...) into this function is that JSON arrays are represented as lists and you can simply pass them as a single argument (without the need for do.call()) and get the indices of invalid objects (if any). The ellipsis is useful to avoid clutter, i.e. if (!isValidMzQC(a) || !isValidMzQC(b)) doStuff() is harder to read than if (!isValidMzQC(a,b)) doStuff()

Examples

  isValidMzQC(MzQCcvParameter$new("MS:4000059"))       # FALSE
  isValidMzQC(MzQCcvParameter$new("MS:4000059", "Number of MS1 spectra")) # TRUE
  isValidMzQC(list(MzQCcvParameter$new("MS:4000059"))) # FALSE
  isValidMzQC(list(MzQCcvParameter$new("MS:4000059", "Number of MS1 spectra"))) # TRUE
  isValidMzQC(list(MzQCcvParameter$new("MS:4000059", "Number of MS1 spectra")),
              MzQCcvParameter$new()) # FALSE


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