Re: [Jmol-users] Molecular Formula Problem Related to Breaking a Bond

2016-06-27 Thread Otis Rothenberger
Bob,

My model kit puts multiple models in the same Jmol frame. It appears that n = 
{*}.molecule[0] (not n = {*}[0].molecule) is the correct expression, but 
results are very erratic. The value of n is often (but not always) 2X the 
number of fragments, with the extra “mf” values = “”.

With a larger number of fragments, n is usually low, and identical fragments 
are only represented once. Through all of this, 
Jmol.getPropertyAsJavaObject(jmolApplet0, 
"moleculeInfo.mf").modCount.toString() gives the proper number of model 
fragments, but Jmol.getPropertyAsJavaObject(jmolApplet0, 
"moleculeInfo.mf").toString() gives “saturated” mf values.

I need to sleep on it. Maybe I can pick the correct formulas out with the value 
of n from Jmol.getPropertyAsJavaObject(jmolApplet0, 
"moleculeInfo.mf").modCount.toString() using x = {molecule=#}.find("MF”);

Otis

--
Otis Rothenberger
o...@chemagic.org
http://chemagic.org

> On Jun 27, 2016, at 6:04 PM, Robert Hanson  wrote:
> 
> x = []
> n = {*}[0].molecule;
> for (var i = 1; i <= n; i++){ 
> x .push({molecule=i}.find("MF"))
> }

--
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


Re: [Jmol-users] Export x3d problem.

2016-06-27 Thread Robert Hanson
I knew you were going to say that
​
--
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


Re: [Jmol-users] Export x3d problem.

2016-06-27 Thread Angel Herráez
> OK, this observation makes perfect sense. It turns out that when you use 
> cartoonsFancy (or 
> "cartoonFancy"; they both work, because I got so tired of not remembering 
> which it was...) a 
> variable doesn't get reset after the file is created (which is written OK, 
> right?) and then the screen 
> rendering dies after that at the point where it is drawing the fancy 
> cartoons. Jmol still works; it just 
> doesn't display anything after that point.

Well, that's what I was observing when the file was successfully exported.
But in some of those cases (in my hands and also in Chris reported 
problems) the x3d file is not correctly saved (it's very small with no useful 
data) or there is a network error and the file does not get saved at all.



--
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


Re: [Jmol-users] Jmol 14.6.0_2016.06..22 Saved State

2016-06-27 Thread Robert Hanson
On Sun, Jun 26, 2016 at 11:40 AM, Jaime Prilusky <
jaime.prilu...@weizmann.ac.il> wrote:

> Differences found on saved state from Jmol version 14.6.0_2016.06.22
>
> *SelectionHalos OFF;* is not longer present in _setSelectionState() .  Will
> this come back on a next release?
>
>
No, I don't think so. The script runs

initialize

which does that. There is no need to explicitly set that OFF. Only
SelectionHalos ON is in the state script.



> There’s a new *set cartoonsfancy false;*  (notice the plural) in addition
> to the previous *set cartoonfancy false;*.
>
>
synonymous, like "cartoon" and "cartoons"



