in.region: checks if regions in object a are found in object b

Description Usage Arguments Details Value Author(s) References Examples

Description

checks if regions in object a are found in object b

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
in.region(
	x,
	y,
	proportion.overlap = 1e-09,
	reciprocal.overlap = FALSE,
	check.zero.based = TRUE,
	check.chr = TRUE,
	check.valid = TRUE,
	check.sort = TRUE,
	check.merge = TRUE,
	verbose = FALSE
	)

Arguments

x

first region index in the form chr:start-stop. regions in this index will be checked for intersection in the values of the second index.

y

second region index.

proportion.overlap

Defaults 1e-9 which is 1 bp. See details below for the different interpretation between 0 and 1 based overlap

reciprocal.overlap

Should the proportion.overlap be reciprocal

check.zero.based

should 0 based coordinates be checked

check.chr

should chr prefix be checked

check.valid

check if region is valid

check.sort

check if region is sorted

check.merge

check if overlapping regions are merged

verbose

prints some debugging information. currently it just checks if the input regions are overlapping

Details

The function can also be called using syntax similar to the %in% operator, for example "region1 %in.region% region2"

The default is to report TRUE if there is 1bp overlap in zero based bed format. That means that region chr1:10-20 and chr1:20-30 would not overlap. To switch to one based intuitive interpretation set proportion.overlap = 0.

Value

Returns a logical vector the length of x.

Author(s)

Daryl Waggott

References

http://bedtools.readthedocs.org/en/latest/content/tools/intersect.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
if (check.binary("bedtools")) {

index <- get.example.regions();

a <- index[[1]];
b <- index[[2]];
a <- bedr(engine = "bedtools", input = list(i = a), method = "sort", params = "");
b <- bedr(engine = "bedtools", input = list(i = b), method = "sort", params = "");

d <- in.region(a,b);

# alternative calling
d <- a %in.region% b

}

Example output

sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied


######################
#### bedr v1.0.7 ####
######################

checking binary availability...
  * Checking path for bedtools... FAIL
  * Checking path for bedops... FAIL
  * Checking path for tabix... FAIL
tests and examples will be skipped on R CMD check if binaries are missing

  * Checking path for bedtools... sh: 1: cannot create /dev/null: Permission denied
FAIL

bedr documentation built on May 2, 2019, 11:36 a.m.

Related to in.region in bedr...