UCSCSession-class: Class "UCSCSession"
Description
An implementation of BrowserSession
for the UCSC genome browser.Objects from the Class
Objects can be created by calls of the form
browserSession("ucsc", url =
"http://genome.ucsc.edu/cgi-bin", ...)
. The arguments in ...
correspond to libcurl options, see
getCurlHandle
. Setting these options may be
useful e.g. for getting past a proxy.Slots
url
:- Object of class
"character"
holding the
base URL of the UCSC browser. hguid
:- Object of class
"numeric"
holding the
user identification code. views
:- Object of class
"environment"
containing
a list stored under the name "instances". The list holds the instances of
BrowserView
for this session.
Extends
Class "BrowserSession"
, directly.Methods
browserView(object, range =
range(object), track = trackNames(object), ...)
- Creates a
BrowserView
of range
with visible
tracks specified by track
. track
may be an instance
of UCSCTrackModes
. Arguments in ...
should
match parameters
to a ucscTrackModes
method for creating a
UCSCTrackModes
instance that will be merged with and
override modes indicated by the track
parameter. browserViews
(object)- Gets the
BrowserView
instances for this session. range
(x)- Gets the
GRanges
last
displayed in this session. genome(x)
- Gets the genome identifier of the session,
i.e.
genome(range(x))
. seqinfo
- Gets
the
Seqinfo
object with the
lengths of the chromosomes in the currenet genome. No
circularity information is available.
range(x) <- value
- Sets
value
, usually a
GRanges
object or RangesList
, as the range
of session x
. Note that
this setting only lasts until a view is created or
manipulated. This mechanism is useful, for example, when treating the UCSC
browser as a database, rather than a genome viewer. genome(x) <- value
-
Sets the genome identifier on the range of session
x
. getSeq(object, range, track = "Assembly")
-
Gets the sequence in
range
and track
.
track(object, name = names(track),
format = "auto", ...) <- value
-
Loads a track, stored under
name
and formatted as
format
. The "auto" format resolves to "bed" for qualitative
data. For quantitative data, i.e., data with a numeric score
column, "wig" or "bedGraph" is chosen, depending on how well the
data compresses into wig. The arguments in ...
are passed on to
export.ucsc
, so they could be slots in a
TrackLine
subclass (and thus specify
visual attributes like color) or parameters to pass
on to the export function for format
. The value
may
be either a range object (like a GRanges
) or a file
object (like a BEDFile
).
track(object, name, range = range(object),
table = NULL)
-
Retrieves a
GRanges
with features in
range
from track named name
. Some built-in tracks
have multiple series, each stored in a separate database
table. A specific table may be retrieved by passing its name in
the table
parameter. See tableNames
for a way
to list the available tables.
-
getTable(object, name, range = base::range(object), table =
NULL)
: Retrieves the table indicated by the track name
and
table
name, over range
, as a data.frame
. See
getTable
.
trackNames
(object)- Gets the
names of the tracks stored in the session.
ucscTrackModes
(object)- Gets the
default view modes for the tracks in the session.