HM2rac                package:GGtools                R Documentation

_c_o_m_p_u_t_e _r_a_r_e _a_l_l_e_l_e _c_o_u_n_t _f_r_o_m _a _h_a_p_m_a_p _f_i_l_e

_D_e_s_c_r_i_p_t_i_o_n:

     compute rare allele count from a hapmap file

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

      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.

_V_a_l_u_e:

     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.

_A_u_t_h_o_r(_s):

     Vince Carey <stvjc@channing.harvard.edu>

_E_x_a_m_p_l_e_s:

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

