Skip to contents

get_serology() takes in a string or character vector of HLA alleles. The corresponding split-level (if it exists) or broad-level (if no split exists) allele is looked up in etrl_hla and returned. If no such alleles exist, NA is returned instead.

Usage

get_serology(allele)

Arguments

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 NA if none exists.

Details

This function uses the EuroTransplant Reference Laboratory HLA (etrl_hla) tables to do the lookup. These tables define several alleles for each protein (e.g. HLA-A*01:01, HLA-A*01:02), and their serological equivalents. All others are grouped into an XX code (HLA-A*01:XX), which is also mapped to a serological equivalent.

Workings

All entered alleles will first be reduced to the two-field level (see reduce_to_nth_field()). If this reduced allele occurs in the lookup table, the corresponding rows are returned. If not, it will be converted into an XX code, and that row will be returned.

If the allele is already at the serological broad- or split-level, the lookup will be performed using those respective columns in etrl_hla.

Exceptions

If the allele has a suffix (e.g. HLA-C*01:37N), it has no serological equivalent, and hence will also return nothing.

See also

  • get_broad: for looking up the broad-level equivalent of a split allele

  • get_split: for looking up the serological split-level equivalent of an allele

  • get_public: for looking up the public epitope of an allele

  • etrl_hla: the lookup table that's used in this function

Examples

get_serology("A24") # is a serological split; returns itself ("A24")
#> [1] "A24"
get_serology("A9") # is a serological broad; returns itself ("A9")
#> [1] "A9"

get_serology("A*01:01:01:50") # has a broad-level equivalent only ("A1")
#> [1] "A1"
get_serology("A*23:01:01:11") # has a split equivalent ("A23")
#> [1] "A23"
# as well as a broad ("A9"); only the former is returned

# Vectors also work:
get_serology(c("A24", "A*01:XX", "B*15:15"))
#> [1] "A24" "A1"  "B75"