View source: R/DataUtilities.R
hlaCheckSNPs | R Documentation |
Check the SNP predictors in a HIBAG model, by calculating the overlapping between the model and SNP genotypes.
hlaCheckSNPs(model, object,
match.type=c("Position", "Pos+Allele", "RefSNP+Position", "RefSNP"), verbose=TRUE)
model |
an object of |
object |
a genotype object of |
match.type |
|
verbose |
if TRUE, show information |
Return a data.frame
for individual classifiers:
NumOfValidSNP |
the number of non-missing SNPs in an individual classifier |
NumOfSNP |
the number of SNP predictors in an individual classifier |
fraction |
NumOfValidSNP / NumOfSNP |
Xiuwen Zheng
hlaAttrBagging
, predict.hlaAttrBagClass
# 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)
hlaCheckSNPs(model, train.geno)
# 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.