Learn R Programming

airr (version 1.5.0)

validate_airr: Validate an AIRR Data Model nested list representation

Description

validate_airr validates the fields in a named nested list representation of the AIRR Data Model. Typically, generating by reading of JSON or YAML formatted AIRR files.

Usage

validate_airr(data, model = TRUE, each = FALSE)

Value

Returns TRUE if the input data is compliant with AIRR standards and

FALSE if not. If each=TRUE is set, then a vector with results for each each object in data is returned instead.

Arguments

data

list containing records of an AIRR Data Model objected imported from a YAML or JSON representation.

model

if TRUE validate only AIRR DataFile defined objects. If FALSE attempt validation of all objects in data.

each

if TRUE return a logical vector with results for each object in data instead of a single TRUE or FALSE value.

See Also

See Schema for the AIRR schema definitions. See read_airr for loading AIRR Data Models from a file. See write_airr for writing AIRR Data Models to a file.

Examples

Run this code
# Get path to the rearrangement-example file
f1 <- system.file("extdata", "repertoire-example.yaml", package="airr")
f2 <- system.file("extdata", "germline-example.json", package="airr")

# Load data file
repertoire <- read_airr(f1)
germline <- read_airr(f2)

# Validate a single record
validate_airr(repertoire)

# Return validation for individual objects
validate_airr(germline, each=TRUE)

Run the code above in your browser using DataLab