hlaSplitAllele {HIBAG} | R Documentation

## Divide the samples randomly

### Description

Divide the samples to the training and validation sets randomly.

### Usage

    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

    # 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)

[Package HIBAG version 1.18.1 Index]