trackhub.AggregateTrack

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

Bases: BaseTrack

Represents an Aggregate or Overlay track. Subclasses Track, adds some extras.

Aggregate tracks allow closley related tracks to be viewed as a single track.

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

Parameters:

aggregate (str) – Aggregate type. One of “transparentOverlay”, “stacked”, “solidOverlay”. See https://genome.ucsc.edu/goldenpath/help/trackDb/trackDbHub.html#aggregate for details.

See BaseTrack for details on other arguments.

Methods

__init__(aggregate, *args, **kwargs)

Represents an Aggregate or Overlay 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_subtrack(subtrack)

Add a child SubTrack to this aggregate.

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__(aggregate, *args, **kwargs)[source]

Represents an Aggregate or Overlay track. Subclasses Track, adds some extras.

Aggregate tracks allow closley related tracks to be viewed as a single track.

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

Parameters:

aggregate (str) – Aggregate type. One of “transparentOverlay”, “stacked”, “solidOverlay”. See https://genome.ucsc.edu/goldenpath/help/trackDb/trackDbHub.html#aggregate for details.

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 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_subtrack(subtrack)[source]

Add a child SubTrack to this aggregate.

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.