On Thu, Feb 18, 2010 at 11:20 PM, Otis Rothenberger <o...@chemagic.com>wrote:

> Hello-
>
> I'm working on an atom append script to click append a C atom (methyl group
> actually) to an existing atom in a Jmol model. The following JavaScript
> function works, but it is far from elegant. I'm fairly sure that there are
> Jmol math approaches to deal with some specific script actions that I'm
> attempting, but I could use some guidance. I'm new to Jmol math. The
> function and my questions:
>
> function appendC(x) {
>     var scpt = "select;set appendNew false;data 'append'|1|add|At 2 2 2|end
> 'append';show data;select astatine;"
>     scpt += "{selected}.element='C';connect (selected)(atomIndex=" + x +
> ");select *;wireframe 0.15; spacefill 23%;boundbox {*};"
>     scpt += "centerat boundbox;delete hydrogens;minimize addHydrogens;"
>     jmolScript(scpt, "01");
> }
>
> x is the atomIndex of the clicked atom via a pickCallback function.
>
> 1) The ridiculous addition of astatine relates to my inability to use
> getProperty for the atomIndex of the newly appended atom, so I appended a
> very rare element, selected it, and changed it to carbon. Is there a way to
> get this atomIndex a bit more gracefully?
>
> The next atom to be added will have the atomIndex equal to the number of
atoms present originally:

{*}.length



> 2) The 2 2 2 coordinates were selected to get the appended atom away from
> existing atoms in ammonia. I'd really like a general approach to get this
> atom outside of the VDW surface of any molecule. I know how to calculate the
> isosurface area if I generate it, but I really don't want a surface painted
> on the screen. Further, I'm not sure the area will help. I could calculate a
> diameter, but in a long molecule, I would still be in trouble. Is there any
> Jmol math approach that will calculate a safe distance for this appended
> atom?
>

Why not just put it where you want it to go?


>
> 3) One approach is to really put the appended atom into orbit. The
> coordinates 50 50 50 actually work with ammonia. By using a zoom 2000, you
> can even see the result. The function really works very nicely if you get
> the appended atom away from existing atoms. If you do not, then the minimize
> produces chemical nonsense even though I explicitly connect only the two
> atoms. If this orbit approach turns out to be the best approach, then a
> scaling factor that normalizes molecule size would be useful. One
> possibility is using math with zoom 100 and the orbit coordinates, 50 50 50.
> Is this math doable with zoom? Is there another math approach that can be
> used to redefine zoom 100?
>
> Any help with the above questions would be appreciated.
>
> Otis
>
> --
> Otis Rothenberger
> http://chemagic.org
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>


-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


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
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to