plot.hlaAttrBagObj: Plot a HIBAG model

Description Usage Arguments Value Author(s) See Also Examples

View source: R/HIBAG.R

Description

To show a scatterplot of the numbers of individual classifiers and SNP positions.

Usage

1
2
3
4
5
6
## S3 method for class 'hlaAttrBagObj'
plot(x, snp.col="gray33", snp.pch=1, snp.sz=1,
    locus.col="blue", locus.lty=1L, locus.lty2=2L, addplot=NULL,
    assembly="auto", ...)
## S3 method for class 'hlaAttrBagClass'
plot(x, ...)

Arguments

x

an object of hlaAttrBagObj

snp.col

the color of SNP uses

snp.pch

the point type of SNP uses

snp.sz

the point size of SNP uses

locus.col

the color of text and line for HLA locus

locus.lty

the type of line for the bounds of HLA locus

locus.lty2

the type of line for HLA locus

addplot

NULL for creating a plot, or a ggplot object to be appended

assembly

the human genome reference: "hg18", "hg19" (default), "hg38"; "auto" refers to "hg19"; "auto-silent" refers to "hg19" without any warning

...

further arguments passed to or from other methods

Value

None

Author(s)

Xiuwen Zheng

See Also

print.hlaAttrBagObj, summary.hlaAttrBagObj

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# make a "hlaAlleleClass" object
hla.id <- "C"
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)
# please use "nclassifier=100" when you use HIBAG for real data
model <- hlaAttrBagging(hla, train.geno, nclassifier=2, verbose.detail=TRUE)
plot(model)

Example output

HIBAG (HLA Genotype Imputation with Attribute Bagging)
Kernel Version: v1.3
Supported by Streaming SIMD Extensions (SSE2) [64-bit]
Build a HIBAG model with 2 individual classifiers:
# of SNPs randomly sampled as candidates for each selection: 10
# of SNPs: 83, # of samples: 60
# of unique HLA alleles: 17
	1  , added snp: 2, loss: 398.296, out-of-bag acc: 40.00%, # of haplo: 16
	2  , added snp: 67, loss: 336.352, out-of-bag acc: 50.00%, # of haplo: 18
	3  , added snp: 37, loss: 276.74, out-of-bag acc: 56.00%, # of haplo: 18
	4  , added snp: 73, loss: 220.983, out-of-bag acc: 64.00%, # of haplo: 18
	5  , added snp: 69, loss: 158.368, out-of-bag acc: 74.00%, # of haplo: 18
	6  , added snp: 40, loss: 133.064, out-of-bag acc: 80.00%, # of haplo: 18
	7  , added snp: 7, loss: 113.799, out-of-bag acc: 82.00%, # of haplo: 18
	8  , added snp: 10, loss: 69.4402, out-of-bag acc: 84.00%, # of haplo: 19
	9  , added snp: 33, loss: 60.9844, out-of-bag acc: 88.00%, # of haplo: 19
	10 , added snp: 43, loss: 60.9816, out-of-bag acc: 90.00%, # of haplo: 19
	11 , added snp: 22, loss: 56.089, out-of-bag acc: 90.00%, # of haplo: 19
	12 , added snp: 5, loss: 49.462, out-of-bag acc: 90.00%, # of haplo: 19
	13 , added snp: 57, loss: 45.5176, out-of-bag acc: 90.00%, # of haplo: 20
	14 , added snp: 83, loss: 42.2249, out-of-bag acc: 90.00%, # of haplo: 24
	15 , added snp: 56, loss: 29.8472, out-of-bag acc: 92.00%, # of haplo: 27
	16 , added snp: 52, loss: 18.2354, out-of-bag acc: 92.00%, # of haplo: 27
	17 , added snp: 27, loss: 12.4665, out-of-bag acc: 92.00%, # of haplo: 27
	18 , added snp: 39, loss: 12.4189, out-of-bag acc: 92.00%, # of haplo: 27
	19 , added snp: 64, loss: 12.3964, out-of-bag acc: 92.00%, # of haplo: 27
	20 , added snp: 20, loss: 12.3785, out-of-bag acc: 92.00%, # of haplo: 27
	21 , added snp: 9, loss: 7.02725, out-of-bag acc: 92.00%, # of haplo: 27
	22 , added snp: 26, loss: 7.01775, out-of-bag acc: 92.00%, # of haplo: 29
	23 , added snp: 34, loss: 7.00894, out-of-bag acc: 92.00%, # of haplo: 29
	24 , added snp: 6, loss: 6.99855, out-of-bag acc: 92.00%, # of haplo: 29
Wed Mar 11 17:28:06 2020,   1 individual classifier, out-of-bag acc: 92.00%, # of SNPs: 24, # of haplo: 29
	1  , added snp: 10, loss: 431.491, out-of-bag acc: 45.00%, # of haplo: 20
	2  , added snp: 44, loss: 366.871, out-of-bag acc: 52.50%, # of haplo: 21
	3  , added snp: 57, loss: 316.627, out-of-bag acc: 67.50%, # of haplo: 23
	4  , added snp: 73, loss: 255.567, out-of-bag acc: 75.00%, # of haplo: 23
	5  , added snp: 34, loss: 210.7, out-of-bag acc: 80.00%, # of haplo: 23
	6  , added snp: 43, loss: 158.083, out-of-bag acc: 85.00%, # of haplo: 23
	7  , added snp: 64, loss: 110.188, out-of-bag acc: 85.00%, # of haplo: 23
	8  , added snp: 3, loss: 104.475, out-of-bag acc: 92.50%, # of haplo: 24
	9  , added snp: 47, loss: 55.7976, out-of-bag acc: 92.50%, # of haplo: 24
	10 , added snp: 49, loss: 55.7638, out-of-bag acc: 95.00%, # of haplo: 24
	11 , added snp: 30, loss: 39.8394, out-of-bag acc: 95.00%, # of haplo: 24
	12 , added snp: 51, loss: 39.6962, out-of-bag acc: 95.00%, # of haplo: 25
	13 , added snp: 75, loss: 31.8408, out-of-bag acc: 95.00%, # of haplo: 29
	14 , added snp: 5, loss: 26.9138, out-of-bag acc: 95.00%, # of haplo: 32
	15 , added snp: 27, loss: 21.6684, out-of-bag acc: 97.50%, # of haplo: 32
	16 , added snp: 32, loss: 21.4032, out-of-bag acc: 97.50%, # of haplo: 32
	17 , added snp: 36, loss: 21.3666, out-of-bag acc: 97.50%, # of haplo: 33
	18 , added snp: 24, loss: 19.2719, out-of-bag acc: 97.50%, # of haplo: 34
Wed Mar 11 17:28:06 2020,   2 individual classifier, out-of-bag acc: 97.50%, # of SNPs: 18, # of haplo: 34

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