New Molecular Graphics Scripting Language Authors: Ihm J. Zlateve ...

vroomhuhSoftware and s/w Development

Nov 4, 2013 (3 years and 9 months ago)

87 views



NMGSL

N
ew
M
olecular
G
raphics
S
cripting
L
anguage
Authors:
Ihm J.
Zlateve E.
Darakev N.


The language being compiled

Similar to Jmol scripting language

More intuitive than Jmol scripting language


Commands
s
et <target>
Sets the target runtime environment.
E. g. “set jmol” sets it to jmol
Load <filename>
Loads a molecule from a given filename.
E. g. “load 1crn.pdb” loads 1rcn.pdb file.
Rotate <x|y|z> <degrees>
Rotates the molecule about the specified axis.
E. g. “rotate x 90” rotates the molecule 90 degrees about the x-
axis.


Commands
Spacefill <on|off> | <value>
On and off turn the spacefill on an off respectively. Value sets
the size of the spheres.
Backbone <on|off>
On and off turn the backbone representation on and off
respectively.
Backbone <value>
Sets the size of the cylinders of the backbone


Select <expression>
Define the current selected region of the molecule.
Restrict <expression>
Hide everything but the selection.
Background <color>
Sets the background of the canvas.
E. g. “background cyan” sets the canvas to cyan.
Cartoon <number>
This command sets the display representation to thick ribbons.


Commands
Clipboard (only for rasmol)
Place a copy of the current displayed image in the
clipboard (Windows and mac only)
Color <object> <color>
Color <color>
Colors the atoms of the selected region. In case object
is selected, it colors the specified object.


Expressions
select (4-9 in chain a) and (3-11 in chain a)
Selects residues 4 to 9 in chain a and also
residues 3 to 11 in the same residue
select atomno=4-27
Selects atoms from 4 to 27.
select resno = 2-14 in chain d
Selects residues 2 to 14 in chain d
select not hetero
Selects all non hydrogenous atoms in the
molecule


Lexical issues

Case sensitivity
The main lexical issue that we had was case
sensitivity of the commands.

We fixed it by using regular expressions that
took any case of each command

We used simple regular expressions

E. g. for the load command we used [lL][oO]
[aA][dD] instead of the -i flag which is not
supported by older versions of flex.


Parser Issues

The main parser issues that we had were shift
reduce conflicts.

We used a small program called gramdiag for
easier eilimination of shift reduce conflicts.

Saving variables

Type clashes

Error recovery


The intermediate language used

We are using Jmol/Rasmol scripting language
as our intermediate language.


The backend issues in compiling
this language
Jmol backend

We wrote a patch that lets us run jmol in a mode
that accepts piped input.

We used Jmol svn version for that

Elena wrote to Jmol developers so that they can
add the patch to their svn

They had disagreement to the way the patch
was implemented.

They wrote their own version of the patch.


The backend issues in compiling
this language
Pymol

We wrote a script that loads Pymol and takes
any piped stream or standard in.

TODO

Make our script to enable vsl in ConScript
automatically so that we can feed vsl commands to
it.


The backend issues in compiling
this language
Rasmol

TODO

We don't have a backend for Rasmol