getField: Trim Colon-Delimited HLA Allele Names by Field

View source: R/AlleleTrim.R

getFieldR Documentation

Trim Colon-Delimited HLA Allele Names by Field

Description

Trims a properly formatted colon-delimited HLA allele name to a desired number of fields.

If an allele name with an expression-variant suffix is truncated, the suffix can be appended to the end of the truncated allele name. If a resolution value greater than the number of fields in the submitted field is specified, the original allele is returned.

Usage

getField(allele, res, append = FALSE)

Arguments

allele

A character string representing an HLA allele.

res

A numeric describing the resolution desired.

append

A logical. When append = TRUE, the expression variant suffix of a full-length allele name is appended to a truncated allele name. The default value is FALSE.

Value

A version of the 'allele' character string that has been trimmed to 'res' resolution.

Note

For internal HLAtools use.

Examples

getField("HLA-A*01:01:01:01", 3)
getField("DRB1*11:01:01:12N", 2,TRUE)


HLAtools documentation built on June 8, 2025, 12:24 p.m.