Skip to contents

gl_to_vec() takes in a GL String and converts it to a list containing the GL String metadata (namespace, version/data) and a character vector of the individual HLA alleles.

Usage

gl_to_vec(glstring)

Arguments

glstring

Any valid GL String.

Value

A named list of length three containing the:

  1. namespace (e.g. "hla")

  2. version_or_date (e.g. "3.29.0" or "2023-05-27")

  3. allele_list (e.g. c("HLA-A*01:01", "B*07:08"))

See also

  • vec_to_gl() for the opposite operation

  • gl_to_df() for converting a vector of GL Strings to a dataframe with one column per locus/allele

Examples

# return list that includes the metadata
gl_to_vec("hla#2018-06#HLA-A*02:69+HLA-A*23:30")
#> $namespace
#> [1] "hla"
#> 
#> $version_or_date
#> [1] "2018-06"
#> 
#> $allele_list
#> [1] "HLA-A*02:69" "HLA-A*23:30"
#> 
# access the allele list directly to keep just the vector of HLAs
gl_to_vec("hla#2018-06#HLA-A*02:69+HLA-A*23:30")$allele_list
#> [1] "HLA-A*02:69" "HLA-A*23:30"