permute.region: permute a set of regions

Description Usage Arguments Details Value Author(s) Examples

Description

permute a set of regions

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
permute.region(
	x,
	stratify.by.chr = FALSE,
	species = "human",
	build = "hg19",
	chr.names = paste0("chr",c(1:22,"X","Y","M")),
	mask.gaps = FALSE,
	gaps.file = NULL,
	mask.repeats = FALSE,
	repeats.file = NULL,
	sort.output = TRUE,
	is.checked = FALSE,
	check.zero.based = TRUE,
	check.chr = TRUE,
	check.valid = TRUE,
	verbose = TRUE
	)

Arguments

x

regions to permute

stratify.by.chr

Should the permutation be happen separetely for each chromosome. That is are chromosomes exchangeable.

species

species

build

the build of the reference

chr.names

names of the chromosomes to use

mask.gaps

should the gaps (Ns) in the human reference be ignored as potential start points. This drammatically increases memory and run time but is more appropriate in almost all settings. It defaults to off

gaps.file

database file of gaps. Defaults to Homo sapiens Hg19 gap.txt.gz file available through UCSC

mask.repeats

should the repeats from repeatMasker be ignored as potential start points. This drammatically increases memory and run time but is more appropriate in almost all settings. By default it's off

repeats.file

database file of repeats as supplied by UCSC containing RepMasker data e.g rmsk.txt.gz

sort.output

should the output be sorted

is.checked

Has the input data already be tested for validity. This is often done once before multiple permutations.

check.zero.based

should 0 based coordinates be checked

check.chr

should chr prefix be checked

check.valid

should the region be checkded for integerity

verbose

should log messages and checking take place

Details

1. Sampling with replacement on region length. 2. Sampling with replacement on start positions. Positions that contain Ns in the reference are set to 0 weight during sampling.

Regions that overlap the end of a chromosome or gap are trimmed.

Steps 1 and 2 are done within chromosomes if stratify.by.chr is set to true.

Value

A region object with randomized start positions.

Author(s)

Daryl Waggott

Examples

1
2
3
4
5
6
7
8
if (check.binary("bedtools")) {

index <- get.example.regions();
a <- index[[1]];
a <- bedr(engine = "bedtools", input = list(i = a), method = "sort", params = "");
a.perm <- permute.region(a);

}

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 permute.region in bedr...