Dear Luciano,

Here is my suggestion. I may not have all this right and I am certainly willing to be corrected and learn from others!

When javascript wants to get information from Jmol about the currently loaded model(s), I think the best method is, in javascript:

jmolEvaluate("jmol expression");

This function is defined in Jmol2.js, packaged with the Jmol download. The value of the jmol expression will be returned to javascript.

This Jmol command reports the sequence in one-letter code, separately for each chain:

print {protein}.find("sequence")

So in javascript, I think this will work (but I haven't tested it):

jmolEvaluate("{chain=a}.find(\"sequence\")");

This, of course, reports the sequence of residues that have coordinates. It will not include the sequences of portions of the expressed crystallized protein chain with missing residues due to crystallographic disorder. Determining that sequence, as far as I know, requires parsing the SEQRES records in the PDB file header (or the appropriate place in the mmCIF file-- remember PDB format is going to be phased out by the Protein Data Bank in favor of what they call PDBx which is just another name for mmCIF format). (PDBe has the best sequence report showing missing residues greyed out, e.g. http://www.ebi.ac.uk/pdbe-srv/view/entry/1D66/primary.html -- FirstGlance in Jmol reports the number of missing residues in each chain along with the number of missing + and - charges in each chain, and the sequence ranges that are missing. In the Molecule Information Tab, click on Missing Residues.)

For example, in 2ace, residues 485-489 are missing. PDBe reports:
N       P       N       E       P       H       S       Q       E       S       
K       W       P


Jmol's find("sequence") reports this as follows:
...NPNE //* 484 *//.
//* chain A protein 490 *// ~p~SKWP...

I have used jmolEvaluate() extensively in FirstGlance in Jmol, for example to count various kinds of atoms. You will see some of those reports in the Molecule Information Tab (first tab) in FirstGlance.

==========
MESSAGECALLBACK

I have used message callback extensively in FirstGlance in Jmol, mostly way back with early versions of Jmol (but the code is still in there and isn't broken so hasn't been "fixed"). I think it is best used when javascript is waiting for some event in Jmol to happen, rather than when javascript simply wants to ask a direct question. The message callback function can watch the callback stream and take appropriate action in javascript when the desired event happens and is reported in that stream.

I'll be happy to try to answer specific questions if they fall within the 5% of Jmol that I understand :) Kudos to Bob Hanson for creating the other 95% which remains for me to discover and be astonished and delighted with!
And for keeping Jmol almost 100% backward compatible!

-Eric

Eric Martz, Professor Emeritus, Dept Microbiology
U Mass, Amherst -- Martz.MolviZ.Org <http://Martz.MolviZ.Org>

 * Top Five 3D MolVis Tools: Top5.MolviZ.Org <http://top5.MolviZ.Org>
 * FirstGlance: 3D Molecules in /Nature/: FirstGlance.Jmol.Org
   <http://firstglance.jmol.Org>
 * Protein 3D Structure Wiki: Proteopedia.Org <http://proteopedia.Org>
 * Education: Biochem in 3D at MolviZ.Org <http://MolviZ.Org>
 * Find Functional Patches in Proteins: ConSurf <http://consurf.tau.ac.il>
 * Atlas of Macromolecules: Atlas.MolviZ.Org <http://atlas.MolviZ.Org>
 * Interactive Molecules in Architectural Spaces:
   MolecularPlayground.Org <http://molecularplayground.Org>
 * Workshops: Workshops.MolviZ.Org <http://workshops.MolviZ.Org>

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to