senstab {gQTLstats} | R Documentation

## create a plottable table for eQTL sensitivity analysis visualization

### Description

create a plottable table for eQTL sensitivity analysis visualization

### Usage

    senstab(x, filt = force)
    ## S3 method for class 'senstab'
    plot(x, ...)

### Arguments

`x` | a list generated by a process analogous to the sensitivity survey exhibited in the example below
`filt` | a function that operates on and returns a data.frame; typically will select rows based on values of fields 'MAF' and 'radius'
`...` | extra arguments passed to plot

### Details

`sensByProbe` is a list structure; for information on this and other elements of sensitivity analysis workflow, see extensive non-executed code in example below

### Value

an instance of the S3 class 'senstab', 'data.frame'

### Examples

    ## Not run:
    #
    # illustration of sensitivity analysis using BatchJobs
    #
    # assume the following content in 'parms.R' (uncommented)
    # MAFS = c(.03, .04, .05, .075, .10, .125, .15)
    # dists = c(5000, 7500, 10000, 15000, 20000,
    #    25000, 50000, 100000, 250000, 500000, 750000, 1000000)
    # parms = expand.grid(MAFS, dists)
    library(BatchJobs)  # for bigStore manip
    library(gQTLstats)

    # could use multilevel parallelism here
    # because it is a somewhat large, fragile job, BatchJobs
    # is a relevant tool for iteration.  but storeToFDRByProbe is
    # already using bplapply.  so register 3 cores for it
    # and specify 15 cpu for BatchJobs in .BatchJobs.R

    sens1 = makeRegistry("sens1", file.dir="sens1",
        packages=c("gQTLstats", "dplyr"),
        src.files="parms.R")  # note parms.R

    sens4One = function(z) {
          load("../bigStore.rda")  # get a ciseStore instance
          ans = storeToFDRByProbe(bigStore, xprobs=seq(.01,.99,.01), # xprobs
                                              # needs to be chosen with care
          filter=function(x) x[which(x$MAF >= parms[z,1] &
              x$mindist <= parms[z,2])])
          ans = setFDRfunc(ans, span=.35)  # span can be important
          list(fdrsupp=ans, parms=parms[z,])
     }

    batchMap(sens1, sens4One, 1:nrow(parms))
    submitJobs(sens1)

    # now loadResult(sens1) or the equivalent can be the input to senstab()
    # as in the example to continue here:

    ## End(Not run)
    library(gQTLstats)
    data(sensByProbe)
    ptab = t(sapply(sensByProbe, function(x)as.numeric(x[[2]])))
    unique(ptab[,1]) # MAFs used
    unique(ptab[,2]) # radii used
    # here we filter away some extreme values of the design space
    tab = senstab(sensByProbe, filt=function(x) {
        x[ x$radius > 10000 & x$ radius < 500000 & x$MAF > .03, ]
        } )
    plot(tab)

[Package gQTLstats version 1.16.0 Index]