hlaAllele {HIBAG} | R Documentation

## A list of HLA/KIR types

### Description

Return an object of `hlaAlleleClass`, which contains HLA/KIR types.

### Usage

    hlaAllele(sample.id, H1, H2, max.resolution="", locus="any", assembly="auto",
        locus.pos.start=NA_integer_, locus.pos.end=NA_integer_, prob=NULL,
        na.rm=TRUE)

### Arguments

`sample.id` | sample IDs
`H1` | a vector of HLA alleles
`H2` | a vector of HLA alleles
`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
`locus` | the name of HLA locus: "A", "B", "C", "DRB1", "DRB5", "DQA1", "DQB1", "DPB1", or "any", where "any" indicates any other multiallelic locus
`assembly` | the human genome reference: "hg18", "hg19" (default), "hg38"; "auto" refers to "hg19"; "auto-silent" refers to "hg19" without any warning
`locus.pos.start` | the starting position in basepair
`locus.pos.end` | the end position in basepair
`prob` | the probabilities assigned to the samples
`na.rm` | if TRUE, remove the samples without valid HLA types

### Details

The format of `H1` and `H2` is "allele group : different protein : synonymous mutations in exons : synonymous mutations in introns"L, where the suffix L is express level (N, null; L, low; S, secreted; A, aberrant; Q: questionable). For example, "44:02:01:02L". If `max.resolution` is specified, the HLA alleles will be trimmed with a possible maximum resolution.

### Value

Return a `hlaAlleleClass` object, and it is a list:

`locus` | HLA locus
`pos.start` | the starting position in basepair
`pos.end` | the end position in basepair
`value` | a data frame
`assembly` | the human genome reference, such like "hg19"

The component `value` includes:

`sample.id` | sample ID
`allele1` | HLA allele
`allele2` | HLA allele
`prob` | the posterior probability

### Author(s)

Xiuwen Zheng

### See Also

`hlaAlleleDigit`, `hlaAlleleSubset`

### Examples

    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)

    # encode other loci
    hlaAllele("HD0010", "1", "2", locus="NewLocus")

[Package HIBAG version 1.16.0 Index]