Class: Contig

Contig

The Contig class contains details for a single contig.

Action and Events

Action Sequence Method Contig Method Event
Add addContigs() - contigs-add
Update updateContigs() update() contigs-update
Remove removeContigs() remove() contigs-remove
Reorder moveContig() move() contigs-reorder
Read contigs() - -

Attributes

Attribute Type Description
name String Contig name.
seqiu String The contig sequence.
lengthiu Number The length of the sequence. This is ignored if a seq is provided.
orientation String '+' for forward orientation and '-' for the reverse.
color Color A string describing the color [Default: 'black']. See Color for details.
visible Boolean Contig is visible [Default: true].
meta Object Meta data

iu Ignored on Contig update

new Contig(viewer, options, meta)

Create a Contig

Name Type Description
viewer Viewer

The viewer

options Object

Attributes used to create the contig

meta Object optional

User-defined Meta data to add to the contig

Extends

Members

canvasCanvas

Get the canvas.

colorColor

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

hasSeqBoolean

Return true of this contig has a sequence

indexNumber

Get the contig index (base-1) in relation to all the other contigs.

isMapContigNumber

Returns true if this contig is the mapContig

layoutLayout

Get the layout.

lengthNumber

Get or set the sequence length. If the seq property is set, the length can not be adjusted.

lengthOffsetNumber

Get the length of all the contigs before this one.

mapRangeCGRange

Get the range of the contig in relation to the entire map. The range start is the total length of the contigs before this one plus 1. The range stop is the total length of the contigs before this one plus this contigs length.

mapStartNumber

Get the start position (bp) of the contig in relation to the entire map. The start is the total length of the contigs before this one plus 1.

mapStopNumber

Get the stop position (bp) of the contig in relation to the entire map. The stop is the total length of the contigs before this one plus this contigs length.

metaBoolean

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

nameString

Get or set the contig name. When setting a name, if it's not unique it will be appended with a number. For example, if 'my_name' already exists, it will be changed to 'my_name-2'. Empty names will be changed to 'Unknown'.

orientationString

Get or set the contig orientation. Value must be '+' or '-'. Flipping the orienation will reverse complement the contig sequence and adjust all the features on this contig.

seqString

Get or set the seqeunce.

sequenceString

Get the sequence.

viewerViewer

Get the viewer.

visibleBoolean

Get or Set the visibility of this object.

Methods

asFasta()

Returns sequence of this contig in fasta format

inherited deleteFromObjects()

Remove the object from Viewer.objects

features(term){CGArray}

Returns an CGArray of Features or a single Feature from all the features on this Contig.

Name Type Description
term Integer | String | Array

See CGArray.get for details.

Returns:
Type Description
CGArray

move(newIndex)

Move this contig to a new index in the array of Sequence contigs.

Name Type Description
newIndex Number

New index for this caption (0-based)

moveTo(duration, ease)

Zoom and pan map to show the contig

Name Type Description
duration Number

Length of animation

ease Object

The d3 animation ease [Default: d3.easeCubic]

remove()

Remove the Contig from the Sequence

reverseComplement()

Reverse complement the sequence of this contig

toJSON()

Returns JSON representing the object

toString(){String}

Return the class name as a string.

Returns:
Type Description
String
  • 'Contig'

update(attributes)

Update contig attributes. See updating records for details.

Name Type Description
attributes Object

Object describing the properties to change