hlaSplitAllele: Divide the samples randomly

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/DataUtilities.R

Description

Divide the samples to the training and validation sets randomly.

Usage

1
hlaSplitAllele(HLA, train.prop=0.5)

Arguments

HLA

an object of hlaAlleleClass

train.prop

the proporion of training set

Details

The algorithm tries to divide each HLA alleles into training and validation sets randomly with a training proportion train.prop.

Value

Return a list:

training

an object of hlaAlleleClass

validation

an object of hlaAlleleClass

Author(s)

Xiuwen Zheng

See Also

hlaAllele

Examples

 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)

HIBAG documentation built on March 24, 2021, 6 p.m.