trackhub.SuperTrack

digraph inheritance45a2de254f { 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.SuperTrack" [URL="#trackhub.SuperTrack",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.SuperTrack" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
class trackhub.SuperTrack(*args, **kwargs)[source]

Bases: BaseTrack

Represents a Super track. Subclasses Track, and adds some extras.

Super tracks are container tracks (folders) that group tracks. They are used to control visualization of a set of related data.

Eventually, you’ll need to make a trackdb.TrackDb instance and add this supertrack to it with that instance’s add_tracks() method.

See BaseTrack for details on arguments.

Methods

__init__(*args, **kwargs)

Represents a Super 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.

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 Super track. Subclasses Track, and adds some extras.

Super tracks are container tracks (folders) that group tracks. They are used to control visualization of a set of related data.

Eventually, you’ll need to make a trackdb.TrackDb instance and add this supertrack to it with that instance’s add_tracks() method.

See BaseTrack for details on 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 of SubGroupDefinition 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.

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.