mergeCIstates: merge ChromImpute chromatin states, or GWAS hit indicators,...

Description Usage Arguments Value Examples

View source: R/mergeToLoci.R

Description

merge ChromImpute chromatin states, or GWAS hit indicators, to a GRanges

Usage

1
2
3
mergeCIstates(gr, ermaset=NULL, epig, genome = "hg19", importFull=FALSE, useErma = TRUE, stateGR=NULL)
mergeGWhits(gr, gwcat, use=c("both", "addr", "name")[1],
     grSnpField="SNP")

Arguments

gr

a GRanges instance

ermaset

an instance of ErmaSet-class. if NULL, supply a GRanges as stateGR, with fields states and statecols

gwcat

an instance of gwaswloc-class, or any compliant GRanges instance – must have mcols field SNPS with snp identifier

epig

the standardized epigenome name of the epigenome to use

genome

a tag for genome build

importFull

logical, set to TRUE to acquire entire content (for LNG.FET, 800K ranges), to avoid contention for connections in parallel applications

useErma

logical – at the moment, must be TRUE; plan is to allow use of elements of AnnotationHub

use

character string selecting approach for linking loci in gr to those in gwcat – if "both", coincidence in address or name are both checked and used; if "addr", only address is checked, if "name", only SNP name.

grSnpField

character string naming the field in mcols(gr) with SNP id

stateGR

a GRanges instance as imported from erma package or from AnnotationHub, with mcols field states denoting chromatin state and statecols the associated colors for rendering

Value

for mergeCIstates, a GRanges instance with additional fields in mcols: fullStates, states, and statecols, denoting respectively the full annotation of ChromImpute for the inferred state, an abbreviated tag that collapses related states, and a color tag for rendering, that does not replicate the colors in the ChromImpute bed files. The states field is a factor with levels c("Het", "DNAse", "Enh", "Prom", "Quies", "ReprPC", "Tss", "Tx", "ZNF/Rp").

for mergeGWhits, a single mcols field is added, isGwasHit, that is 1 for coincident hit and 0 otherwise. Eventually phenotype information will be collected and added.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run:   # needs to use updated gwascat
if (require(gwascat) && require(erma)) {
#
# demonstrate Tx state for exon starts
#
  gm = resize(genemodel("ORMDL3"),1)
  es = makeErmaSet()
  g1 = mergeCIstates(gm, es, "LNG.FET")
  g1
#
# set up for GWAS
#
  require(GenomeInfoDb)
  data(ebicat37)
  genome(ebicat37) = "hg19"
  seqlevelsStyle(ebicat37) = "UCSC"
  g1 = c(g1, g1[1])  # add a known hit
  start(g1[length(g1)]) = 38062196
  mergeGWhits(g1, ebicat37)
  }
 
## End(Not run)

gQTLBase documentation built on Nov. 8, 2020, 7:07 p.m.