Usage
"import"(con, format, text, version = c("", "1", "2", "3"), genome = NA, colnames = NULL, which = NULL, feature.type = NULL, sequenceRegionsAsSeqinfo = FALSE)
import.gff(con, ...)
import.gff1(con, ...)
import.gff2(con, ...)
import.gff3(con, ...)
"export"(object, con, format, ...)
"export"(object, con, format, version = c("1", "2", "3"), source = "rtracklayer", append = FALSE, index = FALSE)
"export"(object, con, format, ...)
export.gff(object, con, ...)
export.gff1(object, con, ...)
export.gff2(object, con, ...)
export.gff3(object, con, ...)
Arguments
con
A path, URL, connection or GFFFile
object. For the
functions ending in .gff
, .gff1
, etc, the file format
is indicated by the function name. For the base export
and
import
functions, the format must be indicated another
way. If con
is a path, URL or connection, either the file
extension or the format
argument needs to be one of
gff, gff1 gff2, gff3,
gvf, or gtf. Compressed files (gz,
bz2 and xz) are handled transparently.
object
The object to export, should be a GRanges
or
something coercible to a GRanges
. If the object has a method
for asGFF
, it is called prior to coercion. This makes it
possible to export a GRangesList
or TxDb
in a
way that preserves the hierarchical structure. For exporting
multiple tracks, in the UCSC track line metaformat, pass a
GenomicRangesList
, or something coercible to one.
format
If not missing, should be one of gff, gff1
gff2, gff3, gvf, or gtf.
version
If the format is given as gff, i.e., it does
not specify a version, then this should indicate the GFF version as
one of (for import only, from the gff-version
directive in the file or 1 if none), 1, 2
or 3.
text
If con
is missing, a character vector to use as the
input.
genome
The identifier of a genome, or NA
if
unknown. Typically, this is a UCSC identifier like hg19. An
attempt will be made to derive the seqinfo
on the return
value using either an installed BSgenome package or UCSC, if network
access is available.
colnames
A character vector naming the columns to parse. These
should name either fixed fields, like source
or
type
, or, for GFF2 and GFF3, any attribute.
which
A GRanges
or other range-based object supported
by findOverlaps
. Only the intervals in the file
overlapping the given ranges are returned. This is much more efficient
when the file is indexed with the tabix utility.
feature.type
NULL
(the default) or a character vector of
valid feature types. If not NULL
, then only the features of the
specified type(s) are imported.
sequenceRegionsAsSeqinfo
If TRUE
, attempt to infer the
Seqinfo
(seqlevels
and seqlengths
) from the
##sequence-region directives as specified by GFF3.
source
The value for the source column in GFF. This is
typically the name of the package or algorithm that generated the
feature.
index
If TRUE
, automatically compress and index the
output file with bgzf and tabix. Note that tabix indexing will
sort the data by chromosome and start. Tabix supports a
single track in a file.
append
If TRUE
, and con
points to a file path,
the data is appended to the file. Obviously, if con
is a
connection, the data is always appended.
...
Arguments to pass down to methods to other methods. For
import, the flow eventually reaches the GFFFile
method on
import
. When trackLine
is
TRUE
or the target format is BED15, the arguments are passed
through export.ucsc
, so track line parameters are supported.