Hi,
I'm using the Jmol applet to make a visualisation of certain molecules.
From the menu, it is easy to select for example all carbon, or all
oxygen atoms. But is it also possible to give each specific atom an
identifier, and then highlight some of these atoms with some code in
javascript?
Thanks,
Leander

On Thursday 27 July 2006 16:37, Leander Schietgat wrote:
> I investigated the possibility of using Jmol, but as I understand it
> needs actual 3D-coordinates, which I don't have. Does anyone of you have
> any pointers to a program that can handle these kind of representations?
Please have a look at the Chemistry Development Kit (CDK) [1] and JChemPaint
[2] (which uses the CDK). JChemPaint is a 2D chemistry diagram
renderer/editor, and has an applet version. The CDK provides the actual
rendering and 2D coordinate generation functionality.
Kind regards,
Egon
1.http://cdk.sf.net/
2.http://jchempaint.sf.net/
--
e.willighagen@...
Cologne University Bioinformatics Center (CUBIC)
Blog: http://chem-bla-ics.blogspot.com/
GPG: 1024D/D6336BA6

On Tuesday 25 July 2006 03:58, Miguel wrote:
> > On Jul 24, 2006, at 3:37 PM, Miguel wrote:
> >> I suggest that if you want to add this to Jmol 10 that it may be
> >> easier to
> >> add a separate 'interpolate' step that actually calculates and
> >> stores the
> >> intermediate positions of the atoms.
> >
> > Would you ming elaborating a bit on this?
>
> As I recall, one of the problems with 'interpolation' in Jmol v9
> animations was that the locations of the atoms were not actually
> calculated and stored.
They were. Jmol v6-v9 (maybe even earlier releases, not sure when the
interpolation was hacked in) use linear interpolation, with the goal of a
more smooth fitting later, which I never implemented, as the linear code was
for many application already reasonable (just don't make the time steps too
large before before input into Jmol).
> Rather, the locations of the atoms were dynamically
> calculated as each frame was drawn.
I'm quite sure I the interpolated frames were new extra models, instead of
dynamic calculation. At least that is how it was originally implemented, but
maybe I missed some recoding here...
> At the time I thought that this was too complicated ... because it meant
> that the code to calculate the position in real-world Angstrom coordinates
> was comingled with the code to transform into screen coordinates AND, to a
> certain extent, the code for rendering. Additionally, the code needed to
> know a lot about the 'model' representation, since the interpolation took
> place between two models.
The original implementation assumed all 'model's to have an equal number of
atoms, and to be sorted equally, so that atom 1 in all frames was always the
same atom.
I can't remember to have fiddles with real-world/screen coordinates when doing
interpolations...
> In order to reduce this complexity I think it would be better to break
> this up into pieces. I thought about something like a separate
> 'interpolate <n>' command where <n> was the number of steps to introduce
> between existing models. I was thinking that it would actually introduce
> new models. That way the interpolation code could focus on interpolation,
> and not have to worry about screen transformation issues.
Right.
> The biggest problem that I see with this approach is that you would be
> inserting new models between existing models. That would require some
> rework of the model/frame code.
>
> So, as I am writing this it occurs to me that maybe the other approach
> isn't so bad. As an example of how this would work, you can take a look at
> the vibration code. That code dynamically applies the vector to adjust the
> atom position immediately before the transformation. It works well for the
> vibrations because the location of each atom is transformed individually.
>
> If you wanted to apply this to animations, then I think that you would
> want for the atom in frame <n> to be used from frame <n - 0.5> to frame <n
> + 0.5>, where I am using a fractional frame value to represent an
> interpolated value.
>
> At the beginning it would be easiest to use linear interpolation between
> the two frames ... so the location of an atom at frame 1.25 would be the
> location at frame 1 + 0.25 * vector from frame 1 to frame 2.
Doesn't this double the required calculations? Two instead of one, for each
frame? Calculation of vector(fr1, fr2) for linear interpolation is quite
cheap, but for smoother interpolations, if we really need them (see above),
this might be bad... but this computation time might be neglectible with the
actual time needed for redering...
> If you could structure it this way, I think it would be best if a the
> interpolation routine was written to take 4 atom positions ... to
> interpolate between atoms n & n+1 you would also pass in frames n-1 and
> n+2. This would allow a smoother cubic spline interpolation that would
> give better results. Even if you don't implement this at the beginning,
> try to structure the code this way so that the parameters will be
> available in the future.
Sound good.
> Some other problems that always bugged me related to interpolating
> animations between frames ...
> - you will need to interpolate atom sizes as well
> - you may need to interpolate atom colors as well
> - it isn't clear to me how other atom characteristics should be handled
As Jmol v9 assumed the same atom, coloring used to be no problem... and it
never dealt with different atom sizes depending on bonding or charge... not
on interpolation, at least...
> I think that these things may also have pushed me towards the separate
> 'interpolate' command ... because these issues potentially introduce a lot
> of complexity that would be hard to handle as part of the rendering cycle.
A separate interpolate command sounds good
> I realize that my comments may still be too hard to understand. Give some
> thought to the problem and please feel free to ask specific questions.
Egon
--
e.willighagen@...
Cologne University Bioinformatics Center (CUBIC)
Blog: http://chem-bla-ics.blogspot.com/
GPG: 1024D/D6336BA6

