hlaCombineModelObj: Combine two HIBAG models together

Description Usage Arguments Value Author(s) See Also Examples

View source: R/HIBAG.R

Description

Merge two objects of hlaAttrBagObj together, which is useful for building an ensemble model in parallel.

Usage

1
hlaCombineModelObj(obj1, obj2)

Arguments

obj1

an object of hlaAttrBagObj

obj2

an object of hlaAttrBagObj

Value

Return an object of hlaAttrBagObj.

Author(s)

Xiuwen Zheng

See Also

hlaAttrBagging, hlaModelFiles

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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")

# SNP predictors within the flanking region on each side
region <- 500   # kb
snpid <- hlaFlankingSNP(HapMap_CEU_Geno$snp.id, HapMap_CEU_Geno$snp.position,
    hla.id, region*1000, assembly="hg19")
length(snpid)  # 275

# training genotypes
train.geno <- hlaGenoSubset(HapMap_CEU_Geno,
    snp.sel = match(snpid, HapMap_CEU_Geno$snp.id))

# train a HIBAG model
set.seed(100)
m1 <- hlaAttrBagging(hla, train.geno, nclassifier=1)
m2 <- hlaAttrBagging(hla, train.geno, nclassifier=1)

m1.obj <- hlaModelToObj(m1)
m2.obj <- hlaModelToObj(m2)

m.obj <- hlaCombineModelObj(m1.obj, m2.obj)
summary(m.obj)

Example output

HIBAG (HLA Genotype Imputation with Attribute Bagging)
Kernel Version: v1.3
Supported by Streaming SIMD Extensions (SSE2) [64-bit]
[1] 275
Remove 9 monomorphic SNPs
Build a HIBAG model with 1 individual classifier:
# of SNPs randomly sampled as candidates for each selection: 17
# of SNPs: 266, # of samples: 60
# of unique HLA alleles: 14
Tue Apr  2 22:16:08 2019,   1 individual classifier, out-of-bag acc: 86.96%, # of SNPs: 12, # of haplo: 32
Remove 9 monomorphic SNPs
Build a HIBAG model with 1 individual classifier:
# of SNPs randomly sampled as candidates for each selection: 17
# of SNPs: 266, # of samples: 60
# of unique HLA alleles: 14
Tue Apr  2 22:16:08 2019,   1 individual classifier, out-of-bag acc: 87.50%, # of SNPs: 15, # of haplo: 40
Gene: A
Training dataset: 60 samples X 266 SNPs
	# of HLA alleles: 14
	# of individual classifiers: 2
	total # of SNPs used: 24
	average # of SNPs in an individual classifier: 13.50, sd: 2.12, min: 12, max: 15
	average # of haplotypes in an individual classifier: 36.00, sd: 5.66, min: 32, max: 40
	average out-of-bag accuracy: 87.23%, sd: 0.38%, min: 86.96%, max: 87.50%
Genome assembly: hg19

HIBAG documentation built on March 24, 2021, 6 p.m.