View source: R/DataUtilities.R
hlaAllele | R Documentation |
Return an object of hlaAlleleClass
, which contains
HLA/KIR types.
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)
sample.id |
sample IDs |
H1 |
a vector of HLA/KIR alleles |
H2 |
a vector of HLA/KIR alleles |
max.resolution |
"2-digit", "1-field", "4-digit", "2-field", "6-digit", "3-field", "8-digit", "4-field", "allele", "protein", "full", "none", or "": "allele" = "2-digit"; "protein" = "4-digit"; "full", "none" or "" for no limit on resolution |
locus |
the name of HLA locus: "A", "B", "C", "DRB1", "DRB5",
"DQA1", "DQB1", "DPB1", KIR locus, or "any", where "any" indicates any other
multiallelic locus; see |
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 |
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.
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 |
Xiuwen Zheng
hlaAlleleDigit
, hlaAlleleSubset
,
hlaLociInfo
, hlaAlleleToVCF
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.