HLA_prefix_add {immunogenetr} | R Documentation |
HLA_prefix_add
Description
This function adds a specified prefix to the beginning of each HLA type, and works on a single allele or all alleles in a GL string. Useful for adding HLA or gene prefixes.
Usage
HLA_prefix_add(data, prefix = "HLA-")
Arguments
data |
A string with a single HLA allele, a GL string of HLA alleles, or a character vector containing either of the previous. |
prefix |
A character string to be added as a prefix to the alleles. Default is "HLA-". |
Value
A vector with the specified prefix added to the values.
Examples
# The HLA_typing_LIS dataset contains a table as might be found in a clinical
# laboratory information system:
print(HLA_typing_LIS)
# The `HLA_prefix_add` function can be used to add the correct HLA prefixes to the table:
library(dplyr)
HLA_typing_LIS %>% mutate(
across(
mA1Cd.recipient:mA2Cd.recipient,
~ HLA_prefix_add(., "HLA-A*")
)
)
[Package immunogenetr version 0.3.1 Index]