Hi all,
I have some descriptions of molecules in a graph-like form, e.g.:
1(H), 2(O), 3(H)
1 2 1, 2 3 1
which means this is a molecule with three atoms and two bonds between
them (the first two numbers of a bond giving the atoms involved, the
third stating that it is a single bond).
Now I'm looking for a simple program that can load in such
representations and show a 2D-representation of the molecule (and if
possible highlight some particular atoms and bonds).
I investigated the possibility of using Jmol, but as I understand it
needs actual 3D-coordinates, which I don't have. Does anyone of you have
any pointers to a program that can handle these kind of representations?
Many thanks,
Leander Schietgat
Dept. of Computer Science
University of Leuven

Hi,
I'm new user of Jmol.
I'd like to build web application based on Jmol and SCAVER program
(http://ncbr.chemi.muni.cz/~petrek/scaver/) This program seach protein for
possible tunnels from some given point (usually active site).
To do this i need to mark the starting point in protein and to move this
point
based on client html buttons (or somehow). This starting point can be
visualized for example by P atom or anything else (little cross).
My question is:
Is it posible to change single atom position by client javascript or use
some dynamic graphics mark (cross, label, etc)
I made some tests based on LoadInline routine and rewriting PDB data on
client but is very slower unpractical (need to keep orientation, selections,
etc)
M. Petrek
--
View this message in context: http://www.nabble.com/Specify-some-point-in-molecule-tf2002870.html#a5500234
Sent from the jmol-users forum at Nabble.com.

Hi Bob!
> 1) Does this action of QUIT/EXIT make sense?
yes
> 2) Do you use LOOP ?
no
> 3) Will this cause any serious difficulty?
not to the way I use things
> 4) Should the default be "set scriptQueue ON" or "set scriptQueue OFF"
> ?
since this solves some threading issues I would vote for setting the
default to ON.
Andreas
-----------------------------------------------------------------------
Andreas Prlic Wellcome Trust Sanger Institute
Hinxton, Cambridge CB10 1SA, UK
+44 (0) 1223 49 6891

