best.trans.eQTLs {GGtools} | R Documentation

## collect strongest trans SNP-gene associations in a buffer of size K genes per SNP

### Description

collect strongest trans SNP-gene associations in a buffer of size K genes per SNP

### Usage

    best.trans.eQTLs(smpack, rhs, genechrnum, snpchrnum, K = 20,
       targdirpref = "tsco", batchsize = 200, radius = 2e+06, genequeryprefix = "",
       snploadprefix = "chr", snplocprefix = "chr", geneannopk, snpannopk,
       exFilter = function(x) x, smFilter = function(x) x,
       geneApply = lapply, SSgen = GGBase::getSS)

### Arguments

`smpack` | character string naming a package from which `smlSet-class` instances can be generated using `getSS`
`rhs` | passed to `snp.rhs.tests` for covariate or stratification adjustments; for permutation analysis, covariates should be handled via `regressOut`
`genechrnum` | character vector of chromosome identifiers for genes, typically `as.character(1:22)` for somatic genes in human studies
`snpchrnum` | specific chromosome identifier for all SNP to be analyzed
`K` | the size of the buffer: scores will be recorded for the most strongly associated K genes for each SNP
`targdirpref` | character string where buffer data will be held in ff archives
`batchsize` | passed to `ffrowapply` as scores are filtered from comprehensive testing to fill the buffer
`radius` | numeric: for same-chromosome tests, tests will not be performed for SNP-gene combinations with base-pair proximity smaller than radius
`genequeryprefix` | string: used when the numeric chromosome identifier requires a prefix like ‘chr’ for annotation query resolution on gene location
`snploadprefix` | string: used when the package identified in `smpack` requires a prefix to the `snpchrnum` token for `getSS` retrieval of `smlSet` instance
`snplocprefix` | string: used when the numeric chromosome identifier requires a prefix like ‘chr’ for annotation query resolution on SNP location
`geneannopk` | package to be used for CHRLOC and CHRLOCEND queries for genes
`snpannopk` | package to be used to resolve `snplocs` calls
`exFilter` | function returning an smlSet instance, operating on expression component prior to smFilter application and eQTL testing
`smFilter` | function returning an smlSet instance, operating on the full smlSet
`geneApply` | lapply-like function, typically mclapply or the like
`SSgen` | function to be used to create smlSet instance for testing – in general, GGBase::getSS has been used to pull the ExpressionSet and SnpMatrix data from a named package, but in some cases a specialize task is needed to create the desired smlSet. Whatever is passed to SSgen must return an smlSet instance.

### Value

instance of `transManager-class`

### Author(s)

VJ Carey <stvjc@channing.harvard.edu>

### Examples

    ## Not run:
    if (.Platform$OS.type != "windows") {  # ff overwrites failing 5.IX.12
      nsFilter2 = function(sms, var.cutoff=.5) {
       alliq = apply(exprs(sms),1,IQR)
       qs = quantile(alliq,var.cutoff, na.rm=TRUE)
       sms[ which(alliq > qs), ]
      }
      thefilt = function(x) GTFfilter( nsFilter2 (clipPCs(x, 1:10), var.cutoff=.95 ), lower=.05 )
      tfile = tempfile()
      tfold = dir.create(tfile)
      t1 = best.trans.eQTLs( "GGdata", ~1, as.character(20:22), "22",
              geneannopk="illuminaHumanv1.db", snpannopk= snplocsDefault(),
              smFilter=thefilt, snploadprefix="", snplocprefix="ch", targdirpref=tfile)
      tt1 = transTab(t1)
      tt1o = tt1[ order(tt1[,"sumchisq"], decreasing=TRUE), ][1:10,]
      tt1o
      }

    ## End(Not run)

[Package GGtools version 5.23.2 Index]