export-tracks {rtracklayer} | R Documentation |
These functions output trackSet
instances in
various formats.
export.gff(object, con, version = c("1", "2", "3"), source = "rtracklayer") export.gff1(object, con, ...) export.gff2(object, con, ...) export.gff3(object, con, ...) export.bed(object, con, wig = FALSE, color = NULL, ...) export.wig(object, con, dataFormat = c("auto", "bed", "variableStep", "fixedStep"), ...) export.ucsc(object, con, subformat = c("auto", "gff1", "wig", "bed"), ...)
object |
The object to export, such as a
trackSet . If a
ucscTrackSet , the track line information is
output. In the case of export.ucsc , a
trackSets
object with possibly multiple tracks is supported. |
con |
The connection to which the object is exported. |
version |
The GFF version, either "1", "2" or "3" (default is "1"). |
source |
The source of the GFF information, for GFF. |
wig |
Whether to output the WIG variant of BED lines, not to be used directly. |
color |
Recycled vector of colors, as interpreted by
col2rgb for BED features. If NULL , the
color column in the featureData is used, if any. |
dataFormat |
The format of the data lines for WIG tracks, see references. The "auto" format uses the most efficient format possible. |
subformat |
The format of the tracks within the UCSC container. If "auto", "wig" is used for numeric data, else "bed". |
... |
For export.gff1 , export.gff2 and
export.gff3 : arguments to pass to export.gff . For
export.bed and export.wig : arguments to pass to methods. For
export.ucsc : arguments to pass to export.subformat or
to set on the slots of the ucscTrackLine subclass
corresponding to subformat . |
If con
is missing, a character vector containing the string
output, otherwise nothing.
Michael Lawrence
See export
for the high-level interface to these
functions.
dummy <- file() # dummy file connection for demo track <- import(system.file("tests", "bed.wig", package = "rtracklayer")) ## output a track as GFF2 export.gff(track, dummy, version = "2") ## equivalently export.gff2(track, dummy) ## output as WIG string in variableStep format wig <- export.wig(track, dummy, dataFormat = "variableStep") ## output multiple tracks in UCSC meta-format track2 <- import(system.file("tests", "v1.gff", package = "rtracklayer")) ## output to WIG with BED line format export.ucsc(trackSets(track, track2), dummy, subformat = "wig", dataFormat = "bed")