KIR_first_field: Reduce KIR string to first field

Description Usage Arguments Value Examples

View source: R/munging.R

Description

Reduce a long KIR string (i.e. "0010101/0020102+0020103/0020104|0030105/0030106/0030107") to keep only the first field, resulting in "001/002+002|003". Keeps all non-numeric entries intact (i.e. "NEG" or "POS")

Usage

1
KIR_first_field(kir_string)

Arguments

kir_string

KIR string vector with /, + and | characters

Value

String vector with first KIR field only, removing duplicates

Examples

1
2
dat <- data.frame(kirstring = c("0010101/0020102+0020103/0020104|0030105/0030106/0030107", "001/002", "NEG", "0010203+0020304|NEG", "POS", "", NA), stringsAsFactors = FALSE)
KIR_first_field(dat$kirstring)

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