> *set selectallmodels true;* is not longer present in _setParameterState()
> . Will this come back on a next release?
>
>
Probably not. There are many settings that are not reproduced in the state.
Certainly selectAllModels is an interesting thing to set and has its
purpose, but in my opinion it is not something of the state of the model.
Here is the list of settings that are not reproduced in the state, or at
least are given some sort of special attention:

   (";ambientpercent;animationfps"
  +
";antialiasdisplay;antialiasimages;antialiastranslucent;appendnew;axescolor"
  +
";axesposition;axesmolecular;axesorientationrasmol;axesunitcell;axeswindow;axis1color;axis2color"
  +
";axis3color;backgroundcolor;backgroundmodel;bondsymmetryatoms;boundboxcolor;cameradepth"
  +
";bondingversion;contextdepthmax;debug;debugscript;defaultlatttice;defaults;defaultdropscript;diffusepercent;"
  + ";exportdrivers;exportscale"
  +
";_filecaching;_filecache;fontcaching;fontscaling;forcefield;language"
  + ";legacyautobonding;legacyhaddition;legacyjavafloat"
  + ";loglevel;logfile;loggestures;logcommands;measurestylechime"
  +
";loadformat;loadligandformat;smilesurlformat;pubchemformat;nihresolverformat;edsurlformat;edsurlcutoff;multiprocessor;navigationmode;"
  +
";pathforallfiles;perspectivedepth;phongexponent;perspectivemodel;platformspeed"
  +
";preservestate;refreshing;repaintwaitms;rotationradius;selectallmodels"
  +
";showaxes;showaxis1;showaxis2;showaxis3;showboundbox;showfrank;showtiming;showunitcell"
  +
";slabenabled;slab;slabrange;depth;zshade;zshadepower;specular;specularexponent;specularpercent"
  + ";celshading;celshadingpower;specularpower;stateversion"
  + ";statusreporting;stereo;stereostate;vibrationperiod"
  +
";unitcellcolor;visualrange;windowcentered;zerobasedxyzrasmol;zoomenabled;mousedragfactor;mousewheelfactor"
  //saved in the hash table but not considered part of the state:
  + ";scriptqueue;scriptreportinglevel;syncscript;syncmouse;syncstereo"
  + ";defaultdirectory;currentlocalpath;defaultdirectorylocal"
  //more settable Jmol variables
  +
";ambient;bonds;colorrasmol;diffuse;fractionalrelative;frank;hetero;hidenotselected"
  +
";hoverlabel;hydrogen;languagetranslation;measurementunits;navigationdepth;navigationslab"
  +
";picking;pickingstyle;propertycolorschemeoverload;radius;rgbblue;rgbgreen;rgbred"
  +
";scaleangstromsperinch;selectionhalos;showscript;showselections;solvent;strandcount"
  + ";spinx;spiny;spinz;spinfps;navx;navy;navz;navfps;"
  + ";undo;atompicking;drawpicking;bondpicking;pickspinrate;picklabel"
  +
";modelkitmode;allowgestures;allowkeystrokes;allowmultitouch;allowmodelkit"
  //  oops these were in some state scripts but should not have been
  +
";dodrop;hovered;historylevel;imagestate;iskiosk;useminimizationthread"
  +
";showkeystrokes;saveproteinstructurestate;testflag1;testflag2;testflag3;testflag4"
--
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


Re: [Jmol-users] Molecular Formula Problem Related to Breaking a Bond

2016-06-27 Thread Robert Hanson
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 
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


Re: [Jmol-users] Export x3d problem.

2016-06-27 Thread Robert Hanson
OK, this observation makes perfect sense. It turns out that when you use
cartoonsFancy (or "cartoonFancy"; they both work, because I got so tired of
not remembering which it was...) a variable doesn't get reset after the
file is created (which is written OK, right?) and then the screen rendering
dies after that at the point where it is drawing the fancy cartoons. Jmol
still works; it just doesn't display anything after that point.

Anyway, that's fixed. Will upload sometime tonight.

​Bob
--
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


Re: [Jmol-users] Export x3d problem.

2016-06-27 Thread Chris St Pourcain
Thanks for confirming that Angel,

I've found several other molecules that don't seem to export properly with
JSmol 14.3.12_2015.01.28  or Bob's demo page: 4ESV, 3UX4, 1JZ8,2D1S, 1GFL.
All of them give the 'Download Failed - Network' error.

What is really odd is that I have been able to get proper x3d files from
 2D1S, 1GFL with JSmol 14.3.12_2015.01.28 using the javascript command :
Jmol.evaluateVar(jmolApplet4857_0,'write("X3D")'); but this doesn't seem to
work for 4ESV, 3UX4, 1JZ8, 3UX4


Chris



On 27 June 2016 at 10:02, Chris St Pourcain <
chrisstpourc...@indigomolecularimages.com> wrote:

> Angel,
>
> Thanks again for looking at this. I thought I'd add to the mystery!
>
> I've discovered that if I load 1HHO and then do  file->export->Export X3D
> 3D model from the menu this works fine for JSmol 14.3.12_2015.01.28 (Jim
> Hu's Wordpress plugin https://wordpress.org/plugins/jsmol2wp/) and for
> Bob's demo page(http://chemapps.stolaf.edu/jmol/jsmol/jsmol.htm).
>
> But if I repeat the process using 1EQZ instead I get 'Download Failed -
> Network' error. I'm using the Chrome browser and Windows 10.
>
> This isn't anything to do with cartoonfancy as all I did was import the
> molecule and then immediately try and export it.
>
> Cheers
>
> Chris
>
>
>
> On 26 June 2016 at 11:36, Angel Herráez  wrote:
>
>> Hi Chris
>>
>> All the ways you mention should be equivalent, since in the end they run
>> the
>> same command.
>> From your description, this is a bug in the newer version(s) of Jmol. For
>> whatever reason it seems to appear only for certain models.
>>
>> I cannot help with that, but Bob will surely track it down.
>>
>> In several tests I also obtained empty results but by random combinations
>> I've had success a couple of times in producing x3d from this model.
>> Curiously, on these successful occasions, after export the displayed model
>> just shows one chain (that in reddish color, ie chain H) This might be
>> related
>> to the bug.
>> Jmol application 14.6.0_2016.05.17
>>
>> Also, note that while I did not apply cartoonfancy, the x3d product looks
>> similar so maybe that setting is not needed for x3d export.
>> Please see attached* state and x3d. The commands in this case were
>>
>> initialize
>> load =1EQZ
>> delete not protein
>> cartoon only
>> color chain
>>
>> then exported from popup menu
>>
>>
>> (*) too big to attach here. You can get it from
>> https://drive.google.com/open?id=0B-Kpcv-31q6gLU5JSVhfV05IMTg
>>
>>
>
>
--
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


Re: [Jmol-users] Jmol audio (applet and Application; Java and JavaScript)

2016-06-27 Thread Robert Hanson
right - that should be http://chemapps.stolaf.edu/jmol/zip


Also, two years ago Ron asked:

*[Jmol-users] Audio?
*
[Hide message from public view]
 From: Ron
Mignery  - 2014-01-22 18:27:13
*Attachments:* Message as HTML



Could a play  command similar to the Java play function be
added to scripting?  This would allow clicks and beeps or even entire
narrations to be added to Jmol animations.  Hopefully it would run in a
separate thread.


And the answer now is, absolutely. Included in the distribution library is

Jmol._playAudio(filename)

which does exactly that and is directly called by

load AUDIO filename

HTML5 makes this extremely easy. All that function  does is this:

  Jmol._playAudio = function(filePath) {
var audio = document.createElement("audio");
audio.controls = "true";
audio.src = filePath;
audio.play();
  }

So, for example, from a page having this (
http://chemapps.stolaf.edu/jmol/jsmol1/jsmol.htm sloly uploading at
this moment) you could issue this:


Jmol._playAudio("http://www.stolaf.edu/people/hansonr/nmrtalk/ch2cl2/fid.wav
")

or of course just create your own little function like that.

And someone will show us how that can be done in one simple command with
jQuery, I am sure.

Bob
--
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


Re: [Jmol-users] Export x3d problem.

2016-06-27 Thread Robert Hanson
so noted.

On Mon, Jun 27, 2016 at 4:34 AM, Angel Herráez  wrote:

> Hi Chris
>
> I can confirm the error.
> http://chemapps.stolaf.edu/jmol/jsmol/jsmol.htm
> (JSmol 14.6.0)
> load 1hho from RCSB
> popup > File > Export X3D
>
> in Chrome, Win10: two dialogs for file save, and finally an undentified
> network error (maybe a timeout?)
>
> in Firefox, Win10: two dialogs, successful download and the file works. But
> after that, JSmol displays only one protein chain and the two themes (so
> similar to what I saw the other day in the application)
>
> Something strange is going on in 14.6
>
>
>
>
>
> --
> 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


Re: [Jmol-users] Jmol audio (applet and Application; Java and JavaScript)

2016-06-27 Thread Philip Bays
Bob: You have a  typo in your link.


> On Jun 27, 2016, at 1:51 AM, Robert Hanson  wrote:
> 
> Isn't HTML5 is great??
> 
> Jmol.___JmolVersion="14.7.0_2016.06.27"
> 
> new feature: load AUDIO audiofilename
>  -- Java and JavaScript applet can read WAV, MP3, and OGG files
>  -- application can read WAV files only
>  
> See http://chemapp.stolaf.edu/jmol/zip/jmol-14.7.0_2016.06.27.zip 
> 
> 
> (uploading now)
> 
> 
> 
> 
> 
> -- 
> 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

Philip Bays
Emeritus Professor of Chemistry
Saint Mary's College
Notre Dame, IN 46556
pb...@saintmarys.edu


--
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


Re: [Jmol-users] Export x3d problem.

2016-06-27 Thread Angel Herráez
Hi Chris

I can confirm the error.
http://chemapps.stolaf.edu/jmol/jsmol/jsmol.htm
(JSmol 14.6.0)
load 1hho from RCSB
popup > File > Export X3D

in Chrome, Win10: two dialogs for file save, and finally an undentified 
network error (maybe a timeout?)

in Firefox, Win10: two dialogs, successful download and the file works. But 
after that, JSmol displays only one protein chain and the two themes (so 
similar to what I saw the other day in the application)

Something strange is going on in 14.6




--
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


Re: [Jmol-users] Export x3d problem.

2016-06-27 Thread Chris St Pourcain
Angel,

Thanks again for looking at this. I thought I'd add to the mystery!

I've discovered that if I load 1HHO and then do  file->export->Export X3D
3D model from the menu this works fine for JSmol 14.3.12_2015.01.28 (Jim
Hu's Wordpress plugin https://wordpress.org/plugins/jsmol2wp/) and for
Bob's demo page(http://chemapps.stolaf.edu/jmol/jsmol/jsmol.htm).

But if I repeat the process using 1EQZ instead I get 'Download Failed -
Network' error. I'm using the Chrome browser and Windows 10.

This isn't anything to do with cartoonfancy as all I did was import the
molecule and then immediately try and export it.

Cheers

Chris



On 26 June 2016 at 11:36, Angel Herráez  wrote:

> Hi Chris
>
> All the ways you mention should be equivalent, since in the end they run
> the
> same command.
> From your description, this is a bug in the newer version(s) of Jmol. For
> whatever reason it seems to appear only for certain models.
>
> I cannot help with that, but Bob will surely track it down.
>
> In several tests I also obtained empty results but by random combinations
> I've had success a couple of times in producing x3d from this model.
> Curiously, on these successful occasions, after export the displayed model
> just shows one chain (that in reddish color, ie chain H) This might be
> related
> to the bug.
> Jmol application 14.6.0_2016.05.17
>
> Also, note that while I did not apply cartoonfancy, the x3d product looks
> similar so maybe that setting is not needed for x3d export.
> Please see attached* state and x3d. The commands in this case were
>
> initialize
> load =1EQZ
> delete not protein
> cartoon only
> color chain
>
> then exported from popup menu
>
>
> (*) too big to attach here. You can get it from
> https://drive.google.com/open?id=0B-Kpcv-31q6gLU5JSVhfV05IMTg
>
>
--
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