intersect.regions: Genomic regions overlapper

View source: R/intersect.regions.R

intersect.regionsR Documentation

Genomic regions overlapper

Description

A tool to define overlaps between bed files/regions derived from different formats. The function allows the overlap in stranded mode and can considered a specific minimal percentage of overlap between regions.

Usage

intersect.regions(
  reference.regions,
  test.regions,
  min.percentage.reference = 0,
  min.percentage.test = 0,
  min.bases.overlap = 1,
  sort.overlaps = FALSE,
  stranded = FALSE,
  return.as.data.frame = TRUE
)

Arguments

reference.regions

A single value or a list of regions to be used as 'reference'. The values accepted are: a. a character with the full path to a bed file, b. a data.frame in at least BED3 format, c. a GRanges object in at least BED3 format. If a list of elements is provided all the regions will be merged in a unique combined list and only completely identical regions will be remove to avoid duplicates. Combination of different formats is allowed.

test.regions

A single value or a list of regions to be used as 'test'. The values accepted are: a. a character with the full path to a bed file, b. a data.frame in at least BED3 format, c. a GRanges object in at least BED3 format. If a list of elements is provided all the regions will be merged in a unique combined list and only completely identical regions will be remove to avoid duplicates. Combination of different formats is allowed.

min.percentage.reference

A numeric value in 0-100 to define which percentage of a region in the 'reference' dataset must overlap with a region in the 'test' one. If the value is lower than 0 or greater than 100, will be coerced to 0 or 100 respectively. Default value: 0.

min.percentage.test

A numeric value in 0-100 to define which percentage of a region in the 'test' dataset must overlap with a region in the 'reference' one. If the value is lower than 0 or greater than 100, will be coerced to 0 or 100 respectively. Default value: 0.

min.bases.overlap

Integer, greater than 0, value to indicate the minimal number of bases to consider as minimum overlap between two regions. Non integer values will be rounded at integer, while number lower that 1 will be coerced to 1. Default value: 1.

sort.overlaps

Logic value to define whether the output should be sorted or not. Default value: FALSE.

stranded

A logical value to define whether the analyses should be performed by strand: regions in one strand will be overlapped only with regions of the same strand. The strand symbols considered are '+' and '-', any other symbol will considered in a unique separated category. Default value: FALSE.

return.as.data.frame

Logical value to define whether the output list should contain data.frames instead of GRanges objects. Default value: TRUE.

Value

The function returns a list of data.frames/GRanges objects containing:

  • overlaps.reference: XX;

  • non.overlaps.reference: XXX;

  • overlaps.testt: VV;

  • non.overlaps.test: XX.


sebastian-gregoricchio/Rseb documentation built on May 15, 2024, 5:45 a.m.