Learn R Programming

misha (version 4.2.9)

gintervals.update: Updates a named intervals set

Description

Updates a named intervals set.

Usage

gintervals.update(
  intervals.set = NULL,
  intervals = "",
  chrom = NULL,
  chrom1 = NULL,
  chrom2 = NULL
)

Value

None.

Arguments

intervals.set

name of an intervals set

intervals

intervals or 'NULL'

chrom

chromosome for 1D intervals set

chrom1

first chromosome for 2D intervals set

chrom2

second chromosome for 2D intervals set

Details

This function replaces all intervals of given chromosome (or chromosome pair) within 'intervals.set' with 'intervals'. Chromosome is specified by 'chrom' for 1D intervals set or 'chrom1', 'chrom2' for 2D intervals set.

If 'intervals' is 'NULL' all intervals of given chromosome are removed from 'intervals.set'.

See Also

gintervals.save, gintervals.load, gintervals.exists, gintervals.ls

Examples

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

gdb.init_examples()
intervs <- gscreen(
    "sparse_track > 0.2",
    gintervals(c(1, 2), 0, 10000)
)
gintervals.save("testintervs", intervs)
gintervals.load("testintervs")
gintervals.update("testintervs", intervs[intervs$chrom == "chr2", ][1:5, ], chrom = 2)
gintervals.load("testintervs")
gintervals.update("testintervs", NULL, chrom = 2)
gintervals.load("testintervs")
gintervals.rm("testintervs", force = TRUE)

Run the code above in your browser using DataLab