Hi Bob
Appreciate that turning binary into BASE64 is exactly what jsmol.php does
and that in most cases it works very nicely.
However, 'out-of-the-box' it is being blocked by the file APIs of the
particular PHP-based CMSs.
Was looking for a simple generic way to get around this.
Geoff
On 19 July 2013 13:49, <[email protected]> wrote:
> Send Jmol-users mailing list submissions to
> [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/jmol-users
> or, via email, send a message with subject or body 'help' to
> [email protected]
>
> You can reach the person managing the list at
> [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Jmol-users digest..."
>
>
> Today's Topics:
>
> 1. Re: Need help with protein residue protonation states and
> assign atom ({}) Pl/Mi command (JSmol) (Robert Hanson)
> 2. Re: Loading binary files (e.g. PyMOL Session .pse) into JSmol
> with Chrome and IE (Robert Hanson)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 19 Jul 2013 07:37:25 -0500
> From: Robert Hanson <[email protected]>
> Subject: Re: [Jmol-users] Need help with protein residue protonation
> states and assign atom ({}) Pl/Mi command (JSmol)
> To: "[email protected]"
> <[email protected]>
> Message-ID:
> <
> caf_yuvwdgrvjhmkbbeb1r755q8ykzw9a8xv-q54yazg9xke...@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> That should have read:
>
> I think the problem is that your formal charges are not being set up for
> proteins. If you do not have multiple bonds, then there is no way for Jmol
> to set the correct formal charges. If you use
>
> set pdbaddhydrogens
> load xxx.pdb
>
> then Jmol will assign multiple bonding correctly for all groups (including
> ligands) and then will properly place H atoms for roughly pH 7.
>
> [but, as I said, [O](C=O) will not have a 1- charge due to that bug]
>
> Bob
>
>
> On Fri, Jul 19, 2013 at 7:34 AM, Robert Hanson <[email protected]> wrote:
>
> > I think the problem is that your formal charges are not being set up for
> > proteins. If you do not have multiple bonds, then there is no way for
> Jmol
> > to set the correct formal charges. If you use
> >
> > set pdbaddhydrogens
> > load xxx.pdb
> >
> > I took a look at OpenBabel, converting 1blu with adding hydrogens at pH
> > 7.0. If you take a look there, it pretty well messed up LYS74. Whatever
> > OpenBabel is doing, it doesn't seem to have any real sense what it is
> > doing. There are carbon atoms that are connected to only 2 atoms, and
> there
> > are prolines that are sp2-hybridized. Also, I note that Jmol cannot read
> > the groups properly for those OpenBabel files anyway because each group's
> > atoms are not contiguous in the file.
> >
> > That said, there is a bug in Jmol's PDB add hydrogen method in that
> > carboxyl oxygens are not given a 1- formal charge. I've corrected the
> bug,
> > but you could do a work around by issuing
> >
> > {_O and connected(1, single)}.formalCharge = -1
> >
> > until I get that released.
> >
> >
> >
> > On Fri, Jul 19, 2013 at 3:51 AM, Robert Hanson <[email protected]>
> wrote:
> >
> >> Ah, I see. definitely odd. I'm sure the hydrogen addition to proteins
> >> needs some work -- this was not designed with proteins in mind. I can
> look
> >> into that. Please send [email protected] the pdb file that comes from
> >> OpenBabel.
> >>
> >>
> >> Have you tried
> >>
> >> set pdbAddHydrogens
> >> load xxx.pdb
> >>
> >> ? There's no pH dependence there -- all amines will be protonated and
> all
> >> carboxyls will be deprotonated. Histidine residues will get two protons.
> >>
> >> Bob
> >>
> >>
> >> On Thu, Jul 18, 2013 at 5:01 PM, Vinushka Schalk <
> [email protected]
> >> > wrote:
> >>
> >>> >> Hi,
> >>> >>
> >>> >> I'm a web developer who has been using JSmol since January for
> various
> >>> >> graphical functionality on a molecular simulations website
> >>> (visualizing
> >>> >> point-mutations, building custom ligand molecules, etc.) I am
> >>> currently
> >>> >> trying to develop a visualizer for changing protonation states in a
> >>> >> protein: JSmol loads a PDB-format file (with added hydrogens from
> >>> >> OpenBabel) and is displayed to the left of a series of selection
> >>> boxes with
> >>> >> various protonation states for the residues in the protein displayed
> >>> in the
> >>> >> JSmol window. Changing the selection in the selection box for a
> given
> >>> >> residue thus is supposed to change the protonation state of the
> >>> "important"
> >>> >> atom in that residue (NZ in a LYS/LSN, OE2 in a GLU/GLUP, etc.).
> >>> >>
> >>> >>
> >>> >
> >>> >
> >>> >> While selecting the atom with these criteria works fine, and the
> >>> assign
> >>> >> atom ({}) Pl/Mi command targets the correct atom, the protonation
> >>> states
> >>> >> are somewhat different than expected. If I start with an O(1-), as
> is
> >>> the
> >>> >> case for GLU, Pl adds two hydrogens, and doing Mi on that same atom
> >>> removes
> >>> >> both hydrogens.
> >>> >>
> >>> >>
> >>> >I'm missing what "PI" and "Mi" are.
> >>> "Pl" and "Mi" are Jmol's stand-ins for "increase charge on this atom"
> >>> and "decrease charge on this atom" (I believe it uses assumed valences
> for
> >>> this). It's documented in the "assign atom" command, at least in
> >>> CHANGES.TXT. It's also used in graphical (mouse-driven) set picking, as
> >>> seen for example here (clicking +1/-1 triggers the command set
> >>> picking_assignatom Pl/Mi):
> >>>
> >>> http://dgu.ki.ku.dk/molcalc/#
> >>>
> >>> The expected behavior would be to add or remove 1 hydrogen, but on a
> >>> protein it can add or remove two at a time.
> >>>
> >>>
> >>>
> >>>
> >>> >> Other strange behavior is that when deprotonating or protonating NZ,
> >>> the
> >>> >> atom name changes to "N299". I know this functionality works on
> basic
> >>> >> molecules, but why does it become problematic on proteins?
> >>> >>
> >>> >>
> >>> >Is this something in OpenBabel?
> >>>
> >>> No. The original PDB has the atom name "NZ", and after OpenBabel its
> >>> name remains "NZ". It is only after attempting to deprotonate it with
> the
> >>> Jmol command "assign atom ({selected}) Mi" that its name is changed to
> >>> N299. I don't really know why it happens.
> >>>
> >>>
> >>>
> >>>
> >>> >> Is there any way to change this behavior (particularly the
> >>> name-change)?
> >>> >> Would it be plausible to "create" a hydrogen atom and connect it to
> >>> this
> >>> >> atom? Or would that be even more problematic? I just want to be able
> >>> to
> >>> >> keep the name and make proper protonation states.
> >>> >>
> >>> >>
> >>> >It's somewhat problematic adding protons to proteins. Not certain Jmol
> >>> will
> >>> >handle that correctly.
> >>>
> >>> >> To be clear, I will not be using this for any calculations, this is
> a
> >>> >> graphical aid only, so any inaccuracies as a result are fine.
> >>> >>
> >>> >
> >>> >Check to see if the PDB file has "alternate location" flags set.
> Perhaps
> >>> >you can utilize those. (See PDB specs)
> >>>
> >>> As far as I know, it doesn't. The PDB files we get (which are from
> RCSB)
> >>> usually leave that field blank.
> >>>
> >>> However I will note that when OpenBabel is called to "create" hydrogens
> >>> on the molecule, the element symbol in fields 77-78 changes from,
> e.g., "N"
> >>> to "N1+", or "O" to "O1-" (the second ones violating PDB specs). I'm
> not
> >>> sure how important this would be.
> >>>
> >>>
> >>>
> >>>
> >>> >>
> >>> >>I am using the protein 4dfr (with hydrogens added with OpenBabel's
> >>> >> AddHydrogens() function from the python bindings, though the command
> >>> line
> >>> >> version should be the same), and using the following selections as
> >>> test
> >>> >> cases for protonation/deprotonation:
> >>> >>
> >>> >> 32.NZ and atomno < 1000 (LYS deprotonation into LSN)
> >>> >> 17.OE2 and atomno < 1000 (GLU protonation into GLUP)
> >>> >>
> >>> >>
> >>> >> -Vinushka Schalk
> >>> >>
> >>> >>
> >>> >>
> >>> >>
> >>> >> ------------------------------
> >>> >------------------------------------------------
> >>> >> See everything from the browser to the database with AppDynamics
> >>> >> Get end-to-end visibility with application monitoring from
> AppDynamics
> >>> >> Isolate bottlenecks and diagnose root cause in seconds.
> >>> >> Start your free trial of AppDynamics Pro today!
> >>> >>
> >>>
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> >>> >> _______________________________________________
> >>> >> Jmol-users mailing list
> >>> >> [email protected]
> >>> >> 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<
> 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
> >>> >-------------- next part --------------
> >>> >An HTML attachment was scrubbed...
> >>>
> >>>
> >>>
> ------------------------------------------------------------------------------
> >>>
> >>> See everything from the browser to the database with AppDynamics
> >>> Get end-to-end visibility with application monitoring from AppDynamics
> >>> Isolate bottlenecks and diagnose root cause in seconds.
> >>> Start your free trial of AppDynamics Pro today!
> >>>
> >>>
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> >>> _______________________________________________
> >>> Jmol-users mailing list
> >>> [email protected]
> >>> 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
> >>
> >>
> >
> >
> > --
> > 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
> >
> >
>
>
> --
> 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
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 2
> Date: Fri, 19 Jul 2013 07:48:50 -0500
> From: Robert Hanson <[email protected]>
> Subject: Re: [Jmol-users] Loading binary files (e.g. PyMOL Session
> .pse) into JSmol with Chrome and IE
> To: "[email protected]"
> <[email protected]>
> Message-ID:
> <CAF_YUvWtsentrtbTNueNLecJ=
> [email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Geoff,
>
> Provided you supply jsmol.php on your server and point to it using
> Info.serverURL, everything works smoothly. Turning the binary into BASE64
> is exactly what it does. Plus, it handles access to databases for MSIE.
>
> Bob
>
>
>
> On Fri, Jul 19, 2013 at 6:06 AM, Geoffrey Rowland
> <[email protected]>wrote:
>
> > Recently revisited this and realised the problem is the file access
> > control of the particular CMS (e.g. Moodle or Mahara). This blocks access
> > if the file loading is via jsmol.php (for binary files with IE or Chrome)
> > rather than directloading. Obviously, there is no issue when jsmol.php is
> > used with publicly accessible databases.
> >
> > Wondering if it is possible to more directly do the base64 conversion and
> > loading into JSmol e.g. using, say. PHP file_get_contents(), followed by
> > base64_encode(), then JSmol load inline "", or something similar.
> >
> > Any suggestions?
> >
> > Cheers
> >
> >
> >
> >
> >
> >
> > On 2 June 2013 22:16, Geoffrey Rowland <[email protected]> wrote:
> >
> >> Actually, I think I'm hitting browser (IE and Chrome) permission issues
> >> rather than problems with binary file handling per se.
> >>
> >> See e.g.
> >>
> http://wiki.jmol.org/index.php/Jmol_JavaScript_Object#Loading_the_library
> >>
> >> It's tricky to put files in locations which both meet the requirements
> of
> >> the CMS (Mahara), JSmol and most/all Browsers.
> >>
> >> Have managed to get things working on a local webserver:
> >> http://localhost... but not with (what I think is) much the same setup
> >> on a remote webserver: http://whatever...
> >>
> >> Do IE and Chrome have different permissions with http://localhost and
> >> remote webservers?
> >>
> >> I thought I had grasped the issues with local files and webserver hosted
> >> files, but this seems to be another layer of complexity.
> >>
> >> Cheers
> >>
> >> Geoff
> >>
> >>
> >> On 1 June 2013 12:02, Geoffrey Rowland <[email protected]> wrote:
> >>
> >>> Hi
> >>>
> >>> I have been tinkering with integrating JSmol with the open source
> >>> CMS/ePortfolio system Mahara. https://mahara.org
> >>>
> >>> It's working nicely for text data files (.pdb, .mol, .sdf, .xyz, .cif
> >>> etc) but I'm having problems with binary files, specifically PyMOL
> Session
> >>> files .pse with Chrome and Internet Explorer 10. Firefox, Opera and
> Safari
> >>> work fine.
> >>>
> >>> As I understand it, the problem is that Mahara stores files as a
> number,
> >>> without file extension. However, as JSmol does not usually require file
> >>> extensions to identify file types, they can still be successfully
> loaded
> >>> into JSmol with, for example:
> >>>
> >>> load "
> http://localhost/mahara/artefact/file/download.php?file=38&view=8
> >>> ";
> >>>
> >>> I can also get binary PyMOL session files to load and display with
> JSmol
> >>> in Firefox, Opera or Safari by appending, say, &ext=.pse to the load
> >>> command, i.e. 'fooling' these browsers that the filename includes .pse
> (see
> >>>
> http://wiki.jmol.org/index.php/Jmol_JavaScript_Object#Reading_binary_files
> >>> )
> >>>
> >>> However, this does not work for Chrome or Internet Explorer 10. Chrome
> >>> just crashes, though with Firebug reports:
> >>>
> >>> Error reading file at end of file
> >>> Type Error:Object [object Object] has no method 'addAll'
> >>> for file
> >>>
> http://localhost/mahara/artefact/file/download.php?file=38&view=8&ext=.pse
> >>> type PyMOL
> >>>
> >>> Have tried a few other things, such as prepending the load with PSE::
> to
> >>> try to force binary handling, but without success.
> >>>
> >>> I think I am using jsmol.php correctly. All browsers works fine for the
> >>> dna.pse exemplar at http://chemapps.stolaf.edu/jmol/jsmol/test2.htm,
> >>> /test3.htm, /jsmol.htm etc either at stolaf.edu or copied to my
> >>> localhost. So, I presume it just needs some way of forcing Chrome and
> IE to
> >>> recognise the PSE files as binary, when held in Mahara.
> >>>
> >>> Any suggestions? Have I overlooked something simple?
> >>>
> >>> Cheers
> >>>
> >>> Geoff
> >>>
> >>>
> >>>
> >>> <
> http://wiki.jmol.org/index.php/Jmol_JavaScript_Object#Reading_binary_files
> >
> >>>
> >>
> >>
> >
> >
> >
> ------------------------------------------------------------------------------
> > See everything from the browser to the database with AppDynamics
> > Get end-to-end visibility with application monitoring from AppDynamics
> > Isolate bottlenecks and diagnose root cause in seconds.
> > Start your free trial of AppDynamics Pro today!
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Jmol-users mailing list
> > [email protected]
> > 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
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
>
> ------------------------------
>
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
> End of Jmol-users Digest, Vol 86, Issue 9
> *****************************************
>
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users