Skip to contents

reduce_to_serology() is a thin wrapper around the ard.redux() method (Reduction Type 'S') of the py-ard Python package.

Usage

reduce_to_serology(ard, allele)

Arguments

ard

The Python database connection object created by db_initialize()

allele

A string or character vector with (an) HLA allele(s).

Value

A string or character vector of the same length as allele, with the corresponding serology if it exists, or "" if none exists (e.g. for null alleles)

Details

Uses the IPD-IMGT/HLA database as initialized with db_initialize(). This function will throw an error if any of the alleles in the input do not exist in the database. Use is_in_ipd_db() to safely check if the allele(s) exist(s).

See also

reduce_to_field2() to reduce an allele to two-field resolution

Examples

if (FALSE) { # \dontrun{
ard <- db_initialize(data_dir = path.expand("~/ipd_db"))
reduce_to_serology(ard, "B*13:03")
#> "B13"
reduce_to_serology(ard, "B*13:04")
#> "B15/B21"
# Also works for vectors:
reduce_to_serology(ard, c("B*13:03", "B*13:04"))
#> "B13"     "B15/B21"
} # }