Class scilligence.JSDraw2.SequenceEditor


class scilligence.JSDraw2.SequenceEditor
SequenceEditor class - define a Sequence Editor
 Example:
   <html>
   <head>
   <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.10.3/dojo/dojo.js"></script>
   <script type="text/javascript" src='http://[PATH]/Scilligence.JSDraw2.js'></script>
   </head>
   <body>
   <div id='ed'></div>
   <script type='text/javascript'>
     dojo.ready(function() {
       // create a JSDraw SequenceEditor
       var se = new JSDraw2.SequenceEditor("ed", { width: 800, height: 400 });
       se.setFasta('>Protein\nAKDSKFKDFKDJFKJDFKJDKFJDKJFKDJFKDJFKJDF');
       var fasta = se.getFasta();
       var xml = se.getXml();
     });
   </script>
   </body>
   </html>
 
Defined in Scilligence.JSDraw2.Pro.js

Constructor Summary
SequenceEditor (string dv, dictionary options)
Constructor a JSDraw Sequence Editor

Function Summary
clear (bool ask)
Remove all chains
Get Fasta sequence(s)
Calculate the number of Glycosylation Sites
getIP()
Calculate Isoelectronic Point
Get the molecular weight of the macro molecule
Calculate Molar Extinction Coefficient
Get the sequence size
getXml()
Remove data as an XML string, like
setFasta (bool s)
Set fasta data
setXml (string xml)
Set xml data

Event Summary
bool onchange (cmd editor)
Called when the structure is changed

Constructor Details

constructor SequenceEditor

SequenceEditor(string dv, dictionary options)
Constructor a JSDraw Sequence Editor
Parameters:
dv - the id of the div placeholder
options - the options for the editor:
  • bio - Biological type. It can be protein, gene, rna, dna, aa, aa20, aa22, aa26
  • color - fore color
  • height
  • onchange - datachange event handler
  • maxchains - max chain(s) allowed
  • viewonly
  • width

Function Details

function clear

clear(bool ask)
Remove all chains
Parameters:
ask - indicate if asking users for confirmation
Returns:
null

function getFasta

getFasta()
Get Fasta sequence(s)
Returns:
fasta as a string

function getGlycosylationSites

getGlycosylationSites()
Calculate the number of Glycosylation Sites
Returns:
a number

function getIP

getIP()
Calculate Isoelectronic Point
Returns:
a number

function getMolWeight

getMolWeight()
Get the molecular weight of the macro molecule
Returns:
a number

function getMolarExtinctionCoef

getMolarExtinctionCoef()
Calculate Molar Extinction Coefficient
Returns:
a number

function getSize

getSize()
Get the sequence size
Returns:
a number

function getXml

getXml()
Remove data as an XML string, like
Returns:
xml as a string

function setFasta

setFasta(bool s)
Set fasta data
Parameters:
s - fasta string
Returns:
null

function setXml

setXml(string xml)
Set xml data
Parameters:
xml - xml data
Returns:
null

Event Details

event onchange

bool onchange(cmd editor)
Called when the structure is changed
Parameters:
editor this SequenceEditor
Returns:
null