snpScreen              package:GGtools              R Documentation

_c_o_m_p_u_t_e _m_o_d_e_l _f_i_t_s _o_v_e_r _a _s_e_q_u_e_n_c_e _o_f _S_N_P_s

_D_e_s_c_r_i_p_t_i_o_n:

     compute model fits over a sequence of SNPs

_U_s_a_g_e:

     snpScreen(racExSet, snpMeta, gene, formTemplate, fitter, gran, ...)
     extract_p(ssr)
     plot_mlp(ssr, snpMeta, ps = NULL, pch = 20, cex = 0.5, local=FALSE)

_A_r_g_u_m_e_n_t_s:

racExSet: instance of 'racExSet-class'

 snpMeta: instance of 'snpMeta'

    gene: instance of 'genesym' class identifying the expression
          phenotype to be regarded as dependent variable

formTemplate: a formula having form '~.' or '~factor(.)', literally, to
          specify additive or nonadditive models for effects of rare
          allele copy number

  fitter: R fitting function that can work with formulas and data
          frames, for example 'lm', or, if not a fitting function, a
          special function in the package, either 'fastHET', or
          'fastAGM', see details below

    gran: a numeric convenience parameter; if not 1, SNPs will be
          deterministically selected with frequency 1/'gran' along the
          linear sequence in the racExSet racAssay structure 

     ...: ... - not in use

     ssr: 'snpScreenResult' instance

      ps: a string with a probe set identifier

     pch: for passage to 'scatterSmooth'

     cex: for passage to 'scatterSmooth'

   local: by default (local=FALSE) the plot is made over the entire
          chromosome; if local==TRUE, the plot is made over the segment
          of the chromosome within which the snps screened lie; this
          only makes a difference if the racExSet used in the screen
          has been SNP-filtered relative to the HapMap SNP set. 

_D_e_t_a_i_l_s:

     for snpScreen: If 'options()$verbose == TRUE' then every 100th
     index in the vector of snps is printed to stdout to show rate of
     progress.

     'snpScreenResult' is a container for relevant information about a
     screen, including a list of fit objects.

     For result processing, many SNPs have no variation in observed
     samples and statistical tests of association are indeterminate.
     NAs will be returned for tests on such SNPs.

     'fastAGM' is a C routine for simple least square fitting of an
     additive genetic model.  'fastHET' will compare heterozygous to
     homozygous.

     'plot_mlp' returns a list of x and y values for the plotted
     points.

_V_a_l_u_e:

     creates a list of model fit results; 'try' is used to allow
     failure of fit (e.g., 'lm' may fail if a singular model matrix is
     computed

_A_u_t_h_o_r(_s):

     Vince Carey <stvjc@channing.harvard.edu>

_E_x_a_m_p_l_e_s:

     example(make_racExSet)
     dem
     dem = exclMono(dem)
     snpNames(dem)[1:4]
     featureNames(dem)[1:4]
     data(chr20meta)
     scr1 = snpScreen(dem, chr20meta, genesym("DDR1"), ~., lm,  gran=100 )
     scr1[[1]]
     scr2 = snpScreen(dem, chr20meta, genesym("DDR1"), ~factor(.), lm,  gran=200 )
     scr2[[1]]
     plot_mlp(scr1, chr20meta)
     chr20GGdem = exclMono(chr20GGdem)
     ut = unix.time(scr2 <- snpScreen(chr20GGdem, chr20meta, genesym("CPNE1"), ~factor(.), fastAGM, 50))
     ut
     scr2
     plot_mlp(scr2, chr20meta)

