View source: R/DataUtilities.R
hlaSplitAllele | R Documentation |
Divide the samples to the training and validation sets randomly.
hlaSplitAllele(HLA, train.prop=0.5)
HLA |
an object of |
train.prop |
the proporion of training set |
The algorithm tries to divide each HLA alleles into training and validation
sets randomly with a training proportion train.prop
.
Return a list:
training |
an object of |
validation |
an object of |
Xiuwen Zheng
hlaAllele
# 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")
# divide HLA types randomly
set.seed(100)
hlatab <- hlaSplitAllele(hla, train.prop=0.5)
names(hlatab)
# "training" "validation"
summary(hlatab$training)
summary(hlatab$validation)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.