full_range_comparison: Intersection, differences and union of two dataframes of...

Description Usage Arguments Value Examples

View source: R/full_range_comparison.R

Description

This function takes two dataframes of genomic ranges and perform all intersections, union and differences between them. The intersection is defined as those regions in the first dataframe that overlap at least 1 bp with regions in the second dataframe. Internally, this function uses the GenomicRanges package.

Usage

1

Arguments

df_a

A dataframe of a bed file.

df_b

A dataframe of a bed file.

Value

A list of dataframes corresponding to: The difference df_a - df_b, the intersection df_a & df_b, the intersection df_b & df_a, the difference df_b - df_a, and the union df_a U df_b.

Examples

1
2
3
4
df_1 <- data.frame( chr=rep("chr1",4), start=c(1,16,23,45), end=c(9,18,36,49), name=paste("region_",1:4,sep=""), score=rep(1,4), strand=rep("+",4) )
df_2 <- data.frame( chr=rep("chr1",4), start=c(4,19,28,49), end=c(9,21,39,55), name=paste("region_",1:4,sep=""), score=rep(1,4), strand=rep("+",4) )

full_range_comparison(df_1, df_2)

antonio-mora/chrombrowseR documentation built on Aug. 20, 2019, 3:21 p.m.