hlaModelFromObj | R Documentation |
Build a model hlaAttrBagClass
from an object of
hlaAttrBagObj
which is stored in an R object file, or convert
hlaAttrBagClass
to hlaAttrBagObj
.
hlaModelFromObj(obj)
hlaModelToObj(model)
obj |
an object of |
model |
an object of |
hlaModelFromObj
returns hlaAttrBagClass
, and
hlaModelToObj
returns hlaAttrBagObj
.
Xiuwen Zheng
hlaAttrBagging
# make a "hlaAlleleClass" object
hla.id <- "DQB1"
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")
# training genotypes
region <- 100 # kb
snpid <- hlaFlankingSNP(HapMap_CEU_Geno$snp.id, HapMap_CEU_Geno$snp.position,
hla.id, region*1000, assembly="hg19")
train.geno <- hlaGenoSubset(HapMap_CEU_Geno,
snp.sel = match(snpid, HapMap_CEU_Geno$snp.id))
# train a HIBAG model
set.seed(1000)
model <- hlaAttrBagging(hla, train.geno, nclassifier=2)
print(model)
mobj <- hlaModelToObj(model)
is(model)
is(mobj)
# close the HIBAG model explicitly
hlaClose(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.