gosling.Track#

class gosling.Track(data=Undefined, mark=Undefined, _assignedHeight=Undefined, _assignedWidth=Undefined, _invalidTrack=Undefined, _renderingId=Undefined, assembly=Undefined, baselineY=Undefined, centerRadius=Undefined, color=Undefined, dataTransform=Undefined, displacement=Undefined, endAngle=Undefined, experimental=Undefined, flipY=Undefined, height=Undefined, id=Undefined, innerRadius=Undefined, layout=Undefined, linkingId=Undefined, opacity=Undefined, orientation=Undefined, outerRadius=Undefined, overlayOnPreviousTrack=Undefined, overrideTemplate=Undefined, prerelease=Undefined, row=Undefined, size=Undefined, spacing=Undefined, startAngle=Undefined, static=Undefined, stretch=Undefined, stroke=Undefined, strokeWidth=Undefined, style=Undefined, subtitle=Undefined, text=Undefined, title=Undefined, tooltip=Undefined, visibility=Undefined, width=Undefined, x=Undefined, x1=Undefined, x1e=Undefined, xAxis=Undefined, xDomain=Undefined, xOffset=Undefined, xe=Undefined, y=Undefined, y1=Undefined, y1e=Undefined, yDomain=Undefined, yOffset=Undefined, ye=Undefined, zoomLimits=Undefined, **kwds)#

Create a basic Gosling Track.

Although it is possible to set all Track properties as constructor attributes, it is more idiomatic to use methods such as mark_point(), encode(), transform_filter(), properties(), etc.

__init__(data=Undefined, mark=Undefined, _assignedHeight=Undefined, _assignedWidth=Undefined, _invalidTrack=Undefined, _renderingId=Undefined, assembly=Undefined, baselineY=Undefined, centerRadius=Undefined, color=Undefined, dataTransform=Undefined, displacement=Undefined, endAngle=Undefined, experimental=Undefined, flipY=Undefined, height=Undefined, id=Undefined, innerRadius=Undefined, layout=Undefined, linkingId=Undefined, opacity=Undefined, orientation=Undefined, outerRadius=Undefined, overlayOnPreviousTrack=Undefined, overrideTemplate=Undefined, prerelease=Undefined, row=Undefined, size=Undefined, spacing=Undefined, startAngle=Undefined, static=Undefined, stretch=Undefined, stroke=Undefined, strokeWidth=Undefined, style=Undefined, subtitle=Undefined, text=Undefined, title=Undefined, tooltip=Undefined, visibility=Undefined, width=Undefined, x=Undefined, x1=Undefined, x1e=Undefined, xAxis=Undefined, xDomain=Undefined, xOffset=Undefined, xe=Undefined, y=Undefined, y1=Undefined, y1e=Undefined, yDomain=Undefined, yOffset=Undefined, ye=Undefined, zoomLimits=Undefined, **kwds)#

SingleTrack schema wrapper

Mapping(required=[data, mark])

Attributes:
dataDataDeep
markMark
_assignedHeightfloat
_assignedWidthfloat

Internal: Used for responsive spec

_invalidTrackboolean

internal

_renderingIdstring

internal

assemblyAssembly

A string that specifies the genome builds to use. Currently support “hg38”, “hg19”, “hg18”, “hg17”, “hg16”, “mm10”, “mm9”, and “unknown”.

__Note:__: with “unknown” assembly, genomic axes do not show chrN: in labels.

baselineYfloat
centerRadiusfloat

Proportion of the radius of the center white space.

__Default:__ 0.3

coloranyOf(Color, ChannelValue)
dataTransformList(DataTransform)
displacementDisplacement
endAnglefloat

Specify the end angle (in the range of [0, 360]) of circular tracks ({“layout”: “circular”}).

experimentalMapping(required=[])
flipYboolean
heightfloat

Specify the track height in pixels.

idstring

Assigned to uid in a HiGlass view config, used for API and caching.

innerRadiusfloat

Specify the inner radius of tracks when ({“layout”: “circular”}).

layoutLayout

Specify the layout type of all tracks.

linkingIdstring

