| 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 new
TrackHubobject, representing a repository aturi. IfcreateisTRUE, anduriis 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 the
TrackHubGenomeobject 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 the
valueof hub forx. shortLabel(x)-
get the value of hub.
shortLabel(x) <- value-
store the
valueof shortLabel forx. longLabel(x)-
get the value of hub.
longLabel(x) <- value-
store the
valueof longLabel forx. genomeFile(x)-
get the value of hub.
genomeFile(x) <- value-
store the
valueof genomesFile forx. email(x)-
get the value of hub.
email(x) <- value-
store the
valueof email forx. descriptionUrl(x)-
get the value of hub.
descriptionUrl(x) <- value-
store the
valueof descriptionUrl forx. genomeField(x, name, field)-
Get the
valueoffieldfornamegenome. genomeField(x, name, field) <- value-
Set or Update the
fieldandvaluefornamegenome. genomeInfo(x, name)-
Get the
Genomeobject fornamegenome. genomeInfo(x) <- value-
Add
value(Genome object) to existing genomes list.Genometakes 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)