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

View source: R/intervals.R

gintervals.2dR Documentation

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
)

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.

Value

A data frame representing the intervals.

See Also

gintervals, gintervals.force_range

Examples



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)


misha documentation built on Sept. 14, 2023, 5:08 p.m.