hlaGenoSubset {HIBAG} | R Documentation

## Get a subset of genotypes

### Description

To get a subset of genotypes from a `hlaSNPGenoClass` object.

### Usage

    hlaGenoSubset(genoobj, samp.sel=NULL, snp.sel=NULL, snp.id=NULL)

### Arguments

`genoobj` | a genotype object of `hlaSNPGenoClass`
`samp.sel` | a logical vector, or an integer vector of indices
`snp.sel` | a logical vector, or an integer vector of indices
`snp.id` | SNP IDs to be selected, or NULL

### Details

`genoobj$genotype` is a numeric matrix, with an entry value 0 standing for BB (ZERO A allele), 1 for AB (ONE A allele), 2 for AA (TWO A alleles) and others for missing values (missing genotypes are usually set to be NA).

### Value

Return a `hlaSNPGenoClass` object, and it is a list:

`genotype` | a genotype matrix, “# of SNPs” - by - “# of individuals”
`sample.id` | a vector of sample IDs
`snp.id` | a vector of SNP IDs
`snp.position` | a vector of SNP positions in basepair
`snp.allele` | a vector of characters with the format of “A allele/B allele”
`assembly` | optional, human genome information

### Author(s)

Xiuwen Zheng

### See Also

`hlaMakeSNPGeno`, `hlaGenoCombine`

### Examples

    summary(HapMap_CEU_Geno)

    geno <- hlaGenoSubset(HapMap_CEU_Geno,
        snp.sel = (hlaGenoMFreq(HapMap_CEU_Geno)>0.10))
    summary(geno)

[Package HIBAG version 1.16.0 Index]