gwSnpTests              package:GGtools              R Documentation

_m_e_t_h_o_d_s _f_o_r _i_t_e_r_a_t_i_n_g _a_s_s_o_c_i_a_t_i_o_n _t_e_s_t_s (_e_x_p_r_e_s_s_i_o_n _v_s _S_N_P)
_a_c_r_o_s_s _g_e_n_o_m_e_s _o_r _c_h_r_o_m_o_s_o_m_e_s

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

     methods for iterating association tests (expression vs SNP) across
     genomes or chromosomes

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

     gwSnpTests(sym, sms, cnum, cs, ...)

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

     sym: genesym, probeId, or formula instance

     sms: smlSet instance

    cnum: chrnum instance or missing

      cs: chunksize specification 

     ...: ...

_D_e_t_a_i_l_s:

     invokes 'snpMatrix' package test procedures  (e.g.,
     'snp.rhs.tests' as appropriate

     'chunksize' can be specified to divide task up into chunks of
     chromosomes; 'gc()' will be run between each chunk - this may lead
     to some benefits when memory capacity is exceeded

     The dependent variable in the formula can have class genesym (chip
     annotation package used for lookup), probeId (direct specification
     using chip annotation vocabulary), or phenoVar (here we use a
     phenoData variable as dependent variable). If you want to put
     expression values on the right-hand side of the model, add them to
     the phenoData and enter them in the formula.

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

     'gwSnpScreenResult-class' or  'cwSnpScreenResult-class' instance

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

     Vince Carey <stvjc@channing.harvard.edu>

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

     if (!exists("hmceuB36.2021")) data(hmceuB36.2021)
     # condense to founders only
     hmFou = hmceuB36.2021[, which(hmceuB36.2021$isFounder)]
     # show basic formula fit
     f1 = gwSnpTests(genesym("CPNE1")~male, hmFou, chrnum(20))
     f1
     plot(f1)
     # show how to avoid adjusted fit
     f1b = gwSnpTests(genesym("CPNE1")~1-1, hmFou, chrnum(20))
     # show gene set modeling on chromosome
     library(GSEABase)
     gs1 = GeneSet(c("CPNE1", "ADA"))
     geneIdType(gs1) = SymbolIdentifier()
     f2 = gwSnpTests(gs1~male, hmFou, chrnum(20))
     f2
     names(f2)
     plot(f2[["ADA"]])
     # show 'smlSet-wide' fit
     f3 = gwSnpTests(gs1~male, hmFou)
     f3
     # now use a phenoVar
     f3b = gwSnpTests(phenoVar("persid")~male, hmFou, chrnum(20))
     topSnps(f3b)
     ## Not run: 
     # in example() we run into a problem with sys.call(2); works
     # in interpreter
     f4 = gwSnpTests(gs1~male, hmFou, snpdepth(250), chunksize(1))
     f4
       
     ## End(Not run)

