Re: [Jmol-users] Atom Replacement Problem
Wow, Otis. You are doing some very interesting things here! OK, I will look into it. Sounds like the minimization routine isn't using the correct atom locations. On Thu, Feb 11, 2010 at 7:36 PM, Otis Rothenberger o...@chemagic.comwrote: Hello- I'm using the following JavaScript to replace univalent atoms is a Jmol model: evalRasmol(if ({atomIndex= + atomIndex + }.valence =1){{atomIndex= + atomIndex + }.element = ' + buildAtom + '; wireframe 0.15; spacefill 20%;minimize addHydrogens;boundbox {*};select *;center selected;}); With atomIndex = 1 and buildAtom = Cl, for example, the evalRasmol function is processing the following Jmol script: if ({atomIndex=1}.valence =1){{atomIndex=1}.element = Cl; wireframe 0.15; spacefill 20%;minimize addHydrogens;boundbox {*};select *;center selected;} This all works very nicely, including a new bond length, for one substitution. After that, the substitution is made, but the bond length remains unchanged. Again by way of example, methane changes smoothly to chloromethane. While the next substitution leads to methylene chloride, the methylene chloride has one normal C-Cl bond length and one C-Cl bond length equal to a C-H bond length. In summary, for a wide range of molecules, the above process works well once. After that, bond length for the added atom is not changed. The following variation of the above JavaScript leads to the same result: evalRasmol(if ({atomIndex= + atomIndex + }.valence =1){{atomIndex= + atomIndex + }.element = ' + buildAtom + '; wireframe 0.15; spacefill 20%;minimize addHydrogens;}); The following variation makes it clear that it is the spacefill command that adjusts the added atoms vdw, and it is the minimize command that adjusts the bond length. But only once evalRasmol(if ({atomIndex= + atomIndex + }.valence =1){{atomIndex= + atomIndex + }.element = ' + buildAtom + ';}); Does anyone have any suggestions that might allow subsequent substitutions to behave as the first? As a point of information the JavaScript is initiated by a click callback when the univalent atom is clicked. Otis -- Otis Rothenberger http://chemagic.org -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ 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 -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Atom Replacement Problem
Well, Otis, I'm guessing you will have a full-fledged Jmol-based molecular editor for us soon. Is that right? This is fixed for Jmol 11.9.29. See http://chemapps.stolaf.edu/jmol/docs/examples-11/Jmol-11.zip Bob [PS: I'm not sure I would do the center selected there -- doesn't that result in an odd jump? I think it would be cooler to just let the model relax as you change the atoms.] On Thu, Feb 11, 2010 at 7:36 PM, Otis Rothenberger o...@chemagic.comwrote: Hello- I'm using the following JavaScript to replace univalent atoms is a Jmol model: evalRasmol(if ({atomIndex= + atomIndex + }.valence =1){{atomIndex= + atomIndex + }.element = ' + buildAtom + '; wireframe 0.15; spacefill 20%;minimize addHydrogens;boundbox {*};select *;center selected;}); With atomIndex = 1 and buildAtom = Cl, for example, the evalRasmol function is processing the following Jmol script: if ({atomIndex=1}.valence =1){{atomIndex=1}.element = Cl; wireframe 0.15; spacefill 20%;minimize addHydrogens;boundbox {*};select *;center selected;} This all works very nicely, including a new bond length, for one substitution. After that, the substitution is made, but the bond length remains unchanged. Again by way of example, methane changes smoothly to chloromethane. While the next substitution leads to methylene chloride, the methylene chloride has one normal C-Cl bond length and one C-Cl bond length equal to a C-H bond length. In summary, for a wide range of molecules, the above process works well once. After that, bond length for the added atom is not changed. The following variation of the above JavaScript leads to the same result: evalRasmol(if ({atomIndex= + atomIndex + }.valence =1){{atomIndex= + atomIndex + }.element = ' + buildAtom + '; wireframe 0.15; spacefill 20%;minimize addHydrogens;}); The following variation makes it clear that it is the spacefill command that adjusts the added atoms vdw, and it is the minimize command that adjusts the bond length. But only once evalRasmol(if ({atomIndex= + atomIndex + }.valence =1){{atomIndex= + atomIndex + }.element = ' + buildAtom + ';}); Does anyone have any suggestions that might allow subsequent substitutions to behave as the first? As a point of information the JavaScript is initiated by a click callback when the univalent atom is clicked. Otis -- Otis Rothenberger http://chemagic.org -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ 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 -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Atom Replacement Problem
valency accounts for bond order. So just about every carbon will be tetravalent, regardless of is position in a molecule -- acetylene, ethene, ethane all have {_C}.valence = 4. But if there are only three single bonds to a carbon, its valence will be reported as 3. By the way, Otis -- you will have more bugs to report. No one has done much with this, and I think you are going to find more places where Jmol doesn't do what you expect it to do. Just keep reporting these. Bob 2010/2/12 Angel Herráez angel.herr...@uah.es Sorry, Otis, I cannot help with your problem (but the feature looks exciting! One more step towards a Jmol editor, even if a simple one.) Your post prompts a question: is this valency property a shortcut meaning number of bonds? Bob? -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ 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 -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Atom Replacement Problem
Bob and Angel- Thanks for the help and the words of encouragement. My objective is to create the Jmol equivalent of an old Prentice Hall Model Kit, and a molecular builder (editor, I guess) is part of this objective. At present, I only know how to build molecules in Jmol using univalent atoms as a spring board via replacement. I have users start with methane, ethene, ethyne, or methanal. They can then click/change any univalent atom to C, H, O, X, or N. Your newly added minimize does the rest. I said it before, and I'll say it again: for folks interested in small molecules, this was a super addition to Jmol. I'd love to build C directly onto C (i.e. actually add a C, O, N etc.), but I'm not sure how to proceed. If you can point me on this, I'd appreciate it. The clean up at the end of my current routine is really not bad visually. I had to do it to keep the growing molecule in the window, especially when adding methyl groups: http://chemagic.com/web_molecules/script_page_large.aspx Other Points: 1) atomno's are duplicated during this building process (i.e. during the addHydrogens step). That's why I used atomIndex. 2) Holding addHydrogens until the end of several changes fixes the bond length issue. Unfortunately, it also eliminates the hydrogens as sequential handles for further chain growth. 3) Question: Is there a way to strip H's and then add them back in? Otis On Fri, Feb 12, 2010 at 6:30 AM, Robert Hanson hans...@stolaf.edu wrote: valency accounts for bond order. So just about every carbon will be tetravalent, regardless of is position in a molecule -- acetylene, ethene, ethane all have {_C}.valence = 4. But if there are only three single bonds to a carbon, its valence will be reported as 3. By the way, Otis -- you will have more bugs to report. No one has done much with this, and I think you are going to find more places where Jmol doesn't do what you expect it to do. Just keep reporting these. Bob 2010/2/12 Angel Herráez angel.herr...@uah.es Sorry, Otis, I cannot help with your problem (but the feature looks exciting! One more step towards a Jmol editor, even if a simple one.) Your post prompts a question: is this valency property a shortcut meaning number of bonds? Bob? -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ 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 -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users -- Otis Rothenberger http://chemagic.org -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Atom Replacement Problem
Otis wrote: If you are after a web application, I don't think there's an alternative, but do you know Avogadro? It's an app, lets you build 3D molecules in real time. The clean up at the end of my current routine is really not bad visually. I had to do it to keep the growing molecule in the window, especially when adding methyl groups: Maybe instead of center you can use a smoothed command like zoomTo that will do the same but along some interval. In fact, center may eb able to do the same, both commands share a lot lately. 3) Question: Is there a way to strip H's and then add them back in? There is a way to delete atoms, is there not? So you should be able to use that for all Hs. But I'm not sure, I don't delete atoms every day ;) Does not minimize just reposition the Hs? -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Atom Replacement Problem
It seems that minimize does not work after set picking deleteatom has been used -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Atom Replacement Problem
Bob and Angel- This is all coming together very nicely. I did not know about the delete atom command. Using delete hydrogen; minimize addHydrogens after each atom replacement allows a wide range of editing moves, including extending the click/change to non-univalent atoms. The changes that you made to minimize addHydrogens have also corrected the bond length problem. Thanks again for the help. Otis 2010/2/12 Angel Herráez angel.herr...@uah.es It seems that minimize does not work after set picking deleteatom has been used -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users -- Otis Rothenberger http://chemagic.org -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Atom Replacement Problem
Have a methyl radical precalculated as data. Merge it; translate/rotate it to align it. Add the bond. A good challenge. On Fri, Feb 12, 2010 at 1:06 PM, Otis Rothenberger o...@chemagic.comwrote: Bob and Angel- Thanks for the help and the words of encouragement. My objective is to create the Jmol equivalent of an old Prentice Hall Model Kit, and a molecular builder (editor, I guess) is part of this objective. At present, I only know how to build molecules in Jmol using univalent atoms as a spring board via replacement. I have users start with methane, ethene, ethyne, or methanal. They can then click/change any univalent atom to C, H, O, X, or N. Your newly added minimize does the rest. I said it before, and I'll say it again: for folks interested in small molecules, this was a super addition to Jmol. I'd love to build C directly onto C (i.e. actually add a C, O, N etc.), but I'm not sure how to proceed. If you can point me on this, I'd appreciate it. The clean up at the end of my current routine is really not bad visually. I had to do it to keep the growing molecule in the window, especially when adding methyl groups: http://chemagic.com/web_molecules/script_page_large.aspx Other Points: 1) atomno's are duplicated during this building process (i.e. during the addHydrogens step). That's why I used atomIndex. 2) Holding addHydrogens until the end of several changes fixes the bond length issue. Unfortunately, it also eliminates the hydrogens as sequential handles for further chain growth. 3) Question: Is there a way to strip H's and then add them back in? Otis On Fri, Feb 12, 2010 at 6:30 AM, Robert Hanson hans...@stolaf.edu wrote: valency accounts for bond order. So just about every carbon will be tetravalent, regardless of is position in a molecule -- acetylene, ethene, ethane all have {_C}.valence = 4. But if there are only three single bonds to a carbon, its valence will be reported as 3. By the way, Otis -- you will have more bugs to report. No one has done much with this, and I think you are going to find more places where Jmol doesn't do what you expect it to do. Just keep reporting these. Bob 2010/2/12 Angel Herráez angel.herr...@uah.es Sorry, Otis, I cannot help with your problem (but the feature looks exciting! One more step towards a Jmol editor, even if a simple one.) Your post prompts a question: is this valency property a shortcut meaning number of bonds? Bob? -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ 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 -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users -- Otis Rothenberger http://chemagic.org -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ 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 -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Atom Replacement Problem
hint: see http://chemapps.stolaf.edu/quaternions/jmol/helix.htm On Fri, Feb 12, 2010 at 9:25 PM, Robert Hanson hans...@stolaf.edu wrote: Have a methyl radical precalculated as data. Merge it; translate/rotate it to align it. Add the bond. A good challenge. On Fri, Feb 12, 2010 at 1:06 PM, Otis Rothenberger o...@chemagic.comwrote: Bob and Angel- Thanks for the help and the words of encouragement. My objective is to create the Jmol equivalent of an old Prentice Hall Model Kit, and a molecular builder (editor, I guess) is part of this objective. At present, I only know how to build molecules in Jmol using univalent atoms as a spring board via replacement. I have users start with methane, ethene, ethyne, or methanal. They can then click/change any univalent atom to C, H, O, X, or N. Your newly added minimize does the rest. I said it before, and I'll say it again: for folks interested in small molecules, this was a super addition to Jmol. I'd love to build C directly onto C (i.e. actually add a C, O, N etc.), but I'm not sure how to proceed. If you can point me on this, I'd appreciate it. The clean up at the end of my current routine is really not bad visually. I had to do it to keep the growing molecule in the window, especially when adding methyl groups: http://chemagic.com/web_molecules/script_page_large.aspx Other Points: 1) atomno's are duplicated during this building process (i.e. during the addHydrogens step). That's why I used atomIndex. 2) Holding addHydrogens until the end of several changes fixes the bond length issue. Unfortunately, it also eliminates the hydrogens as sequential handles for further chain growth. 3) Question: Is there a way to strip H's and then add them back in? Otis On Fri, Feb 12, 2010 at 6:30 AM, Robert Hanson hans...@stolaf.eduwrote: valency accounts for bond order. So just about every carbon will be tetravalent, regardless of is position in a molecule -- acetylene, ethene, ethane all have {_C}.valence = 4. But if there are only three single bonds to a carbon, its valence will be reported as 3. By the way, Otis -- you will have more bugs to report. No one has done much with this, and I think you are going to find more places where Jmol doesn't do what you expect it to do. Just keep reporting these. Bob 2010/2/12 Angel Herráez angel.herr...@uah.es Sorry, Otis, I cannot help with your problem (but the feature looks exciting! One more step towards a Jmol editor, even if a simple one.) Your post prompts a question: is this valency property a shortcut meaning number of bonds? Bob? -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ 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 -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users -- Otis Rothenberger http://chemagic.org -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ 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 -- 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 -- SOLARIS 10
Re: [Jmol-users] Atom Replacement Problem
I thought I fixed that. 2010/2/12 Angel Herráez angel.herr...@uah.es It seems that minimize does not work after set picking deleteatom has been used -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ 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 -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users