I guess I had not noticed that, Otis -- getProperty("moleculeInfo.mf") does
a hybridization check and adds hydrogens as needed. This is useful for
proteins, for example. I'm not convinced it is a bug.

I suggest instead using in Jmol:

x = []
n = {*}[0].molecule;
for (var i = 1; i <= n; i++){
x .push({molecule=i}.find("MF"))
}

Bob

On Sun, Jun 26, 2016 at 7:36 PM, Otis Rothenberger <osrot...@icloud.com>
wrote:

> Bob,
>
> This is kind of esoteric, and I don’t know exactly when it broke. I was OK
> in 4.4.4_2015_03_25. It’s broken in the latest JSmol version. The JS below
> uses a simple regular expression to convert a Jmol mf into a standard
> arithmetic expression:
>
>         var strMods =
> Jmol.getPropertyAsJavaObject(jmolApplet0,"moleculeInfo.mf"); var mf;
>         for (var i = 0; i < strMods.size(); i++) {
>                 mf = strMods.get(i).replace(/([a-z])\s([0-9])/ig,
> '$1\*$2').replace(/([0-9])\s([a-z])/ig, '$1\+$2');
>                 alert(mf);
>                 echoStr2 += "" + roundnum(eval(mf), 4) + " | ";
>         }
>
> Using 2-butanone as an example, when I break the C2-C3 bond
> 4.4.4_2015_03_25 correctly reports the following at the alert:
>
> H*3+C*2+O*1 and H*5+C*2
>
> Note that the JS code reads the atomic symbols as actual masses. The
> current version of JSmol reports:
>
> H*4+C*2+O*1 and H*6+C*2
>
> In other words hydrogen atoms for the 2 separate fragments are being
> “corrected," but the 2 extra H's are not visible. Further, the script
> select *;display selected shows 13 atoms selected (and visible) in both
> 4.4.4_2015_03_25 and the current version.
>
> This all relates to mass spec study in the model kit. The bond is being
> broken by set picking assignBond_0.
>
> Otis
>
> --
> Otis Rothenberger
> o...@chemagic.org
> http://chemagic.org
>
>
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>



-- 
Robert M. Hanson
Larson-Anderson 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
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to