I would be interested in hearing more about what Eric means by
"interpolation". An analogy to graphic data seems appropriate. A
distinction I would bring up is between taking a set of dots
on a graph and (a) connecting them with line segments or (b) drawing the
best-fit curve through them. In the first case you get a fairly
unsatisfying set of interpolations. In the second you get a smooth curve
at the expense of adjusting the data.
NOW, if your interest in interpolation is to just do (a) -- make a
linear interpolation between each frame -- I think that might be less
interesting. If, on the other hand you are interested in actually
creating a time-based "best fit curve" through the data -- basically
fitting each atom through a sequence of frames, determining a smooth
curve, and then redoing the frames with interpolated frames to create
the best-fit animation, THAT might be more interesting.
Another possibility is to implement a moveto-like transition between
frames. The idea here would be that the positions you see are
interpolations of frames while the animation is running, but you can
only stop at actual frames. Starting in a given frame, something like:
FrameTo <target> <number of interpolations per frame> <overall
frames_per_second>
The problem there to sort out would be what to do about helixes and
such. These really should be recalculated at each point. That might be
asking for a lot, but maybe not. It's interesting that Jmol can
calculate helixes and sheets -- it doesn't need to be told where they
are. And it's very fast.
I worry about the overhead, though. AH.... how to do this without
messing up the data? How about this: a special frame that gets LOADED
with atom data and it is just that "animation frame" that you are
seeing. One frame. Perhaps with a special number, like 9999. (When
multiple files are loaded, then frames come in with numbers like 1001,
1002, 2001, 2002, so 9999 wouldn't be out of the question.) You could
even define the frame number using some simple SET command. "set
animationFrameNumber 9999"
Then perhaps one could say:
frame smoothAnimation <firstFrameNo> <lastFrameNo>
<interpolationsPerFrame> <interpolationsPerSecond> <otherOptions>
The cool thing about this is that you could do all the manipulation you
want -- rotations, zooming, etc. -- while the thing is playing, and it
would work just fine. Basically the rendering/animation engine would
work just like ever, with the data changing under it.
So my proposal would be a single frame that is a clone of the atom set
and is loaded on the fly. I think I've successfully separated the
rendering functions from the calculation and visibility issues. There
are no longer any aspects of visibility that are being determined DURING
rendering - so we can define the state of the system at any time.
If necessary, we could do a precalculation, but I suspect the real issue
there is scalability. You can't just preload 10,000,000 atom locations,
helix information, etc. But, on the other hand, there might be a way to
stream this -- to save an animation in some format using the application
and then stream it in and visualize on the fly. Moving the atoms is no
real problem. Miguel's analogy to vibration is intriguing. One could
define this all in terms of differences and the sequence of getting from
frame A to frame B as, in essense, a once-through vibration vector.
Interesting idea.
Bob
eric capps wrote:
>By interpolation between frames, I mean: an option, in the animation
>menu, to create a number of "transition" frames between two frames in
>an animation to make it look smoother. This is how it was described
>to me:
>
>"I don't know how it work under the hood, but in the jmol 9 that I
>use, when you open the Extras->Animate panel, you can check
>'interpolate between frames', and choose the number of frames that it
>will add between the ones you have loaded."
>
>Googling it turned up this alone: http://thomas.kuehne.cn/references/
>jmol.diff.
>
>Weird? Maybe this was a branch that didn't catch on or something, but
>if it in fact is not implemented in Jmol 10, I could take a stab at it.
>
>On Jul 24, 2006, at 12:33 PM, Bob Hanson wrote:
>
>
>
>>Eric,
>>
>>What does that mean, "interpolation between frames"? I suspect the
>>answer is "no", and I can't imagine that Jmol 9 did it.
>>
>>Bob
>>
>>
>
>-------------------------------------------------------------------------
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share your
>opinions on IT & business topics through brief surveys -- and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>_______________________________________________
>Jmol-users mailing list
>Jmol-users@...
>https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>

> On Jul 24, 2006, at 3:37 PM, Miguel wrote:
>> I suggest that if you want to add this to Jmol 10 that it may be
>> easier to
>> add a separate 'interpolate' step that actually calculates and
>> stores the
>> intermediate positions of the atoms.
>
> Would you ming elaborating a bit on this?
As I recall, one of the problems with 'interpolation' in Jmol v9
animations was that the locations of the atoms were not actually
calculated and stored. Rather, the locations of the atoms were dynamicall=
y
calculated as each frame was drawn.
At the time I thought that this was too complicated ... because it meant
that the code to calculate the position in real-world Angstrom coordinate=
s
was comingled with the code to transform into screen coordinates AND, to =
a
certain extent, the code for rendering. Additionally, the code needed to
know a lot about the 'model' representation, since the interpolation took=
place between two models.
In order to reduce this complexity I think it would be better to break
this up into pieces. I thought about something like a separate
'interpolate <n>' command where <n> was the number of steps to introduce
between existing models. I was thinking that it would actually introduce
new models. That way the interpolation code could focus on interpolation,=
and not have to worry about screen transformation issues.
The biggest problem that I see with this approach is that you would be
inserting new models between existing models. That would require some
rework of the model/frame code.
So, as I am writing this it occurs to me that maybe the other approach
isn't so bad. As an example of how this would work, you can take a look a=
t
the vibration code. That code dynamically applies the vector to adjust th=
e
atom position immediately before the transformation. It works well for th=
e
vibrations because the location of each atom is transformed individually.=
If you wanted to apply this to animations, then I think that you would
want for the atom in frame <n> to be used from frame <n - 0.5> to frame <=
n
+ 0.5>, where I am using a fractional frame value to represent an
interpolated value.
At the beginning it would be easiest to use linear interpolation between
the two frames ... so the location of an atom at frame 1.25 would be the
location at frame 1 + 0.25 * vector from frame 1 to frame 2.
If you could structure it this way, I think it would be best if a the
interpolation routine was written to take 4 atom positions ... to
interpolate between atoms n & n+1 you would also pass in frames n-1 and
n+2. This would allow a smoother cubic spline interpolation that would
give better results. Even if you don't implement this at the beginning,
try to structure the code this way so that the parameters will be
available in the future.
Some other problems that always bugged me related to interpolating
animations between frames ...
- you will need to interpolate atom sizes as well
- you may need to interpolate atom colors as well
- it isn't clear to me how other atom characteristics should be handled
I think that these things may also have pushed me towards the separate
'interpolate' command ... because these issues potentially introduce a lo=
t
of complexity that would be hard to handle as part of the rendering cycle=
.
I realize that my comments may still be too hard to understand. Give some=
thought to the problem and please feel free to ask specific questions.
Miguel

On Jul 24, 2006, at 3:37 PM, Miguel wrote:
> I suggest that if you want to add this to Jmol 10 that it may be
> easier to
> add a separate 'interpolate' step that actually calculates and
> stores the
> intermediate positions of the atoms.
Would you ming elaborating a bit on this?
-Eric

> By interpolation between frames, I mean: an option, in the animation
> menu, to create a number of =22transition=22 frames between two frames =
in
> an animation to make it look smoother. This is how it was described
> to me:
>
> =22I don't know how it work under the hood, but in the jmol 9 that I
> use, when you open the Extras->Animate panel, you can check
> 'interpolate between frames', and choose the number of frames that it
> will add between the ones you have loaded.=22
Yes, Jmol 9 had this feature.
It did linear interpolation of atom positions between frames.
> Googling it turned up this alone: http://thomas.kuehne.cn/references/
> jmol.diff.
>
> Weird? Maybe this was a branch that didn't catch on or something, but
> if it in fact is not implemented in Jmol 10, I could take a stab at it.=
Most of the internal architecture was redone with Jmol 10.
This feature related to animation was lost.
I suggest that if you want to add this to Jmol 10 that it may be easier t=
o
add a separate 'interpolate' step that actually calculates and stores the=
intermediate positions of the atoms.
I also suggest that you may want to consider using a spline-type
interpolation rather than a linear interpolation. I think that would give=
better interpolated results in that the interpolated positions would be a=
smoothed position across 4 points rather than a linear position between 2=
points.
Miguel

By interpolation between frames, I mean: an option, in the animation
menu, to create a number of "transition" frames between two frames in
an animation to make it look smoother. This is how it was described
to me:
"I don't know how it work under the hood, but in the jmol 9 that I
use, when you open the Extras->Animate panel, you can check
'interpolate between frames', and choose the number of frames that it
will add between the ones you have loaded."
Googling it turned up this alone: http://thomas.kuehne.cn/references/
jmol.diff.
Weird? Maybe this was a branch that didn't catch on or something, but
if it in fact is not implemented in Jmol 10, I could take a stab at it.
On Jul 24, 2006, at 12:33 PM, Bob Hanson wrote:
> Eric,
>
> What does that mean, "interpolation between frames"? I suspect the
> answer is "no", and I can't imagine that Jmol 9 did it.
>
> Bob

Eric,
What does that mean, "interpolation between frames"? I suspect the
answer is "no", and I can't imagine that Jmol 9 did it.
Bob
eric capps wrote:
>Does 10.x support interpolation between frames in animation? I have
>heard that Jmol 9 supported this, but I can't seem to find
>information about it anywhere in 10.x. Was this feature discontinued?
>
>-------------------------------------------------------------------------
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share your
>opinions on IT & business topics through brief surveys -- and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>_______________________________________________
>Jmol-users mailing list
>Jmol-users@...
>https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>

I have a post on slightly out-of-time topic, but helpful I think.
The "applet.script is not a function" javascript error in firefox
seems to be caused by Adblock extension. When the extension
is disabled or removed (temporary disabling ad-blocking is not
enough), evertyhing works again.
I'll try to ask adblock authors to be more kind to jmol.
--mb
> Michal Bozon wrote:
>
>> I have another problem with Jmol in firefox on linux. The
>> http://theory.cm.utexas.edu/~eruhk/vis.html mentioned previously, does
>> not crash for me, but the (radio)buttons do not work, and in the firefox
>> Error Console, "applet.sctipt is not a function" error appears. This bug
>> happens often (but not always) for varius jmol sites.
>>
>> I have observed, that when I browse jmol web from localhost
>> (jmolInitialize secure flag set to 1), the buttons work, but when
>> browsed through web server, it does not.
>>
>> In Opera, or Konqueror, it works well.
>>
>> Has anyone else experienced this kind of error ?
>>
>> --mb
>>
>>
>>

Jmol 10.x.33 introduces:
AJAX-JS support
Jmol-new.js now supports Asynchronous JavaScript, allowing web
developers to create pages that draw from any molecular data resource on
the web. To use this service, nothing more than Jmol-new.js is required.
No server-side application is needed. Currently both of the two known
AJAX-JS servers are supported -- one at St. Olaf College serving up RCSB
biomolecular structures as well as just about any uncompressed
structural model files anywhere on the web, and the American
Mineralogical Society's AJAX mineral structure server at the University
of Arizona.
Using the latest (7/22/6)
http://www.stolaf.edu/people/hansonr/jmol/test/proto/Jmol-new.js, the
following simple JavaScript function:
jmolLoadAjax_STOLAF_RCSB()
automatically loads any CIF file in the Protein Data Bank into YOUR
applet (by prompting the user).
Similarly
jmolLoadAjax_STOLAF_ANY()
loads ANY uncompressed resource (that isn't too large) on the web into
YOUR applet.
To repeat, because it's still a bit strange to most of us, AJAX-JS
programming technology allows you to call up resources from some server
(not necessarily your own -- a key point) without totally reloading the
page. It's as though your applet were connected to anybody's system. The
days of "only data from my server" are gone. Even better, it's not
rocket science. All Ajax-JS does is set up something called a "DOM
script node" that loads and runs JavaScript. Unlike HTML or XML,
JavaScript in browsers can come from any number of machines anywhere on
the web. The AJAX servers are delivering molecular structures "wrapped"
as JavaScript arrays, thus allowing them to be sent to any machine.
Jmol-new.js just has a few small functions that send and receive this
data and then load it inline to the applet.
These two Jmol-new.js functions use an AJAX-JS server at St. Olaf
College to deliver the necessary JavaScript.
A second AJAX-JS site has been established at the University of Arizona,
courtesy of Bob Downs of the Mineralogical Society of America, and the
work of Ian Johnson. See http://rruff.geo.arizona.edu/AMS/amcsd.php
To insert this mineralogical data directly into Jmol, use
jmolLoadAjax_MSA()
It prompts for a field (mineral, author, etc.) and then a value, such as
"quartz"
HoverCallback
When a user's mouse hovers over an atom, usually what happens is that a
box pops up that identifies that atom. HoverCallback works like
pickCallback, except the user doesn't have to click. Hovercallback is
active even if hover OFF has been executed. Thus, with hover OFF the
user will not see any effect of hovering, while the web page can be made
fully aware of it. Callback functions can now be specified using the
Jmol-new.js function "jmolSetCallback":
jmolSetCallback("messageCallback","functionName")
jmolSetCallback("pickCallback","functionName")
jmolSetCallback("hoverCallback","functionName")
jmolSetCallback("loadstructCallback","functionName")
jmolSetCallback("animFrameCallback","functionName")
which presumes the JavaScript
function functionName(appID, atomInfo, atomIndex) {...}
(Frankly, I don't know if loadstructCallback really does anything much.)
Make sure that function name is in quotes. We're just passing the NAME
of the function, not the function itself, to Jmol. The first parameter
in the callback is the applet id. Second is a descriptive string
indicating the atom's identity and xyz coordinates. Third is the atom's
index (atomIndex), which can be used, for example, with
var atomData = jmolGetPropertyAsArray("atomInfo",
"atomno="+(atomIndex+1))[0]
(This says, "return the atom info entry for atomno=n", where n is one
more than that atomIndex given in parameter 3. This information comes
back as an array with only one element, 0.) See
http://www.stolaf.edu/people/hansonr/jmol/docs/atomInfo.txt for details.
The calls to jmolSetCallback() must be made BEFORE the call to
jmolApplet() so that the applet code can incorportate them.
set scriptQueue ON and quit/exit
Many people have reported issues with script commands running over each
other, and it was also found that scriptWait() worked for the applet
only, not applications. These problems were due to the fact that
different scripts run on different threads on their way into Jmol but
use the same underlying data structure.
This problem now largely solved (pending more testing, perhaps by YOU).
applet.jmolScript() and viewer.script() deliver scripts to a queue, and
if that queue is turned on using "set scriptQueue ON", they are properly
sequenced. Thus, when the queue is turned on, each script waits for the
previous to complete.
Note that this is NOT standard Jmol procedure for the reason that
sometimes one needs one script to interrupt another, as, for example,
when a LOOP command is involved. In that case, the only way to interrupt
the looping script is with another script. So, to account for this
issue, the roles of "quit" and "exit" have been expanded. quit or exit
at the very beginning of a script command halts any previous
still-running script. Anywhere else in the command, quit and exit abort
that specific running script. In addition, exit clears the script queue
of any remaining scripts, thus stopping all script processing. You can
try this out at
http://www.stolaf.edu/people/hansonr/jmol/test/proto/new.htm. I've also
implemented it at http://fusion.stolaf.edu/chemistry/jmol/xtalx, where
you can experiment some with AJAX as well.
The current plan is to make scriptQueue OFF the default. So if you like
this function, you should use "scriptQueue ON" explicitly. I tried this
some at these sites and could not get the applet to crash. Even quickly
clicking 20 links in a row allows all 20 to run.
set logLevel 0-5
Nico and I wrote code to allow much better
error/warning/information/debug reporting specifically to the Java
console. See the new documentation of "set logLevel" at
http://www.stolaf.edu/people/hansonr/jmol/docs . The default log level
is 4: all errors, warnings, and information, but not full debugging
(which is 5). You will find the Java console much cleaner.
Bob

This was discussed a while back, but I forget what the score was, and
the jmol.js page on sourceforge still refers to the 'upcoming
realease Jmolv10'.
I have just switched my site from using the Jmol applet with Chime
buttons to the Jmol 10.0 applet with jmol.js. This seems to mean
dropping all support for Mac OS8/9 - something that I can live with,
although if there is any way out I'd like to be able to offer it. So
two questions:
1. Which version of java is required for the 10.0 applet? If it
requires 1.2, that kills it on OS8/9.
2. However, if it only requires java 1.1, are there any versions of
Mozilla or anything else for OS9 that support the LiveConnect needed
for jmol.js?
David
--
_______________________________________________________________
David P.Leader, Biochemistry and Molecular Biology
Davidson Building, University of Glasgow, Glasgow G12 8QQ, UK
Phone: +44 41 330-5905 http://doolittle.ibls.gla.ac.uk/leader
_______________________________________________________________

Andreas Prlic wrote:
>I guess all the Evals should go through a common queue ...
>
>Andreas
>
>
In fact, provided we can now reliably wait for script execution, the
script queue concept seems quite possible and maybe even a solution to a
very very old problem.
I've written a ScriptManager to handle these, and my preliminary testing
indicates that it works. I cannot break the applet (Windows PC) no
matter how fast I send it scripts, and every script runs to completion,
regardless of how many delays and animations and such are involved.
(Previously, scripts interrupted other scripts.)
One of the interesting aspects of this is that you (or the user) can
give as many commands as quickly as you wish, and they will be processed
in due time. There is no absolute need for "scriptWait()".
Now, this could be a problem if LOOP commands are used, because there
isn't any provision for otherwise stopping a running script. So I've
enabled two essentially nonfunctional commands: QUIT and EXIT as follows:
QUIT alone or in the middle of a script stops a currently running
script at that point
QUIT at the beginning of a script stops a currently running script
and starts the next one
EXIT alone or in the middle of a script stops a currently running
script at that point and flushes all unstarted scripts from the script
queue.
EXIT at the beginning of a script stops the currently running
script and flushes all unstarted scripts from the script queue.
Since this is a new behavior, I've set it up so that there is a flag:
set scriptQueue ON/OFF
which is by default OFF -- more like current behavior, I think. (But I'm
not sure)
So my questions to users are:
1) Does this action of QUIT/EXIT make sense?
2) Do you use LOOP ?
3) Will this cause any serious difficulty?
4) Should the default be "set scriptQueue ON" or "set scriptQueue OFF" ?
Bob

