trackhub.CompositeTrack
digraph inheritance3eb64a83f5 { 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.CompositeTrack" [URL="#trackhub.CompositeTrack",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.CompositeTrack" [arrowsize=0.5,style="setlinewidth(0.5)"]; }- class trackhub.CompositeTrack(*args, **kwargs)[source]
Bases:
BaseTrack
Represents a composite track. Subclasses
BaseTrack
, and adds some extras.Add a view or subtrack to this composite with
add_tracks()
.Eventually, you’ll need to make a
trackdb.TrackDb
instance and add this composite to it withtrackdb.TrackDb.add_tracks()
. If you’re using subgroups, use theCompositeTrack.add_subgroups()
method.See
BaseTrack
for details on arguments. There are no additional arguments supported by this class.Methods
__init__
(*args, **kwargs)Represents a composite 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)Add a list of SubGroupDefinition objects to this composite.
add_subtrack
(subtrack)Add a child
Track
.add_trackdb
(trackdb)Attach this track to a parent TrackDb object.
add_tracks
(*args)This method allows for both view and subtracks to be added to a composite at the same time. args can be arbitrary BaseTrack objects (typically Track or View objects), either singly or as a list. For example any of the following are supported::.
add_view
(view)Add a ViewTrack object to this composite.
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__(*args, **kwargs)[source]
Represents a composite track. Subclasses
BaseTrack
, and adds some extras.Add a view or subtrack to this composite with
add_tracks()
.Eventually, you’ll need to make a
trackdb.TrackDb
instance and add this composite to it withtrackdb.TrackDb.add_tracks()
. If you’re using subgroups, use theCompositeTrack.add_subgroups()
method.See
BaseTrack
for details on arguments. There are no additional arguments supported by this class.
- 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)[source]
Add a list of SubGroupDefinition objects to this composite.
Note that in contrast to
BaseTrack()
, which takes a single dictionary indicating the particular subgroups for the track, this method takes a list ofSubGroupDefinition
objects representing the allowed subgroups for the composite.- Parameters:
subgroups – List of SubGroupDefinition objects.
- add_subtrack(subtrack)[source]
Add a child
Track
.Deprecated in favor of the more generic add_tracks method, but maintained for backwards compatibility.
- add_trackdb(trackdb)
Attach this track to a parent TrackDb object.
- add_tracks(*args)[source]
This method allows for both view and subtracks to be added to a composite at the same time. args can be arbitrary BaseTrack objects (typically Track or View objects), either singly or as a list. For example any of the following are supported:
add_tracks(view) add_tracks(view, [track1, track2]) add_tracks(track1, track2)
- add_view(view)[source]
Add a ViewTrack object to this composite.
Deprecated in favor of the more generic add_tracks method, but maintained for backwards compatibility.
- Parameters:
view – A ViewTrack object.
- 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.