new Feature(viewer, options, meta)
Create a new feature.
Name | Type | Description |
---|---|---|
viewer |
Viewer |
The viewer |
options |
Object |
Attributes used to create the feature |
meta |
Object |
optional
User-defined Meta data to add to the feature. |
Extends
Members
-
canvasCanvas
-
Get the canvas.
-
codonStartString
-
Get or set the Codon start (Default: 1)
-
colorString
-
Get or set the color. TODO: reference COLOR class
-
contigContig
-
Get or set the Contig. The Contig can be set with a Contig object or with the name of a Contig.
-
decorationString
-
Get the decoration.
-
extractedFromSequenceBoolean
-
Get or set the extractedFromSequence. If true, this feature was generated directly from the sequence and will not be saved when exporting to JSON.
-
favoriteString
-
Get or set the feature as a favorite.
-
geneticCodeString
-
Get or set the Genetic code used for translation. If no genetic code is set, the default for the map will be used.
-
labelString
-
Get or set the feature label.
-
layoutLayout
-
Get the layout.
-
legendLegendItem
-
Alias for legendItem.
-
legendItemLegendItem
-
Get or set the LegendItem. The LegendItem can be set with a LegendItem object or with the name of a legenedItem.
-
mapRangeRange
-
Get or set the range of the feature with respect to its contig. All ranges are assumed to be going in a clockwise direction.
-
mapStartNumber
-
Get or set the start position of the feature in basepair (bp). All start and stop positions are assumed to be going in a clockwise direction.
-
mapStopNumber
-
Get or set the stop position of the feature in basepair (bp). All start and stop positions are assumed to be going in a clockwise direction.
-
metaBoolean
-
Get or Set the meta data of this object. See the meta data tutorial for details.
-
nameString
-
Get or set the name via the Label.
-
rangeRange
-
Get or set the range of the feature. All ranges are assumed to be going in a clockwise direction.
-
scoreNumber
-
Get the Score
-
seq
-
Returns the DNA sequence for the feature.
-
sequenceSequence
-
Get the sequence.
-
startNumber
-
Get or set the start position of the feature in basepair (bp). All start and stop positions are assumed to be going in a clockwise direction. This position is relative to the contig the feature is on. If there is only one contig, this value will be the same as mapStart.
-
stopNumber
-
Get or set the stop position of the feature in basepair (bp). All start and stop positions are assumed to be going in a clockwise direction. This position is relative to the contig the feature is on. If there is only one contig, this value will be the same as mapStop.
-
tagstag
-
Get or set the tags
-
typetype
-
Get or set the type
-
viewerViewer
-
Get the Viewer
-
visibleBoolean
-
Get or Set the visibility of this object.
Methods
-
inherited deleteFromObjects()
-
Remove the object from Viewer.objects
-
highlight(slot)
-
Highlights the feature on every slot it is visible. An optional slot can be provided, in which case the feature will only be highlighted on the slot.
Name Type Description slot
Slot Only highlight the feature on this slot.
-
moveTo(duration, ease)
-
Zoom and pan map to show the feature
Name Type Description duration
Number Length of animation
ease
Object The d3 animation ease [Default: d3.easeCubic]
-
remove()
-
Remove the feature from the viewer, tracks and slots
-
slots()
-
Return an array of the slots that contain this feature
-
toString(){String}
-
Return the class name as a string.
Returns:
Type Description String - 'Feature'
-
tracks()
-
Return an array of the tracks that contain this feature FIXME: this will not return the tracks for features on tracks with 'from' = 'sequence' - is this a problem??
-
translate(geneticCode){String}
-
Translate the sequence of this feature.
The source of the genetic code used for translation uses the following precedence: geneticCode (provided to translate method) > geneticCode (of Feature) > geneticCode (of Viewer)
Name Type Description geneticCode
Number Number indicating the genetic code to use for the translation. This will override the any genetic code set for the feature or Viewer.
Returns:
Type Description String - Amino acid sequence
-
update(attributes)
-
Update feature attributes. See updating records for details.
Name Type Description attributes
Object Object describing the properties to change