OK, I see you are giving a talk. Good luck. I'd be interested in whether
anyone else is using Jmol for anything.
Bob
Alan Hewat wrote:
>At 21:06 20/07/2006, Bob Hanson wrote:
>
>
>
>>var Atoms = jmolGetPropertyAsArray("atomInfo")
>>for (var i = 0; i < Atoms.length; i++) {
>> var element = Atoms[i].element .... }
>>
>>(I have added "element" in the latest update because I see how this could be generally valuable.)
>>
>>
>
>That sounds just what I need. Thanks Bob.
>
>
>
>>>Basically you are asking for a "save" option that allows "restoring" some previous bonding combination. That doesn't exist. I guess you could use jmolGetPropertyAsArray("bondInfo") ....
>>>
>>>
>
>I'll play with that, and also with calling a script each time. In the case of polyhedra it is possible to set them up and then just switch them on or off. A similar thing for bonds would be good.
>
>
>
>>>3) I can see how to animate a PDB drawing to switch between different structures separated by "model n" statements, but I can't get that syntax to work for CIF files. Am I missing something simple ?
>>>
>>>
>>Do your CIF files have multiple data_ lines?
>>Show me your cif file. Should just be
>>model 1
>>model 2
>>model 3
>>
>>
>
>I'll have to try this again. I just tried inserting "model 1" etc lines between the complete ICSD CIF files, which individually display fine. But got to go now. I'll give you a wave tomorrow night when I fly over you in Minneapolis on my way to ACA in Hawaii :-)
>Alan.
>
>_____________________________________________________________
>Dr Alan Hewat, ILL Grenoble, FRANCE<hewat@...>fax+33.476.20.76.48
>+33.476.20.72.13 (.26 Mme Guillermet) http://www.ill.fr/dif/AlanHewat.htm
>_____________________________________________________________
>
>
>-------------------------------------------------------------------------
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share your
>opinions on IT & business topics through brief surveys -- and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>_______________________________________________
>Jmol-users mailing list
>Jmol-users@...
>https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>

