Jmol users -- important new capability of Jmol.

Periodically people ask for the capability to delete atoms in Jmol. We 
developers had discussed this and concluded that Jmol wasn't in the 
"molecule construction" business, so I didn't do anything with it. 
Recent suggestions that we be able to delete whole models (or "frames") 
and recover memory for those got me thinking. It seemed like something 
to try, so Thursday I spent the day seeing if I could implement model 
deletion, and I'm happy to say that, though complicated, this was 
actually not too difficult, and Jmol 11.5.17 now allows full model 
deletion using a modified ZAP command:

  ZAP {atom expression}

for example:

  ZAP 1.2  # delete the second model in the first file
  ZAP 2.0  # delete all models in the second file
  ZAP model > 3 # delete all but the first three models
                #  (in a simple animation)

ALL atoms in any model associated with the selection are deleted, so for 
example:

  ZAP 3

deletes all models that have a PDB residue number 3.

Memory is recovered when this is done, provided I don't have a bug there.

The command also selects all atoms, removes the background model, and 
displays all frames (because you might have deleted one of the currently 
displayed frames, and I'm too lazy to figure out how to track that).


SPECIFIC ATOM DELETION

But that's not all. This morning I was wondering how difficult it would 
be do delete SPECIFIC atoms, and it turns out that was almost trivial. 
We can now do this:

  DELETE atomno=3

and see the third atom disappear. HOWEVER, the catch is that this does 
not recover any memory. It just takes the atom(s) out of the picture, so 
to speak. (In principle we could UNdelete them.)

  load "caffeine.xyz"
  select *
 > 24 atoms selected
  delete C3
 > 1 atom deleted
 > 23 atoms selected
  select C3
 > 0 atoms selected
  select *
 > 23 atoms selected

So you see, that C3 atom is definitely gone. Still, for small molecules 
that should not be a big issue. Since you can add atoms using

 set appendNew FALSE
 data "append @x"

where x is a variable in the form of standard file data, you can now add 
and remove atoms at will from a Jmol collection. And you can use

 var x = data({*},"xyz")

to collect the data, so you actually can recover memory using:

[[delete some atoms]]
[[append some atoms]]

  var x = data({*},"mol")
  save orientation
  data "model @x"
  restore orientation

(That would be for simple molecules, of course, not PDB files.) On my 
computer I don't even see a flash with that.

There will be bugs -- I see one right now in relation to definitions. I 
forgot to clear out deleted models from the atom definitions. OK, so 
that's 11.5.18....

Bob



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get. 

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to