hlaGenoSubset: Get a subset of genotypes

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

Description

To get a subset of genotypes from a hlaSNPGenoClass object.

Usage

1
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

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”

Author(s)

Xiuwen Zheng

See Also

hlaMakeSNPGeno, hlaMakeSNPHaplo, hlaHaploSubset, hlaGenoCombine

Examples

1
2
3
4
5
6
7
# load SNP genotypes
data(HapMap_CEU_Geno, package="HIBAG")
summary(HapMap_CEU_Geno)

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

HIBAG documentation built on May 2, 2019, 4:50 p.m.