
Runtime validator for a live ExploreDataset instance
Source: R/validate_explore_dataset.R
validate_explore_dataset.RdChecks subclass-agnostic invariants by walking the accessor API:
Arguments
- eds
An
ExploreDatasetinstance.- strict
If
TRUE(default),stop()listing every failure. IfFALSE, returnslist(ok, errors)and never throws: a failing accessor is recorded as an error.
Value
Invisibly, TRUE on success (strict mode); or
list(ok = logical(1), errors = character) (non-strict mode).
Details
The runtime class is a concrete
ExploreDatasetsubclass — not the abstract base or intermediate.Cross-references resolve:
factor_names()are columns ofsamples(); everycontrasts()entry has a workingde()with theeffect_log2fcandscore_fdrcolumns;primary_grouping()is a member offactor_names();primary_contrast()is incontrasts()(orNA).Assays:
raw_assay_name()andprimary_assay_name()are inassay_names(), and the raw assay's rownames / colnames agree withfeature_ids()/sample_ids().
Cost is proportional to the number of contrasts (one de(c)
round-trip each) plus a small constant of other accessor calls.
Examples
se <- readRDS(system.file("examples/proteomics/SummarizedExperiment.rds", package = "exploreDE"))
eds <- new_explore_dataset(se)
validate_explore_dataset(eds)
validate_explore_dataset(eds, strict = FALSE)
#> $ok
#> [1] TRUE
#>
#> $errors
#> character(0)
#>