TrackHub-class {rtracklayer} | R Documentation |
TrackHub Access
Description
The TrackHub
class represents a TrackHub data source,
essentially directory layout separating tracks and sequences by
genome, along with a few metadata files. This interface abstracts
those details and provides access to a TrackHub at any URL supported
by R (HTTP, FTP, and local files). This is an easy way to make data
accessible to the UCSC Genome Browser.
Constructor
-
TrackHub(uri, create = FALSE)
: Constructs a newTrackHub
object, representing a repository aturi
. Ifcreate
isTRUE
, anduri
is writeable (i.e., local), the repository is created if it does not already exist. If it does exist, then a message is emitted to indicate that the repository was not recreated.
Accessor Methods
In the code snippets below, x
represents a TrackHub
object.
x$genome
,x[["genome"]]
: Get theTrackHubGenome
object for the genome namedgenome
.length(x)
: number of genomes in the repository.uri(x)
: Get the URI pointing to the TrackHub repository.genome(x)
: Get the identifiers of the genomes present in the repository.writeTrackHub(x)
: Write hub content and genomes from memory representation to the hub file and genomes file. It also create resources if they are missing like genomes file and genome directory for newly add genome.
Data Access
Note that all storing methods(like hub()<-
) are only supported for local repositories, i.e., those with a file:// URI scheme.
-
hub(x)
: get the value of hub. -
hub(x) <- value
: store thevalue
of hub forx
. -
shortLabel(x)
: get the value of hub. -
shortLabel(x) <- value
: store thevalue
of shortLabel forx
. -
longLabel(x)
: get the value of hub. -
longLabel(x) <- value
: store thevalue
of longLabel forx
. -
genomeFile(x)
: get the value of hub. -
genomeFile(x) <- value
: store thevalue
of genomesFile forx
. -
email(x)
: get the value of hub. -
email(x) <- value
: store thevalue
of email forx
. -
descriptionUrl(x)
: get the value of hub. -
descriptionUrl(x) <- value
: store thevalue
of descriptionUrl forx
. -
genomeField(x, name, field)
: Get thevalue
offield
forname
genome. -
genomeField(x, name, field) <- value
: Set or Update thefield
andvalue
forname
genome. -
genomeInfo(x, name)
: Get theGenome
object forname
genome. -
genomeInfo(x) <- value
: Addvalue
(Genome object) to existing genomes list.Genome
takes named arguemnts of all UCSC supported fields for genome file(likegenome, trackDb, twoBitPath
, etc).
Author(s)
Michael Lawrence
Examples
th <- TrackHub(system.file("tests", "trackhub", package = "rtracklayer"))
uri(th)
genome(th)
length(th)
th$hg19
th[["hg19"]]
hub(th)
email(th)
## Not run:
hub(th) <- "new_hub"
writeTrackHub(th)
## End(Not run)