associateReg2Gene: Associate regulatory regions to genes

Description Usage Arguments Details Value Author(s) Examples

Description

The function associates/links regulatory regions to genes based on regulatory activity and gene expression relationship.

Usage

1
2
associateReg2Gene(input, method = "pearson", scaleData = TRUE,
  mc.cores = 1, B = 1000, asGInteractions = T, ...)

Arguments

input

a GRangesList that contains regulatory activity and gene expression results. It has to have specific columns, see the example below or the output of regActivityAroundTSS function.

method

one of "pearson","spearman","dcor","elasticnet", "randomForest". Default: "pearson". See Details for more.

scaleData

if TRUE (default) the the values for gene expression and regulatory activity will be scaled to have 0 mean and unit variance using scale function.

mc.cores

number of cores to be used

B

number of randomizations, default 1000. This procedure is used to estimate P-values for coeficients returned by different methods.

asGInteractions

if TRUE (default) results are reported as GInteractions. Otherwise, a GRanges object with regulatory region coordinates and an additional column "reg" containing gene GRanges is reported

...

further arguments to methods, not implemented yet

Details

The function implements four methods to associate regulatory activity to genes: correlation (pearson or spearman), distance correlation ("dcor"), elasticnet and random forests. Simple linear regression on scaled data is equivalent to Pearson correlation. Distance correlation is a metric for statistical dependence between two variables. It can capture non-linear relationships different from correlation. Elasticnet and randomForests are methods that can capture additivity between regulatory activities and their relationship to gene expression. For all the methods, P-values are estimated by shuffling the gene expression vector B times and getting a null distribution for the estimated statistic, and comparing the original statistic to the null distribution. Estimated statistics are correlation coefficients for correlation and distance correlation methods, Regression coefficients for elasticnet and gini importance scores for random forests.

Value

a GInteraction object containing every potential association and between a regulatory region and TSS, and the estimated association statistic , its P-value and Q-value.

Author(s)

Altuna Akalin

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
###############################
#STEP 1.  Getting random and predefined .8 correlation
 
 require(GenomicRanges)
 require(doMC)
 require(glmnet)
 require(foreach)
 require(stringr)
 require(qvalue)
 require(InteractionSet)
 
 ####################################
 # INPUT1: GRanges
 # create an example: 2 vectors with correlation 0.8
 
   x <- c(2.000346,2.166255,0.7372374,0.9380581,2.423209, 
        2.599857,4.216959,2.589133,1.848172,3.039659)
   y <- c(2.866875,2.817145,2.1434456,2.9039771,3.819091,5.009990,
        5.048476,2.884551,2.780067,4.053136)
     corrM <- rbind(x,y)
 
 # define Granges object:
   gr0 <- GRanges(seqnames=rep("chr1",2),IRanges(1:2,3:4))
    
      GeneInfo <- as.data.frame(matrix(rep(c("gene","regulatory"),each=3),
                 ncol = 3,byrow = TRUE),stringsAsFactors=FALSE)

        colnames(GeneInfo) <- c("featureType","name","name2")

   mcols(gr0) <- DataFrame(cbind(GeneInfo,corrM))
 
 
 ####################################
 # OUTPUT: associateReg2Gene
 
 
    associateReg2Gene(gr0,mc.cores = 1)
    associateReg2Gene(gr0,mc.cores = 1,asGInteractions=FALSE) # report as GRanges
    associateReg2Gene(GRangesList(gr0),mc.cores = 1)
     
 # change N of resampling rounds   
    associateReg2Gene(GRangesList(gr0),mc.cores = 1,B=100) 
 # elastic net should return all NA values because 
 # only one predictor variable(x) is used to predict y  
  
    associateReg2Gene(GRangesList(gr0),mc.cores = 1,method="elasticnet") 

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