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.
Arguments
- src
source track name(s). Either a single name or a character vector of names.
- dest
destination name. If
srcis a single name, this is the destination track name (defaults tosrc). Ifsrcis a vector,destis 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
GROOTor a member ofGDATASETS. 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.
Examples
gdb.init_examples()
gtrack.copy("dense_track", "dense_track_copy")
gtrack.exists("dense_track_copy")
#> [1] TRUE
gtrack.rm("dense_track_copy", force = TRUE)