Learn R Programming

misha (version 5.11.23)

gtrack.create_sparse: Creates a 'Sparse' track from intervals and values

Description

Creates a 'Sparse' track from intervals and values.

Usage

gtrack.create_sparse(
  track = NULL,
  description = NULL,
  intervals = NULL,
  values = NULL
)

Value

None.

Arguments

track

track name

description

a character string description

intervals

a set of one-dimensional intervals

values

an array of numeric values - one for each interval, in the same order as the rows of intervals. If NULL, the value column of intervals is used.

Details

This function creates a new 'Sparse' track with values at given intervals. 'description' is added as a track attribute.

When multiple databases are connected via gsetroot, the track is created in the current working directory (.misha$GWD), which defaults to the last connected database. Use gdir.cd with an absolute path to change where new tracks are created.

values is matched to intervals row by row, in the order the intervals are passed; intervals need not be sorted. Note however that gintervals returns its result sorted in the canonical chromosome order, so building intervals with gintervals() while keeping values in the original order will bind values to the wrong intervals. Keep the values in a value column of the intervals data frame and omit values to make such a mismatch impossible.

See Also

gtrack.create, gtrack.2d.create, gtrack.smooth, gtrack.modify, gtrack.rm, gtrack.info, gdir.create

Examples

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

gdb.init_examples()
intervs <- gintervals.load("annotations")
gtrack.create_sparse(
    "test_sparse", "Test track", intervs,
    1:dim(intervs)[1]
)
gextract("test_sparse", .misha$ALLGENOME)
gtrack.rm("test_sparse", force = TRUE)

Run the code above in your browser using DataLab