Learn R Programming

misha (version 4.2.9)

gintervals.2d: Creates a set of 2D intervals

Description

Creates a set of 2D intervals.

Usage

gintervals.2d(
  chroms1 = NULL,
  starts1 = 0,
  ends1 = -1,
  chroms2 = NULL,
  starts2 = 0,
  ends2 = -1
)

Value

A data frame representing the intervals.

Arguments

chroms1

chromosomes1 - an array of strings with or without "chr" prefixes or an array of integers (like: '1' for "chr1")

starts1

an array of start1 coordinates

ends1

an array of end1 coordinates. If '-1' chromosome size is assumed.

chroms2

chromosomes2 - an array of strings with or without "chr" prefixes or an array of integers (like: '1' for "chr1"). If 'NULL', 'chroms2' is assumed to be equal to 'chroms1'.

starts2

an array of start2 coordinates

ends2

an array of end2 coordinates. If '-1' chromosome size is assumed.

Details

This function returns a set of two-dimensional intervals. The returned value can be used in all functions that accept 'intervals' argument.

Two-dimensional intervals is a data frame whose first six columns are 'chrom1', 'start1', 'end1', 'chrom2', 'start2' and 'end2'. Each row of the data frame represents two genomic intervals from two chromosomes in the range of [start, end). Additional columns can be presented in 2D intervals object yet these columns must be added after the six obligatory ones.

See Also

gintervals, gintervals.force_range

Examples

Run this code
# \dontshow{
options(gmax.processes = 2)
# }

gdb.init_examples()

## the following 3 calls produce identical results
gintervals.2d(1)
gintervals.2d("1")
gintervals.2d("chrX")

gintervals.2d(1, 1000, 2000, "chrX", 400, 800)
gintervals.2d(c("chr2", "chrX"), 10, c(3000, 5000), 1)

Run the code above in your browser using DataLab