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

