Class: Track

Track

The Track is used for layout information...

Action and Events

Action Viewer Method Track Method Event
Add addTracks() - tracks-add
Update updateTracks() update() tracks-update
Remove removeTracks() remove() tracks-remove
Reorder moveTrack() move() tracks-reorder
Read tracks() - -

Attributes

Attribute Type Description
name String Name of track [Default: "Unknown"]
dataType String Type of data shown by the track: plot, feature [Default: feature]
dataMethod String Methods used to extract/connect to features or a plot: sequence, source, type, tag [Default: source]
dataKeys String|Array Values used by dataMethod to extract features or a plot.
position String Position relative to backbone: inside, outside, or both [Default: both]
separateFeaturesBy String How features should be separated: none, strand, or readingFrame [Default: strand]
thicknessRatio Number Thickness of track compared to other tracks [Default: 1]
loadProgress Number Number between 0 and 100 indicating progress of track loading. Used internally by workers.
drawOrder String Order to draw features in: position, score [Default: position]
favorite Boolean Track is a favorite [Default: false]
visible Boolean Track is visible [Default: true]
meta Object Meta data for Track

Examples

new Track(viewer, options, meta)

Create a new track.

Name Type Description
viewer Viewer

The viewer

options Object

Attributes used to create the track.

meta Object optional

User-defined Meta data to add to the track.

Extends

Members

canvasCanvas

Get the canvas.

dataKeysString

Get or set the dataKeys attribute. dataKeys describes which features/plot should be extracted. For example, if dataMethod is 'type', and dataKeys is 'CDS', then all features with a type of 'CDS' will be used to create the track. For dataMethod of 'sequence', the following values are possible for dataKeys: 'orfs', 'start-stop-codons', 'gc-content', 'gc-skew'.

dataMethodString

Get or set the dataMethod attribute. dataMethod describes how the features/plot should be extracted. Options are 'source', 'type', 'tag', or 'sequence' [Default: 'source']

dataOptionsObject

Get or set the dataOptions. The dataOptions are passed to the SequenceExtractor.

dataTypeString

Get or set the dataType. Must be one of 'feature' or 'plot' [Default: 'feature']

drawOrderString

Get or set the drawOrder. Must be one of 'position' or 'score' [Default: 'position']

  • position: Features are drawn in the (opposite) order they appear in the sequence. From end of strand backwards. This makes the arrow heads apear above features.
  • score: Features are drawn in order of score (lowest to highest).

idString

Alias for getting the name. Useful for querying CGArrays.

itemCountNumber

Return the number of features or plot points contained in this track.

layoutViewer

Get the Layout

loadProgressNumber

Get or set the load progress position (integer between 0 and 100)

metaBoolean

Get or Set the meta data of this object. See the meta data tutorial for details.

nameString

Get or set the name.

plotPlot

Get the plot associated with this track

positionString

Get or set the position. Possible values are 'inside', 'outside', or 'both'.

separateFeaturesByString

Get or set separateFeaturesBy. Possible values are 'none', 'strand', or 'readingFrame'.

sequenceSequence

Get the sequence.

thicknessRatioViewer

Get or set the track size as a ratio to all other tracks

typeString

Alias for dataType.

viewerViewer

Get the Viewer

visibleBoolean

Get or Set the visibility of this object.

Methods

inherited deleteFromObjects()

Remove the object from Viewer.objects

features(term){CGArray}

Returns an CGArray of Features or a single Feature from all the features in this track.

Name Type Description
term Integer | String | Array

See CGArray.get for details.

Returns:
Type Description
CGArray

move(newIndex)

Move this track to a new index in the array of Viewer tracks.

Name Type Description
newIndex Number

New index for this track (0-based)

remove()

Remove track

removeFeatures(features)

Remove a feature or array of features from the track and slots.

Name Type Description
features Feature | Array

The Feature(s) to remove.

removePlot()

Remove the plot from the track and slots.

toJSON()

Returns JSON representing the object

toString(){String}

Return the class name as a string.

Returns:
Type Description
String
  • 'Track'

update(attributes)

Update track attributes. See updating records for details.

Name Type Description
attributes Object

Object describing the properties to change