At 21:06 20/07/2006, Bob Hanson wrote:
>var Atoms = jmolGetPropertyAsArray("atomInfo")
>for (var i = 0; i < Atoms.length; i++) {
> var element = Atoms[i].element .... }
>
>(I have added "element" in the latest update because I see how this could be generally valuable.)
That sounds just what I need. Thanks Bob.
>>Basically you are asking for a "save" option that allows "restoring" some previous bonding combination. That doesn't exist. I guess you could use jmolGetPropertyAsArray("bondInfo") ....
I'll play with that, and also with calling a script each time. In the case of polyhedra it is possible to set them up and then just switch them on or off. A similar thing for bonds would be good.
>>3) I can see how to animate a PDB drawing to switch between different structures separated by "model n" statements, but I can't get that syntax to work for CIF files. Am I missing something simple ?
>Do your CIF files have multiple data_ lines?
>Show me your cif file. Should just be
>model 1
>model 2
>model 3
I'll have to try this again. I just tried inserting "model 1" etc lines between the complete ICSD CIF files, which individually display fine. But got to go now. I'll give you a wave tomorrow night when I fly over you in Minneapolis on my way to ACA in Hawaii :-)
Alan.
_____________________________________________________________
Dr Alan Hewat, ILL Grenoble, FRANCE<hewat@...>fax+33.476.20.76.48
+33.476.20.72.13 (.26 Mme Guillermet) http://www.ill.fr/dif/AlanHewat.htm
_____________________________________________________________

