hlaAlleleDigit: Trim HLA alleles

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Trim HLA alleles to specified width.

Usage

1
hlaAlleleDigit(obj, max.resolution="4-digit", rm.suffix=FALSE)

Arguments

obj

should be a hlaAlleleClass object or characters

max.resolution

"2-digit", "4-digit", "6-digit", "8-digit", "allele", "protein", "2", "4", "6", "8", "full" or "": "allele" = "2-digit", "protein" = "4-digit", "full" and "" indicating no limit on resolution

rm.suffix

whether remove the suffix, e.g., for "01:22N", "N" is a suffix

Details

Either HLAtypes or H1 H2 should be specified. The format of HLAtypes is "allele 1 / allele 2", e.g., "0512/0102". If max.resolution is specified, the HLA alleles will be trimmed with the maximum resolution.

Value

Return a hlaAlleleClass object if obj is hlaAlleleClass-type, or characters if obj is character-type.

Author(s)

Xiuwen Zheng

See Also

hlaAllele

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# load HLA types and SNP genotypes
data(HLA_Type_Table, package="HIBAG")

head(HLA_Type_Table)
dim(HLA_Type_Table)  # 60 13

# make a "hlaAlleleClass" object
hla.id <- "A"
hla <- hlaAllele(HLA_Type_Table$sample.id,
	H1 = HLA_Type_Table[, paste(hla.id, ".1", sep="")],
	H2 = HLA_Type_Table[, paste(hla.id, ".2", sep="")],
	locus = hla.id, assembly="hg19")
summary(hla)

hla2 <- hlaAlleleDigit(hla, "2-digit")
summary(hla2)

HIBAG documentation built on May 2, 2019, 4:50 p.m.