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)