Alan Hewat wrote:
> With much help from Bob Hanson I have Jmol working well on
> ICSD-for-WWW eg:
> http://icsd.ill.fr/icsd/index.php?action=Search&elements=cu+o+h&elementc=5
> <http://icsd.ill.fr/icsd/index.php?action=Search&elements=cu+o+h&elementc=5&gt;
>
> using Jmol 10.x.20a, but I have a few new naive questions :-)
>
> 1) Can Jmol return a list of all atom types in the drawing so that I
> can create a menu to select just some types. Yes I know that the menu
> Jmol/Select/Element does that, but how can I retrieve that list ? I
> suppose there must be some general mechanism for returning information
> from Jmol, but I only know about the drawing instructions. Maybe just
> a pointer to where this feedback mechanism if it exists is described ?
>
There are three ways I can think of for doing this.
One way involves looking at the molecular formula using "moleculeInfo"
http://www.stolaf.edu/people/hansonr/jmol/docs/modelInfo.txt
moleculeInfo[0].mf="H 4 C 1 O 1"
This is a string listing element, count, element, count, ....
It is available for any model, but is a "per molecule" quantity.
You would have to write a little script that would turn this into what
you want, perhaps starting with:
var Molecules = jmolGetPropertyAsArray("moleculeInfo")
for (var i = 0; i < Molecules.length; i++) {
var elementList = Molecules[i].mf
....
}
Another way would be to use the "atomInfo" property, which is probably
better, because (as of TODAY) it includes "element", which gives the
element NAME
http://www.stolaf.edu/people/hansonr/jmol/docs/atomInfo.txt
(for a full list of properties, see the new documentation
http://www.stolaf.edu/people/hansonr/jmol/docs/#getProperty)
So you could use:
var Atoms = jmolGetPropertyAsArray("atomInfo")
for (var i = 0; i < Atoms.length; i++) {
var element = Atoms[i].element
....
}
(I have added "element" in the latest update because I see how this
could be generally valuable.)
Finally, for some CIF files, you could use "auxiliaryInfo", as some CIF
files have _chemical_formula_structural, which is saved as
"structuralFormula"
and some have "_chemical_formula_sum" which is saved as "formula"
auxiliaryInfo.models[0].formula="Si O2"
This is per model, so you could access it using:
var Formula = jmolGetPropertyAsArray("auxiliaryInfo").models[0].formula
> 2) Is there some way I can toggle between all bonds off and on that
> restores only those bonds that were previously visible ? At present I
> just have a simple checkbox that draws all bonds shorter than a limit
> *jmolCheckbox('connect 2.45', 'connect delete', 'bond', 'checked');
> *I suppose I could create a script with more complex bond drawing
> commands and call that from my checkbox to switch it off and on. Hmm,
> maybe in posing the question I have found one answer :-)
>
These are great questions! Basically you are asking for a "save" option
that allows "restoring" some previous bonding combination. That doesn't
exist. I guess you could use jmolGetPropertyAsArray("bondInfo") ....
> 3) I can see how to animate a PDB drawing to switch between different
> structures separated by "model n" statements, but I can't get that
> syntax to work for CIF files. Am I missing something simple ?
>
Do your CIF files have multiple data_ lines?
Show me your cif file. Should just be
model 1
model 2
model 3
....
should work....
> Sorry if these are dumb questions. Alan.
>
>
> _____________________________________________________________
> Dr Alan Hewat, ILL Grenoble, FRANCE<hewat@...>fax+33.476.20.76.48
> +33.476.20.72.13 (.26 Mme Guillermet) http://www.ill.fr/dif/AlanHewat.htm
> _____________________________________________________________
>
>------------------------------------------------------------------------
>
>-------------------------------------------------------------------------
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share your
>opinions on IT & business topics through brief surveys -- and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Jmol-users mailing list
>Jmol-users@...
>https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>

