hlaSplitAllele {HIBAG} | 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
# 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)