Description Usage Arguments Value Examples
This function takes two data frames of genomic ranges and perform intersection, union or difference between them. Internally, this function uses the GenomicRanges
package. The only goal of the function is to allow the user to directly work with data frames as input and output, avoiding the conversion to GRanges objects.
1 | range_comparison(df_a, df_b, operation, info)
|
df_a |
A dataframe of a bed file. |
df_b |
A dataframe of a bed file. |
operation |
A string. Either "intersection", "union" or "difference". The intersection corresponds to those regions in the first dataframe that overlap at least 1 bp with regions in the second dataframe. Default value: "intersection". |
info |
A string. Either "on" or "off". The default value is "on" and corresponds to display of information regarding the performed set operation. |
A dataframe with the intersection, union or difference between the input data frames df_a
and df_b
.
1 2 3 4 5 6 | 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) )
range_comparison(df_1, df_2, operation="intersection")
range_comparison(df_1, df_2, operation="union")
range_comparison(df_1, df_2, operation="difference")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.