Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/DataUtilities.R
Divide the samples to the training and validation sets randomly.
1 | 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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # 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.