Specify an ID for [linking multiple views](http://gosling-lang.org/docs/user-interaction#linking-views)

opacityanyOf(Opacity, ChannelValue)
orientationOrientation

Specify the orientation.

outerRadiusfloat

Specify the outer radius of tracks when {“layout”: “circular”}.

overlayOnPreviousTrackboolean
overrideTemplateboolean
prereleaseMapping(required=[])

internal

rowanyOf(Row, ChannelValue)
sizeanyOf(Size, ChannelValue)
spacingfloat

The size of the gap (1) between tracks, (2) between views, and (3) of the origin of circular tracks. The effect of this property depends on where on the spec you specify the spacing.

In a linear layout, this value is used in pixels, while in a circular layout, this value is used relative to the height of the tracks or views.

startAnglefloat

Specify the start angle (in the range of [0, 360]) of circular tracks ({“layout”: “circular”}).

staticboolean

Whether to disable [Zooming and Panning](http://gosling-lang.org/docs/user-interaction#zooming-and-panning), __Default:__ false.

stretchboolean
strokeanyOf(Stroke, ChannelValue)
strokeWidthanyOf(StrokeWidth, ChannelValue)
styleStyle

Define the [style](http://gosling-lang.org/docs/visual-channel#style-related-properties) of multive views. Will be overwritten by the style of children elements (e.g., view, track).

subtitlestring
textanyOf(Text, ChannelValue)
titlestring

If defined, will show the textual label on the left-top corner of a track.

tooltipList(Tooltip)
visibilityList(VisibilityCondition)
widthfloat

Specify the track width in pixels.

xanyOf(X, ChannelValue)
x1anyOf(X, ChannelValue)
x1eanyOf(X, ChannelValue)
xAxisAxisPosition

not supported

xDomainanyOf(DomainInterval, DomainChrInterval, DomainChr)

Specify the visible region of genomic x-axis

xOffsetfloat

Specify the x offset of views in the unit of pixels

xeanyOf(X, ChannelValue)
yanyOf(Y, ChannelValue)
y1anyOf(Y, ChannelValue)
y1eanyOf(Y, ChannelValue)
yDomainanyOf(DomainInterval, DomainChrInterval, DomainChr)

Specify the visible region of genomic y-axis

yOffsetfloat

Specify the y offset of views in the unit of pixels

yeanyOf(Y, ChannelValue)
zoomLimitsZoomLimits

Methods

__init__([data, mark, _assignedHeight, ...])

SingleTrack schema wrapper

copy([deep, ignore])

Return a copy of the object

encode(*args, **kwargs)

Add channel encodings to the track.

from_dict(dct[, validate, _wrapper_classes])

Construct class from a dictionary representation

from_json(json_string[, validate])

Instantiate the object from a valid JSON string

mark_area([align, background, ...])

Set the track's mark to 'area'

mark_bar([align, background, ...])

Set the track's mark to 'bar'

mark_betweenLink([align, background, ...])

Set the track's mark to 'betweenLink'

mark_brush([align, background, ...])

Set the track's mark to 'brush'

mark_header([align, background, ...])

Set the track's mark to 'header'

mark_line([align, background, ...])

Set the track's mark to 'line'

mark_point([align, background, ...])

Set the track's mark to 'point'

mark_rect([align, background, ...])

Set the track's mark to 'rect'

mark_rule([align, background, ...])

Set the track's mark to 'rule'

mark_text([align, background, ...])

Set the track's mark to 'text'

mark_triangleBottom([align, background, ...])

Set the track's mark to 'triangleBottom'

mark_triangleLeft([align, background, ...])

Set the track's mark to 'triangleLeft'

mark_triangleRight([align, background, ...])

Set the track's mark to 'triangleRight'

mark_withinLink([align, background, ...])

Set the track's mark to 'withinLink'

properties(**kwargs)

Set top-level properties of the View or Track.

resolve_references([schema])

Resolve references in the context of this object's schema or root schema.

to_dict([validate, ignore, context])

Return a dictionary representation of the object

to_json([validate, ignore, context, indent, ...])

Emit the JSON representation for this object as a string.

transform_coverage([endField, startField, ...])

Add CoverageTransform to Track Mapping(required=[type, startField, endField]) Aggregate rows and calculate coverage

transform_displace([boundingBox, method, ...])

Add DisplaceTransform to Track Mapping(required=[type, boundingBox, method, newField])

transform_exon_split([fields, flag, ...])

Add ExonSplitTransform to Track Mapping(required=[type, separator, flag, fields])

transform_filter(*args, **kwds)

Add FilterTransform to Track anyOf(OneOfFilter, RangeFilter, IncludeFilter)

transform_filter_not(*args, **kwds)

Add FilterTransform with not=True to Track anyOf(OneOfFilter, RangeFilter, IncludeFilter)

transform_json_parse([baseGenomicField, ...])

Add JSONParseTransform to Track Mapping(required=[type, field, baseGenomicField, genomicField, genomicLengthField]) Parse JSON Object Array and append vertically

transform_log([field, type, base, newField])

Add LogTransform to Track Mapping(required=[type, field])

transform_str_concat([fields, newField, ...])

Add StrConcatTransform to Track Mapping(required=[type, fields, newField, separator])

transform_str_replace([field, newField, ...])

Add StrReplaceTransform to Track Mapping(required=[type, field, newField, replace])

validate(instance[, schema])

Validate the instance against the class schema in the context of the rootschema.

validate_property(name, value[, schema])

Validate a property against property schema in the context of the rootschema

view(*args, **kwds)

Convert Track into top-level gos.View anyOf(Mapping(required=[alignment, tracks]), Mapping(required=[tracks]), Mapping(required=[tracks]))

visibility_ge(*args, **kwds)

Add greater-than-or-equal-to VisibilityCondition to Track anyOf(SizeVisibilityCondition, ZoomLevelVisibilityCondition)

visibility_gt(*args, **kwds)

Add greater-than VisibilityCondition to Track anyOf(SizeVisibilityCondition, ZoomLevelVisibilityCondition)

visibility_le(*args, **kwds)

Add less-than-or-equal-to VisibilityCondition to Track anyOf(SizeVisibilityCondition, ZoomLevelVisibilityCondition)

visibility_lt(*args, **kwds)

Add less-than VisibilityCondition to Track anyOf(SizeVisibilityCondition, ZoomLevelVisibilityCondition)