<html>
<body>
With much help from Bob Hanson I have Jmol working well on ICSD-for-WWW
eg:<br>
<a href="http://icsd.ill.fr/icsd/index.php?action=Search&amp;elements=cu+o+h&amp;elementc=5"; eudora="autourl">
http://icsd.ill.fr/icsd/index.php?action=Search&amp;elements=cu+o+h&amp;elementc=5</a&gt;
<br>
using Jmol 10.x.20a, but I have a few new naive questions :-)<br><br>
1) Can Jmol return a list of all atom types in the drawing so that I can
create a menu to select just some types. Yes I know that the menu
Jmol/Select/Element does that, but how can I retrieve that list ? I
suppose there must be some general mechanism for returning information
from Jmol, but I only know about the drawing instructions. Maybe just a
pointer to where this feedback mechanism if it exists is described
?<br><br>
2) Is there some way I can toggle between all bonds off and on that
restores only those bonds that were previously visible ? At present I
just have a simple checkbox that draws all bonds shorter than a
limit:<br>
<b>jmolCheckbox('connect 2.45', 'connect delete', 'bond',
'checked');<br>
</b>I suppose I could create a script with more complex bond drawing
commands and call that from my checkbox to switch it off and on. Hmm,
maybe in posing the question I have found one answer :-)<br><br>
3) I can see how to animate a PDB drawing to switch between different
structures separated by &quot;model n&quot; statements, but I can't get
that syntax to work for CIF files. Am I missing something simple
?<br><br>
Sorry if these are dumb questions. Alan.<br><br>
</body>
<br>
<div>_____________________________________________________________</div>
<div>Dr Alan Hewat, ILL Grenoble,
FRANCE&lt;hewat@...&gt;fax+33.476.20.76.48</div>
<div>+33.476.20.72.13 (.26 Mme Guillermet)
<a href="http://www.ill.fr/dif/AlanHewat.htm"; EUDORA=AUTOURL>
http://www.ill.fr/dif/AlanHewat.htm</a&gt; </div>
<div>_____________________________________________________________</div>
</html>

