hlaMakeSNPGeno: Make a SNP genotype object

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

Description

To create a hlaSNPGenoClass object (SNP genotypic object).

Usage

1
2
hlaMakeSNPGeno(genotype, sample.id, snp.id, snp.position,
	A.allele, B.allele, assembly=c("auto", "hg18", "hg19", "unknown"))

Arguments

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

A.allele

a vector of A alleles in the SNP list

B.allele

a vector of B alleles in the SNP list

assembly

the human genome reference: "hg19" (default), "hg18", "auto" refers to "hg19"

Details

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

the human genome reference

Author(s)

Xiuwen Zheng

See Also

hlaMakeSNPHaplo, hlaGenoSubset, hlaHaploSubset, hlaGenoCombine

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# load SNP genotypes
data(HapMap_CEU_Geno, package="HIBAG")
summary(HapMap_CEU_Geno)

allele <- strsplit(HapMap_CEU_Geno$snp.allele, "/")
A.allele <- sapply(allele, function(x) { x[1] })
B.allele <- sapply(allele, function(x) { x[2] })

geno <- hlaMakeSNPGeno(HapMap_CEU_Geno$genotype, HapMap_CEU_Geno$sample.id,
	HapMap_CEU_Geno$snp.id, HapMap_CEU_Geno$snp.position, A.allele, B.allele,
	assembly="hg19")

summary(geno)

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