| 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 newTrackHubobject, 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 theTrackHubGenomeobject 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 thevalueof hub forx. -
shortLabel(x): get the value of hub. -
shortLabel(x) <- value: store thevalueof shortLabel forx. -
longLabel(x): get the value of hub. -
longLabel(x) <- value: store thevalueof longLabel forx. -
genomeFile(x): get the value of hub. -
genomeFile(x) <- value: store thevalueof genomesFile forx. -
email(x): get the value of hub. -
email(x) <- value: store thevalueof email forx. -
descriptionUrl(x): get the value of hub. -
descriptionUrl(x) <- value: store thevalueof descriptionUrl forx. -
genomeField(x, name, field): Get thevalueoffieldfornamegenome. -
genomeField(x, name, field) <- value: Set or Update thefieldandvaluefornamegenome. -
genomeInfo(x, name): Get theGenomeobject fornamegenome. -
genomeInfo(x) <- value: Addvalue(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)