Class: Backbone

Backbone

The CGView Backbone represents the sequence of the map. When zoomed in far enough the sequence will be shown on the backbone. If contigs are present, they will be represented as arcs or arrows on the backbone.

Action and Events

Action Viewer Method Backbone Method Event
Update - update() backbone-update
Read backbone - -

Attributes

Attribute Type Description
thickness Number Thickness of backbone [Default: 5]
color String A string describing the main backbone color [Default: 'grey']. See Color for details.
colorAlternate String A string describing the alternate color used for contigs [Default: 'rgb(200,200,200)']. See Color for details.
decoration String How the bakcbone should be drawn. Choices: 'arc', 'arrow' [Default: arc for single contig, arrow for muliple contigs]
visible Boolean Backbone is visible [Default: true]
meta Object Meta data

Examples

cgv.backbone.update({
  thickness: 20
});

new Backbone(viewer, options, meta)

Create the Backbone.

Name Type Description
viewer Viewer

The viewer

options Object

Attributes used to create the backbone

meta Object optional

User-defined Meta data to add to the backbone.

Extends

Members

adjustedCenterOffsetNumber

Get the zoomed backbone radius. This is the radius * zoomFacter

adjustedThicknessNumber

Get the backbone thickness adjusted for visibility, zoom level and space for the sequence.

bpThicknessAdditionnumber

Get the factor used to increase backbone thickness when approaching the ability to see the sequence.

canvasCanvas

Get the canvas.

centerOffsetNumber

Get or set the backbone centerOffset. This is the unzoomed centerOffset.

colorColor

Get or set the backbone color. When setting the color, a string representing the color or a Color object can be used. For details see Color.

colorAlternateColor

Get or set the backbone alternate color. This color is used when contigs are present. The first contigs will be use color, the second will use colorAlternate, the third will use color and so on. When setting the color, a string representing the color or a Color object can be used. For details see Color.

decorationString

Get or set the decoration for the backbone contigs: 'arrow' or 'arc'

layoutLayout

Get the layout.

maxThicknessNumber

Maximum thickness the backbone should become to allow viewing of the sequence

metaBoolean

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

sequenceSequence

Get the sequence.

thicknessNumber

Get or set the backbone thickness. This is the unzoomed thickness.

viewerViewer

Get the viewer.

visibleBoolean

Get or Set the visibility of this object.

visibleRangeRange

The visible range

Methods

containsCenterOffset(offset){Boolean}

Does the backbone contain the given centerOffset.

Name Type Description
offset Number

The centerOffset.

Returns:
Type Description
Boolean

inherited deleteFromObjects()

Remove the object from Viewer.objects

maxZoomFactor(){Number}

The maximum zoom factor to get the correct spacing between basepairs.

Returns:
Type Description
Number

pixelsPerBp(){Number}

The number of pixels per basepair along the backbone circumference.

Returns:
Type Description
Number

toJSON()

Returns JSON representing the object

toString(){String}

Return the class name as a string.

Returns:
Type Description
String
  • 'Backbone'

update(attributes)

Update backbone attributes. See updating records for details.

Name Type Description
attributes Object

Object describing the properties to change