Skip to contents

Note: Returns TRUE for empty lists!

Usage

isValidMzQC(x, parent_context = NULL)

Arguments

x

An mzQC refclass (or list of them), which will be subjected to validation

parent_context

Internal parameter used to track the path in nested validations

Details

This function checks if an mzQC object or a list of mzQC objects is valid. For lists, all elements need to be valid for the function to return TRUE. The function provides detailed error messages that include the path to the invalid field, making it easier to identify validation issues in complex nested structures.

Examples

  isValidMzQC(MzQCcvParameter$new("MS:4000059"))       # FALSE
#> Warning: MzQCcvParameter$name is NA/NULL
#> [1] FALSE
  isValidMzQC(MzQCcvParameter$new("MS:4000059", "Number of MS1 spectra")) # TRUE
#> [1] TRUE
  isValidMzQC(list(MzQCcvParameter$new("MS:4000059"))) # FALSE
#> Warning: [1]$MzQCcvParameter$name is NA/NULL
#> [1] FALSE
  isValidMzQC(list(MzQCcvParameter$new("MS:4000059", "Number of MS1 spectra"))) # TRUE
#> [1] TRUE