Learn R Programming

misha (version 4.2.9)

gpartition: Partitions the values of track expression

Description

Converts the values of track expression to intervals that match corresponding bin.

Usage

gpartition(
  expr = NULL,
  breaks = NULL,
  intervals = NULL,
  include.lowest = FALSE,
  iterator = NULL,
  band = NULL,
  intervals.set.out = NULL
)

Value

If 'intervals.set.out' is 'NULL' a set of intervals with an additional column that indicates the corresponding bin index.

Arguments

expr

track expression

breaks

breaks that determine the bin

intervals

genomic scope for which the function is applied

include.lowest

if 'TRUE', the lowest value of the range determined by breaks is included

iterator

track expression iterator. If 'NULL' iterator is determined implicitly based on track expression.

band

track expression band. If 'NULL' no band is used.

intervals.set.out

intervals set name where the function result is optionally outputted

Details

This function converts first the values of track expression into 1-based bin's index according 'breaks' argument. It returns then the intervals with the corresponding bin's index.

The range of bins is determined by 'breaks' argument. For example: 'breaks=c(x1, x2, x3, x4)' represents three different intervals (bins): (x1, x2], (x2, x3], (x3, x4].

If 'include.lowest' is 'TRUE' the the lowest value will be included in the first interval, i.e. in [x1, x2].

If 'intervals.set.out' is not 'NULL' the result is saved as an intervals set. Use this parameter if the result size exceeds the limits of the physical memory.

See Also

gscreen, gextract, glookup, gdist

Examples

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

gdb.init_examples()
breaks <- seq(0, 0.2, by = 0.05)
gpartition("dense_track", breaks, gintervals(1, 0, 5000))

Run the code above in your browser using DataLab