validate_gson: Validate a GSON object

View source: R/validate.R

validate_gsonR Documentation

Validate a GSON object

Description

validate_gson() checks the core data contract of a GSON gene set collection. It is useful after constructing an object manually or reading one from an external source.

Usage

validate_gson(x, error = TRUE)

Arguments

x

A GSON object.

error

Logical. If TRUE, throw an error when validation fails. If FALSE, return a character vector of validation messages.

Details

Nothing is rewritten. A value the object declares is reported as it stands – a schema_version this package does not know how to read, a keytype or gsidtype that names no identifier type, a gsidtype that the gene set IDs of the object itself contradict – because a reader that knows what a file says is not the one that decides what the producer meant.

Value

TRUE if the object is valid. If error = FALSE, returns a character vector of validation messages when invalid.

Examples

x <- gson(data.frame(gsid = "GS1", gene = "gene1"))
validate_gson(x)

gson documentation built on Oct. 9, 2026, 5:09 p.m.