Learn R Programming

HIBAG (version 1.8.3)

hlaGenoSubset: 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)

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

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''

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

See Also

hlaMakeSNPGeno, hlaGenoCombine

Examples

Run this code
summary(HapMap_CEU_Geno)

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

Run the code above in your browser using DataLab