Creates a set of 1D intervals.
gintervals(chroms = NULL, starts = 0, ends = -1, strands = NULL)
A data frame representing the intervals.
This function returns a set of one-dimensional intervals. The returned value can be used in all functions that accept 'intervals' argument.
One-dimensional intervals is a data frame whose first three columns are 'chrom', 'start' and 'end'. Each row of the data frame represents a genomic interval of the specified chromosome in the range of [start, end). Additional columns can be presented in 1D intervals object yet these columns must be added after the three obligatory ones.
If 'strands' argument is not 'NULL' an additional column "strand" is added to the intervals. The possible values of a strand can be '1' (plus strand), '-1' (minus strand) or '0' (unknown).
gdb.init_examples()
## the following 3 calls produce identical results
gintervals(1)
#> chrom start end
#> 1 chr1 0 5e+05
gintervals("1")
#> chrom start end
#> 1 chr1 0 5e+05
gintervals("chrX")
#> chrom start end
#> 1 chrX 0 2e+05
gintervals(1, 1000)
#> chrom start end
#> 1 chr1 1000 5e+05
gintervals(c("chr2", "chrX"), 10, c(3000, 5000))
#> chrom start end
#> 1 chr2 10 3000
#> 2 chrX 10 5000