All.cis {GGtools} | R Documentation

## functions that compute score tests for all SNP cis to genes, with flexible filtering

### Description

function that computes score tests for all SNP cis to genes, with flexible filtering

### Usage

    cisScores( config = new("CisConfig"), ... )
    All.cis( config = new("CisConfig"), ... )
    addgwhit(ans, traitFilter=force, vname="isgwashit")
    add878(ans)
    inflammFilter(gwtagger)

### Arguments

`config` | instance of class `CisConfig-class`
`...` | passed to eqtlTests

`ans` | cisRun-like entity to which additional annotation will be bound by addgwhit or add878
`gwtagger` | GRanges like gwastagger in gwascat data elements
`traitFilter` | function that returns a gwastagger-like GRanges, see `inflammFilter`
`vname` | name to be used for new data.table column added by addgwhit

### Details

cisScores (All.cis) returns score statistics for assocations of all SNP cis to genes, in a GRanges instance, with range names given by probes; metadata supplied SNP location, name, and score

cisAssoc targets SummarizedExperiment instances for molecular phenotype measures and VCF for variant data

`addgwhit` and `add878` will use GWAS hit information or ChromHMM labeling to annotation ranges

### Value

for cisScores: instance of `cisRun-class`

for cisAssoc: a GRanges with information on observed and permuted test scores per locus/feature pair

### Author(s)

VJ Carey <stvjc@channing.harvard.edu>

### Examples

    ## Not run:

       cc = new("CisConfig")
       chrnames(cc) = "21"
       genome(cc) = "hg19"
       lkp = try(library(parallel))
       if (!inherits(lkp, "try-error")) {
          nc = min(10, detectCores())
          options(mc.cores=nc)
          geneApply(cc) = mclapply
          }
       estimates(cc) = FALSE
       set.seed(1234)
       system.time(f1 <- cisScores( cc ))
     #
     # demonstrate adding annotation on chromatin state and gwas status
     #
     eprops = function(ans) {
     #
     # only adds fields to values() of the input
     #
      data(hmm878)
      ac = as.character
      eqr = GRanges(ac(seqnames(ans)), IRanges(ans$snplocs, width=1))
      fo = findOverlaps(eqr, hmm878)
      chromcat878 = factor(rep("none", length(ans)), levels=c(unique(hmm878$name), "none"))
      chromcat878[ queryHits(fo) ] = factor(hmm878$name[subjectHits(fo)])
      ans$chromcat878 = chromcat878

      if (require(gwascat)) {
        data(gwastagger)
        isgwashit = 1*(overlapsAny(eqr, gwastagger) | ans$snp
        ans$isgwashit = isgwashit
        }
      ans
     }
     extraProps(cc) = eprops
     set.seed(1234)
     system.time(f2 <- cisScores( cc ))
    #
    #
     inflammFilter # to make more restrictive predicate for prediction

    ## End(Not run)

[Package GGtools version 5.18.0 Index]