multiple.bed.enrichment: MUltiple BEd ENrichment

Description Usage Arguments Details Value

View source: R/user_functions.R

Description

From a target bed file, and a background bed file, this function calculates the statistical enrichment in several features (e.g. histone marks), in a given range.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
multiple.bed.enrichment(
  targets,
  target_labels = names(targets),
  background,
  feature_table,
  bin = 0,
  window = 0,
  thread_number = 1,
  DMR = F
)

Arguments

targets

A character vector with the file path of the bed with the regions of interest, or a data.frame/data.table with the data in a bed-like format. It can be a vector of one or more files.

target_labels

A character vector indicating the names of the target files, in the same order than the targets parameter.

background

A character vector with the file path of the bed with the background regions, or a data.frame/data.table with the data in a bed-like format

feature_table

A data.frame with the paths of the feature files, and their annotation. You can use prepare.feature.table, or make a custom table with the same format.

bin

The size of each overlap checking. If it is 0, the regions are checked as given.

window

The region that should be analyzed on each side (upstream and downstream) of the bed regions. If it is 0, the regions are checked as given.

thread_number

The number of threads that should be use in parallel.

DMR

A boolean indicating if the regions are not of size 1bp, such as, for example, DMRs (differentially methylated regions).

Details

The function is able to sequentially repeat that enrichment calculation several times in an arbitrary range and window of the target bed file, shifting all the genomic positions each time.

Value

A list with several data.tables, each one the result of one feature, and the last with the merge of all. Each row contains the information of one bin, with the fisher.test result.


omorante/mubeen documentation built on June 4, 2020, 9:19 p.m.