gtrack.copy: Copies one or more tracks

View source: R/track-management.R

gtrack.copyR Documentation

Copies one or more tracks

Description

Creates a copy of an existing track, optionally to a different database. Transparently handles format mismatches (per-chromosome vs indexed) and chromosome-order differences between source and destination databases.

Usage

gtrack.copy(src = NULL, dest = NULL, db = NULL, overwrite = FALSE)

Arguments

src

source track name(s). Either a single name or a character vector of names.

dest

destination name. If src is a single name, this is the destination track name (defaults to src). If src is a vector, dest is treated as a namespace prefix (e.g. "ns" produces "ns.track1", "ns.track2", ...). NULL keeps each track's name.

db

destination database root. Must be the current GROOT or a member of GDATASETS. NULL means the current working directory db.

overwrite

if TRUE, replace an existing destination track.

Details

Chromosomes that exist in the source database but not in the destination are dropped with a warning.

For 2D tracks (rectangles, points), cross-database copy requires identical chromosome order in source and destination. Format conversion (per-chromosome to indexed) is supported only when the destination is the active database.

Value

invisibly, the character vector of created track names.

See Also

gtrack.mv, gtrack.rm

Examples



gdb.init_examples()
gtrack.copy("dense_track", "dense_track_copy")
gtrack.exists("dense_track_copy")
gtrack.rm("dense_track_copy", force = TRUE)


misha documentation built on Aug. 24, 2026, 5:14 p.m.