clean_hla()
takes in a string or character vector of HLA alleles, and
performs a number of cleaning steps to correct common issues with formatting.
Value
A string or character vector of the same length as allele
, with the
cleaned-up alleles (or the originals, if no cleaning was necessary).
Details
clean_hla()
performs the following operations, in this order:
Removes leading or trailing whitespace
Adds a leading zero to fields if necessary (
A*1:1
–>A*01:01
)Removes redundant "versions" of the allele (e.g. a broad when the split is also specified). See
strip_redundant()
Removes punctuation and symbols that are not part of the notation
Adds an ":XX" suffix to molecular alleles with only 1 field (
A*01
–>A*01:XX
)Propagates loci and allele group fields in ambiguities (
A*01:01/02
–>A*01:01/A*01:02
)Converts v2 to v3 (
A*01010102N
–>A*01:01:01:02N
). Seeconvert_v2_to_v3()