Jmol users:
Two very simple additions may be of interest to some. See
http://www.stolaf.edu/people/hansonr/jmol/test/proto/new.htm for examples.
(1) Super-fast solvent-accessible surfaces. (As defined by
http://www.netsci.org/Science/Compchem/feature14e.html)
spacefill +1.2
the plus sign indicates that we wish to draw the sphere "1.2 angstroms
beyond the van der Waals radius", and this is VERY fast in Jmol.
(2) New select option for protein/nucleic acid sequences finds specified
sequences.
You can now use one-character sequences in "within()" selection
expressions.
select within("[SEQUENCE"],(atom expression))
for example:
select within("GGCTTTA",*); color red
select within("AGCY",*.CA); color green
This should say what you think it says: "Select all the atoms in the
sequence GGCTTTA" and "Select all the alpha carbons in the sequence
"ala-gly-cys-tyr". -- sort of a substructure() command for biomolecules.
Interestingly, this syntax can equally well be read the other way: "Find
all the sequences GGCTTTA in all the atoms" because it is really just an
"and" operation. That's probably more what people might be interested
in, I would think. In any case, both interpretations amount to the same
thing.
Bob Hanson

Dear Jmol Users:
It was too hot to go outside this weekend so I created a much
improved and extensible version of my Orbitals_to_Web java program.
So far this program automates generating pages that display surfaces
from .cube (and I believe .jvxl) files, or pages that allow the user
to select which molecule is displayed by the Jmol applet. I hope
people find this useful and extend it to generating other skeleton
pages (with any luck more elegant than mine!).
I believe it now may be useful to others and have designated
this as version 1.0. I have set up a web site with more details,
where it can be downloaded. Documentation is still lacking. Sorry :).
The web site is:
http://www.uwosh.edu/faculty_staff/gutow/Jmol_Web_Page_Maker/Jmol_Web_Page_Maker.shtml
Let me know what you think. I would also appreciate help with the
programming. I just learned Java in the last two months.
Jonathan
--
---------------------------------------------------------------------------
Dr. Jonathan H. Gutow
Chemistry Department gutow@...
UW-Oshkosh Office:920-424-1326
800 Algoma Boulevard FAX:920-424-2042
Oshkosh, WI 54901
http://www.uwosh.edu/faculty_staff/gutow/