regActivity: Calculates regulatory activity over pre-defined regions

Description Usage Arguments Details Value Examples

Description

The function calculates regulatory activity from histone modification, DNAse or methylation signals for pre-defined regulatory regions and returns a GRanges object with regulatory region locations and their activity over a set of samples.

Usage

1
2
3
regActivity(windows, target, sampleIDs = NULL, isCovNA = FALSE,
  weightCol = NULL, summaryOperation = "mean", normalize = NULL,
  mc.cores = 1)

Arguments

windows

a GRanges object that contains regulatory regions over which the regulatory activity will be calculated. It is strongly suggested to adjust seqlengths of this object to be equal to the seqlenghts Hsapiens from the appropriate package (BSgenome.Hsapiens.UCSC.hg19 or whatever needed version).

target

a named list of BigWig files. Names correspond to unique sample ids/names.

sampleIDs

NULL (default). A vector of unique sample ids/names(.bw files), ordered as the bigwig files are ordered. When NULL basenames of .bw files is used as a unique sample ids/names.

isCovNA

(def:FALSE), if this is set to TRUE, uncovered bases are set to NA, this is important when dealing with methylation data, where uncovered bases on a bigWig file do not mean zero methylation.

weightCol

a numeric column in meta data part used as weights. Useful when genomic regions have scores other than their coverage values, such as percent methylation, conservation scores, GC content, etc.

summaryOperation

"mean"(default). An argument for ScoreMatrixBin that is in the nutshell of quantifying enhancer activity across pre-defined enhancer regions. This designates which summary operation should be used over the regions. Currently, only mean is available, but "median" or "sum" will be implemented in the future.

normalize

NULL(default). Optional "quantile" and "ratio" If set to "quantile" activity measures are quantile normalized as implemented in normalize.quantiles and returned ; if set to "ratio" then "median ratio method" implemented as estimateSizeFactorsForMatrix is used to normalize activity measures.

mc.cores

(def:1) Define the number of cores to use; at most how many child processes will be run simultaneously using mclapply from parallel package. Parallelization requires at least two cores.

Details

regulatory activity is measured by averaging logFC for histone modification ChIP-seq profiles, or DNAse signal, or methylation per base.Currently, relevant bigWig files are required to calculate activity activity. This function might be extended to work with BAM files in the future.

Value

a GRanges object where its meta-columns correspond to calculated acvitity measures and column names correspond to provided sample ids or names.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# INPUT1: defining .bw files:

test.bw <- system.file("extdata", "test.bw",package = "reg2gene")
test2.bw <- system.file("extdata", "test2.bw",package = "reg2gene")

# INPUT2: defining regulatory regions:windows

windows <- GRanges(c(rep("chr1",4),rep("chr2",2)),
                      IRanges(c(1,7,9,15,1,15),c(4,8,14,20,4,20)),
                                            c(rep("+",3),rep("-",3)))
windows$reg <-  windows[c(1,1,3:6)]
windows$name2 <- windows$name <- paste0("TEST_Reg",
                                        c(1,1,3:length(windows)))
                        
 # OUTPUT  regActivity():                                                      
regActivity(windows,c(test.bw,test2.bw))   

# Additionaly, sample names can changed with sampleIDs argument

regActivity(windows,c(test.bw,test2.bw),sampleIDs=c("Cell1","Cell2"))

# Additionaly, it supports different normalization procedures:

regActivity(windows,c(test.bw,test2.bw),normalize ="ratio")
regActivity(windows,c(test.bw,test2.bw),normalize ="quantile")

BIMSBbioinfo/reg2gene documentation built on May 3, 2019, 6:42 p.m.