new Sequence(viewer, options, meta)
Create a Sequence
Name | Type | Description |
---|---|---|
viewer |
Viewer |
The viewer |
options |
Object |
Attributes used to create the sequence |
meta |
Object |
optional
User-defined Meta data to add to the sequence |
Extends
Members
-
canvasCanvas
-
Get the canvas.
-
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 seeColor
. -
fontFont
-
Get or set sequence font. When setting the font, a string representing the font or a
Font
object can be used. For details seeFont
. -
hasMultipleContigsBoolean
-
Return true if the sequence consists of muliple contigs.
-
hasSeqBoolean
-
Return true of a sequence is available. Returns false if there is only a length.
-
layoutLayout
-
Get the layout.
-
lengthNumber
-
Get or set the seqeunce length. If the seq property is set, the length can not be adjusted.
-
mapContigContig
-
This is used internally to represent the entire map sequence. It is generated by the supplied seq or the concatenation of all the contigs. The Sequence.seq (or length) is the same as Sequence.mapContig.seq (or length).
-
metaBoolean
-
Get or Set the meta data of this object. See the meta data tutorial for details.
-
seqString
-
Get or set the seqeunce.
-
sequenceSequence
-
Get the sequence.
-
viewerViewer
-
Get the viewer.
-
visibleBoolean
-
Get or Set the visibility of this object.
Methods
-
staticSequence.complement(){String}
-
Return the Complement the sequence
Returns:
Type Description String - 'Sequence'
-
staticSequence.random(length){String}
-
Create a random sequence of the specified length
Name Type Description length
Number The length of the sequence to create
Returns:
Type Description String -
Add one or more contigs (see attributes). See adding records for details.
Name Type Description data
Object | Array Object or array of objects describing the contigs
Returns:
Type Description CGArray.<Contig> CGArray of added contigs -
asFasta(id, options)
-
Create FASTA string for the sequence.
Name Type Description id
String ID line for FASTA (i.e. text after '>'). Only used if there is one contig or concatenateContigs is true.
options
Object Options: concatenateContigs
-
Returns a CGArray of contigs or a single contig. See reading records for details.
Name Type Description term
Integer | String | Array See CGArray.get for details.
Returns:
Type Description Contig | CGArray -
inherited deleteFromObjects()
-
Remove the object from Viewer.objects
-
forRange(range, revComp){String}
-
Return the sequence for the range
Name Type Description range
Range the range for which to return the sequence
revComp
Boolean If true return the reverse complement sequence
Returns:
Type Description String -
moveContig(oldIndex, newIndex)
-
Move a contig from one index to a new one
Name Type Description oldIndex
Number Index of contig to move (0-based)
newIndex
Number New index for the contig (0-based)
-
removeContigs(contigs)
-
Remove contigs. See removing records for details. Notes:
- Removing contigs, will remove the features associated with the contig
- This will only work with contigs in Sequence.contigs(). It will not remove the mapContig.
- Will not remove last contig. If removing all contigs, the last contig will not be removed.
Name Type Description contigs
Contig | Array Contig or a array of contigs to remove
-
toJSON()
-
Returns JSON representing the object
-
toString(){String}
-
Return the class name as a string.
Returns:
Type Description String - 'Sequence'
-
update(attributes)
-
Update sequence attributes. See updating records for details.
Name Type Description attributes
Object Object describing the properties to change
-
updateContigs(contigsOrUpdates, attributes)
-
Update attributes for one or more contigs. See updating records for details.
Name Type Description contigsOrUpdates
Contig | Array | Object Contig, array of contigs or object describing updates
attributes
Object Object describing the properties to change