HLA_C_classification: Classify HLA-C alleles into C1 & C2 groups

Description Usage Arguments Details Value See Also Examples

View source: R/HLA_classification.R

Description

Takes two HLA-C alleles, classifies them individually into C1 or C2 using HLA_Classification and HLA_C_class_data, and returns the joint C1/C1, C1/C2 or C2/C2 class. If either allel classification is unknown or missing, returns NA.

Usage

1
HLA_C_classification(allele_c1, allele_c2, fields = 2, HLA_C_class = NULL)

Arguments

fields

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

HLA_C_class

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

allel_c1

Allele column, as string

allel_c2

Allele column, as string

Details

There are only three outcome classes, C1/C1, C1/C2 and C2/C2. The location of each C-class before or after the "/" does not match the input allele_c1 and _c2 - in other words if allele_c1 = "C2" and allele_c2 = "C1" the result is still C1/C2 The input alleles should be shortened to match the number of fields in the reference data.

Value

String vector with "C1/C1", "C1/C2", "C2/C2", or NA_character_

See Also

HLA_Classification, HLA_C_class_data

Examples

1
2
3
4
5
6
7
8
HLA_C_classification("01:02", "01:AWFCH")

dat <- data.frame(C1 = c("01:02", "02:03", "04:10"), C2 = c("01:AWFCH", "07:59", "05:50"))
HLA_C_classification(dat$C1, dat$C2)

# If either allele cannot be mapped to the reference data, NA is returned
dat_odd <- data.frame(C1 = c("01:02", "01:02", "01:02"), C2 = c(NA, "", "07:02:01"))
HLA_C_classification(dat_odd$C1, dat_odd$C2)

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