Skip to contents

mac_lookup() is a thin wrapper around the ard.lookup_mac() method of the py-ard Python package.

See the NMDP website for more on MACs.

Usage

mac_lookup(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 MACs.

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

mac_decode() for the reverse operation

Examples

if (FALSE) { # \dontrun{
ard <- db_initialize(data_dir = path.expand("~/ipd_db"))
mac_lookup(ard, "A*01:01/A*01:02")
#> "A*01:AB"
mac_lookup(ard, "HLA-A*25:01/HLA-A*26:01")
#> "HLA-A*25:BYHR"
# Also works for vectors:
mac_lookup(ard, c("A*01:01/A*01:02", "A*25:01/A*26:01"))
#> "A*01:AB"   "A*25:BYHR"
} # }