HLA_B_classification: Classify overall group of HLA-B alleles

Description Usage Arguments Value See Also Examples

View source: R/HLA_classification.R

Description

Takes two HLA-B alleles, classifies them individually into Bw6, Bw4 - 80I or Bw4 - 80T using HLA_Classification and HLA_B_class_data, and returns the overall group. If either allele is 80I that's the overall group, if not then if either is 80T that's the group, otherwise Bw6.If either allel classification is unknown, returns NA.

Usage

1
HLA_B_classification(allele_b1, allele_b2, fields = 2, HLA_B_class = NULL)

Arguments

fields

Number of fields from allele string reference document to use, should be same as number of fields in allel_b1. For example, if allel_b1 = "07:02", fields should be 2 (the default value). This does not actually apply any string manipulation to allele_b1 & allele_b2, which needs to be done before passing to this function, using shorten_allel

allel_b1

Allele column, as string

allel_b2

Allele column, as string

HLA_C_class

deprecated, used to pre-load classification data before this function was vectorized

Value

String vector with "Bw6", "Bw4 - 80T", "Bw4 - 80I", or NA_character_, as a string

See Also

HLA_Classification, HLA_B_class_data

Examples

1
2
3
4
5
6
7
8
HLA_B_classification("07:02", "08:02")

dat <- data.frame(B1 = c("07:02", "07:02", "07:02"), B2 = c("07:36", "39:15", "08:02"))
HLA_B_classification(dat$B1, dat$B2)

# If either allele cannot be mapped to the reference data, NA is returned
dat_odd <- data.frame(B1 = c("07:02", "07:02", "07:02"), B2 = c(NA, "", "08:47"))
HLA_B_classification(dat_odd$B1, dat_odd$B2)

bosefalk/CTUtools documentation built on Feb. 4, 2022, 4:10 p.m.