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, gchr=NULL, geneLocDF=NULL, ps = NULL, pch = 20, cex = 0.5, local=FALSE, 
       plotf=smoothScatter, organism="human")

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

racExSet: instance of 'racExSet-class'

 snpMeta: instance of 'snpMeta-class'

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

    gchr: string stating chromosome on which gene is resident; looked
          up in geneLocDF if not supplied

geneLocDF: data frame that has one row for each gene symbol, in column
          `gene', and the chromosome on which it lives, in column `chr'

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. 

   plotf: function to use for rendering - with really high-density
          genotyping, the default works well; in sparse cases, use
          'plot'.

organism: string used for plot annotation

_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(chr20GGdem)
     data(chr20meta)
     data(geneLocs_hsa)
     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, geneLocDF=geneLocs_hsa)
     chr20GGdem = exclMono(chr20GGdem)
     ut = unix.time(scr2 <- snpScreen(chr20GGdem, chr20meta, genesym("CPNE1"), ~factor(.), fastAGM, 50))
     ut
     scr2
     plot_mlp(scr2, chr20meta, geneLocDF=geneLocs_hsa)
     #
     # here we work on a WebQTL computation
     #
     # get the expr+genotype data
     data(gse2031GG)
     # get a provisional snp metadata structure
     data(INB34snpMeta)
     # run a screen for Erdr1
     ss = snpScreen(gse2031GG, INB34snpMeta, genesym("Erdr1"), ~., fastAGM, 1)
     plot_mlp(ss, INB34snpMeta, gchr="all", plotf=plot, organism="mouse" )

