trackhub.ViewTrack
digraph inheritance4be2653339 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "trackhub.base.HubComponent" [URL="trackhub.base.HubComponent.html#trackhub.base.HubComponent",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for various track hub components. Several methods must be"]; "trackhub.track.BaseTrack" [URL="trackhub.BaseTrack.html#trackhub.BaseTrack",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "trackhub.base.HubComponent" -> "trackhub.track.BaseTrack" [arrowsize=0.5,style="setlinewidth(0.5)"]; "trackhub.track.ViewTrack" [URL="#trackhub.ViewTrack",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "trackhub.track.BaseTrack" -> "trackhub.track.ViewTrack" [arrowsize=0.5,style="setlinewidth(0.5)"]; }- class trackhub.ViewTrack(view, *args, **kwargs)[source]
Bases:
BaseTrack
Represents a View track. Subclasses
BaseTrack
, and adds some extras.This will need to be added to a
track.CompositeTrack
withtrack.CompositeTrack.add_view()
.Add tracks to this view with
track.ViewTrack.add_tracks()
.See
BaseTrack
for details on arguments. Additional arguments supported by this class:- Parameters:
view (str) – Unique name to use for the view.
See
BaseTrack
for details on other arguments.Methods
__init__
(view, *args, **kwargs)Represents a View track.
add_child
(child)Adds self as parent to child, and then adds child.
add_params
(**kw)Add [possibly many] parameters to the track.
add_parent
(parent)Adds self as child of parent, then adds parent.
add_subgroups
(subgroups)Update the subgroups for this track.
add_trackdb
(trackdb)Attach this track to a parent TrackDb object.
add_tracks
(*args)Add one or more tracks to this view.
leaves
(cls[, level, intermediate])Returns an iterator of the HubComponent leaves that are of class cls.
makedirs
(fn)remove_params
(*args)Remove [possibly many] parameters from the track.
render
([staging])Renders the object to file, returning a list of created files.
root
([cls, level])Returns the top-most HubComponent in the hierarchy.
validate
()Runs validation, raising exceptions as needed.
- __init__(view, *args, **kwargs)[source]
Represents a View track. Subclasses
BaseTrack
, and adds some extras.This will need to be added to a
track.CompositeTrack
withtrack.CompositeTrack.add_view()
.Add tracks to this view with
track.ViewTrack.add_tracks()
.See
BaseTrack
for details on arguments. Additional arguments supported by this class:- Parameters:
view (str) – Unique name to use for the view.
See
BaseTrack
for details on other arguments.
- add_child(child)
Adds self as parent to child, and then adds child.
- add_params(**kw)
Add [possibly many] parameters to the track.
Parameters will be checked against known UCSC parameters and their supported formats.
E.g.:
add_params(color='128,0,0', visibility='dense')
- add_parent(parent)
Adds self as child of parent, then adds parent.
- add_subgroups(subgroups)
Update the subgroups for this track.
Note that in contrast to
CompositeTrack()
, which takes a list ofSubGroupDefinition
objects representing the allowed subgroups, this method takes a single dictionary indicating the particular subgroups for this track.- Parameters:
subgroups (dict) – Dictionary of subgroups, e.g., {‘celltype’: ‘K562’, ‘treatment’: ‘a’}. Each key must match a SubGroupDefinition name in the composite’s subgroups list. Each value must match a key in that SubGroupDefinition.mapping dictionary.
- add_trackdb(trackdb)
Attach this track to a parent TrackDb object.
- add_tracks(*args)[source]
Add one or more tracks to this view.
- Parameters:
args (Track or iterable of Tracks)
- leaves(cls, level=0, intermediate=False)
Returns an iterator of the HubComponent leaves that are of class cls.
If intermediate is True, then return any intermediate classes as well.
- remove_params(*args)
Remove [possibly many] parameters from the track.
E.g.:
remove_params('color', 'visibility')
- render(staging=None)
Renders the object to file, returning a list of created files.
Calls validation code, and, as long as each child is also a subclass of
HubComponent
, the rendering is recursive.
- root(cls=None, level=0)
Returns the top-most HubComponent in the hierarchy.
If cls is not None, then return the top-most attribute HubComponent that is an instance of class cls.
For a fully-constructed track hub (and cls=None), this should return a a Hub object for every component in the hierarchy.
- validate()
Runs validation, raising exceptions as needed. Must be overridden by subclass.