Description Usage Arguments Value Note See Also Examples
View source: R/overlapRegions.R
return overlap between 2 regios set A and B
1 |
A |
a region set in any of the accepted formats by |
B |
a region set in any of the accepted formats by |
colA |
numeric vector indicating which columns of A the results will contain (default NULL) |
colB |
numeric vector indicating which columns of B the results will contain (default NULL) |
type |
|
min.bases |
numeric minimun number of bp accepted to define a overlap (default 1) |
min.pctA |
numeric minimun percentage of bases of A accepted to define a overlap (default NULL) |
min.pctB |
numeric minimun percentage of bases of B accepted to define a overlap (default NULL) |
get.pctA |
boolean if TRUE add a column in the results indicating the number percentage of A are involved in the overlap (default FALSE) |
get.pctB |
boolean if TRUE add a column in the results indicating the number percentage of B are involved in the overlap (default FALSE) |
get.bases |
boolean if TRUE add in the results the number of overlapped bases (default FALSE) |
only.boolean |
boolean if TRUE devolve as result a boolean vector containing the overlap state of each regions of A (default FALSE) |
only.count |
boolean if TRUE devolve as result the number of regions of A overlapping with B |
... |
any additional parameter (are there any left?) |
the default results is a data.frame
with at least 5 columns "chr" indicating the chromosome of the appartenence of each overlap, "startA", "endA", "startB", "endB", indicating the coordinates of the region A and B for each overlap
"type" that describe the nature of the overlap (see arguments "type") eventually other columns can be added (see see arguments "colA", "colB", "get.pctA", "get.pctB", "get.bases")
The implementation uses when possible the countOverlaps
function from IRanges
package.
plotRegions
, toDataframe
, toGRanges
, subtractRegions
, splitRegions
, extendRegions
, commonRegions
, mergeRegions
, joinRegions
1 2 3 4 5 | A <- data.frame("chr1", c(1, 5, 20, 30), c(8, 13, 28, 40), x=c(1,2,3,4), y=c("a", "b", "c", "d"))
B <- data.frame("chr1", 25, 35)
overlapRegions(A, B)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.