convertAlleleToVariable converts input HLA allele numbers to additional variables based on the supplied dictionary.

convertAlleleToVariable(allele, dictionary)

Arguments

allele

Character vector with HLA allele numbers.

dictionary

Path to file containing HLA allele dictionary or a data frame.

Value

Vector containing HLA allele numbers converted to additional variables according to dictionary.

Details

dictionary file should be a tsv format with header and two columns. First column should hold allele numbers, second additional variables (eg. expression level).

Type of the returned vector depends on the type of the additional variable.

Examples

dictionary <- system.file("extdata", "Match_allele_HLA_supertype.txt", package = "midasHLA")
convertAlleleToVariable(c("A*01:01", "A*02:01"), dictionary = dictionary)
#> [1] "A01" "A02"