plot.hlaAttrBagObj | R Documentation |
To show a scatterplot of the numbers of individual classifiers and SNP positions.
## 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, ...)
x |
an object of |
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 |
None
Xiuwen Zheng
print.hlaAttrBagObj
, summary.hlaAttrBagObj
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.