| 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, ...)
export.wig(object, con,
dataFormat = c("bed", "variableStep", "fixedStep"), ...)
export.ucsc(object, con, subformat = c("gff", "wig", "bed"),
name = deparse(substitute(object)), ...)
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. |
dataFormat |
The format of the data lines for WIG tracks, see references. |
subformat |
The format of the tracks within the UCSC container. |
name |
The name of the track to output in the UCSC
track line. Not needed if object is a
ucscTrackSet. |
... |
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. |
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", "v3.gff", package = "rtracklayer"), version = "3")
## output to WIG with BED line format
export.ucsc(trackSets(track, track2), dummy, subformat = "wig", dataFormat = "bed")