HM2rac {GGtools}R Documentation

compute rare allele count from a hapmap file

Description

compute rare allele count from a hapmap file

Usage

HM2rac(fn, comment.char="", kppref="NA")
thinHM2rac(gzfn)
countRare(x)
getRare(x)

Arguments

fn filename string identifying hapmap genotyping file
gzfn filename string identifying gzipped hapmap genotyping file
x string vector of simple genotype calls (e.g., "AA")
comment.char string identifying comment character token for read.table, should not be sharp sign because hapmap will use this in the header line
kppref a character token that must be present to identify a sample header column. I.e., if kppref is "NA" then a column with header tag NAnnnnn will be kept but a column with header chrom will be dropped.

Value

HM2rac returns a list including elements raremat: named character matrix with one row per snp and one column per sample, with snps named by rs numbers
alleles: named vector showing existing alleles at snp
rarealleles: named vector identifying base of rare allele
anno: character string for annotation indirection
countRare and getRare are simple string processing functions
thinHM2meta will create a snpMeta-class structure from a HapMap gzipped genotyping file.

Author(s)

Vince Carey <stvjc@channing.harvard.edu>

Examples

fi = system.file("fileDemos/geno20demo.txt.gz", package="GGtools")
racstr =  thinHM2rac(fi)
names(racstr)
racstr$rarecount[1:5,1:7]
racstr$rarebase[1:6]
racstr$alleles[1:6]
getRare(c("AA", "AG", "GG", "GG"))
countRare(c("AA", "AG", "GG", "GG"))

[Package GGtools version 1.4.0 Index]