Re: [Jmol-users] Jmol -- testing requested

2015-08-22 Thread Eric Martz
Dear Bob,

I have tested the Aug 21 Jmol in FirstGlance and the only issue I 
spotted was the one about fragmentary residues (already reported in a 
separate email).

So it passed with flying colors! Bravo!!!

Eric

--
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Fragmentary residues

2015-08-22 Thread Eric Martz
This issue is a recent change. These fragmentary residues were properly 
categorized in Jmol 14.3.7_2014.09.20.

On 8/22/15 3:11 PM, Eric Martz wrote:
 In the PDB format, every atom should be a member of one of these 3
 categories: protein, nucleic, hetero.

 FirstGlance in Jmol has long highlighted any 'anomalous atoms' that do
 not belong to any of the above 3 categories.

 It appears to me that Jmol (for a long time, including the latest Aug 17
 version) is not properly categorizing certain atoms. They show up as
 'anomalous' in FirstGlance (marked with dots and a ? by default).

 In each case, these are fragments of residues (some main chain atoms are
 missing). Is this a bug or a feature?

 Examples:

 1flo DC17:H (phosphate only)

 4gqj DG6:B

 4s0n DT5:E

 1h8s GLY112:B, ARG111:A, ALA243:B, ALA243:A (N only)

 3eqc ALA220:A, CYS277:A, ASN382:A (N and CA only)

 In the last case, for example, this leads to the bizarre result
 select ASN and not protein
 2 atoms selected

 If this is a feature, I can work around it by re-defining 'protein' as
 the 20 standard L amino acids plus the 20 D amino acids, and 'nucleic'
 as the standard nucleotides. That will still miss fragments of
 non-standard residues, but those will be less common.

 Thanks, Eric

 --
 ___
 Jmol-users mailing list
 Jmol-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-users



--
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Dissect PNGJ content?

2015-08-22 Thread Kubasik, Matthew A.
Thanks, Rolf.

I should start a new thread. There are two additional split functions at 
http://chemapps.stolaf.edu/jmol/docs/index.htm?ver=14.2 , as compared to the 
split function in your link, and these two contain the “true” parameter.  
However, the documentation is kind of spare about the need and use for “true” 
in these additional split functions.

I’ll play around with it and start a new thread when I get stuck.

Matt

On Aug 22, 2015, at 1:42 PM, Rolf Huehne 
rhue...@fli-leibniz.demailto:rhue...@fli-leibniz.de wrote:

Am 22.08.15 um 17:23 schrieb Kubasik, Matthew A.:
Thanks, Bob, for this.

Can you clarify the purpose of  “true”, as in:

var x = load(“filename”, TRUE)

I would like to learn when is it necessary.  Your example uses “true” for .png 
but not for .cif.   The help page shows the TRUE flag showing up elsewhere, as 
in the function
x = y.split(, TRUE)

I am uncertain of how to use “true properly.

The meaning of true as a parameter depends on the specific
command/function. You should look up the documentation for the
commands/functions you want to use.

http://jena3d.fli-leibniz.de/doc/jmol_scripting/index.htm#functions
contains for 'x = load(filename,TRUE)':

Adding a second parameter TRUE creates a binary associative array
variable x that contains the contents of the file. Data are stored as
raw bytes (but will appear as a string in the PRINT command). If the
file is a standard file, the key _DATA_ will hold the file data. If
the file is a PNGJ file, the key _IMAGE_ will hold the image data and
additional files will be keyed by file name. If the file is a zip file,
the files will be keyed by file name, but no _IMAGE_ key will be
present (presumably). Note that x = load(myfile) without TRUE loads
just the file list for PNGJ or ZIP files, not the actual data.

Regards,
Rolf

--
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

--
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


[Jmol-users] Fragmentary residues

2015-08-22 Thread Eric Martz
In the PDB format, every atom should be a member of one of these 3 
categories: protein, nucleic, hetero.

FirstGlance in Jmol has long highlighted any 'anomalous atoms' that do 
not belong to any of the above 3 categories.

It appears to me that Jmol (for a long time, including the latest Aug 17 
version) is not properly categorizing certain atoms. They show up as 
'anomalous' in FirstGlance (marked with dots and a ? by default).

In each case, these are fragments of residues (some main chain atoms are 
missing). Is this a bug or a feature?

Examples:

1flo DC17:H (phosphate only)

4gqj DG6:B

4s0n DT5:E

1h8s GLY112:B, ARG111:A, ALA243:B, ALA243:A (N only)

3eqc ALA220:A, CYS277:A, ASN382:A (N and CA only)

In the last case, for example, this leads to the bizarre result
   select ASN and not protein
   2 atoms selected

If this is a feature, I can work around it by re-defining 'protein' as 
the 20 standard L amino acids plus the 20 D amino acids, and 'nucleic' 
as the standard nucleotides. That will still miss fragments of 
non-standard residues, but those will be less common.

Thanks, Eric

--
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


[Jmol-users] Mouse gestures fail in OS X Firefox Java

2015-08-22 Thread Eric Martz

Hello all,

This is probably just For Your Information (not asking for any fixes 
from Bob).


The problems I'm reporting here appear to be specific to the Java applet 
in OS X Firefox only. These problems are not seen in JSmol/HTML5 in OS 
X, *not in Windows 7* nor (except for wheel binding) in OS X Safari or 
Chrome.


I am testing 14.3.16_2015.*08.21* at
http://chemapps.stolaf.edu/jmol/jsmol/jsmol.htm?_USE=SIGNED

1. Some default mouse bindings (see 'bind' in the docs) appear to be 
gone in the Java Applet only. For example, these work in HTML5 but not 
in the Java applet:


SHIFT+LEFT+drag _rotateZorZoom (fails in Firefox 40.0.2, works in 
Safari, Chrome)

   WHEEL _wheelZoom (fails in Firefox, Safari, Chrome)

Some bindings still work in Firefox:
   LEFT+drag _slideZoom (right edge of window)
   LEFT+click _pickAtom
   LEFT +double +click _setMeasure

2. The following bind command works in HTML5 but not in the Java applet:

slab on
slab 55
depth 45
bind ALT+SHIFT+LEFT+drag _slabAndDepth (fails in Firefox 40.0.2; works 
in Safari, Chrome)


-Eric
--
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Dissect PNGJ content?

2015-08-22 Thread Rolf Huehne
Am 22.08.15 um 17:23 schrieb Kubasik, Matthew A.:
 Thanks, Bob, for this.

 Can you clarify the purpose of  “true”, as in:

 var x = load(“filename”, TRUE)

 I would like to learn when is it necessary.  Your example uses “true” for 
 .png but not for .cif.   The help page shows the TRUE flag showing up 
 elsewhere, as in the function
 x = y.split(, TRUE)

 I am uncertain of how to use “true properly.

The meaning of true as a parameter depends on the specific 
command/function. You should look up the documentation for the 
commands/functions you want to use.

http://jena3d.fli-leibniz.de/doc/jmol_scripting/index.htm#functions
contains for 'x = load(filename,TRUE)':

Adding a second parameter TRUE creates a binary associative array 
variable x that contains the contents of the file. Data are stored as 
raw bytes (but will appear as a string in the PRINT command). If the 
file is a standard file, the key _DATA_ will hold the file data. If 
the file is a PNGJ file, the key _IMAGE_ will hold the image data and 
additional files will be keyed by file name. If the file is a zip file, 
the files will be keyed by file name, but no _IMAGE_ key will be 
present (presumably). Note that x = load(myfile) without TRUE loads 
just the file list for PNGJ or ZIP files, not the actual data.

Regards,
Rolf

--
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Dissect PNGJ content?

2015-08-22 Thread Kubasik, Matthew A.
Thanks, Bob, for this.

Can you clarify the purpose of  “true”, as in:

var x = load(“filename”, TRUE)

I would like to learn when is it necessary.  Your example uses “true” for .png 
but not for .cif.   The help page shows the TRUE flag showing up elsewhere, as 
in the function
x = y.split(, TRUE)

I am uncertain of how to use “true properly.

Matt

On Aug 22, 2015, at 12:51 AM, Robert Hanson 
hans...@stolaf.edumailto:hans...@stolaf.edu wrote:

http://sourceforge.net/projects/jmol/files/Jmol-beta/Jmol%2014.3/Jmol%2014.3.16/Jmol-14.3.16_2015.08.21-binary.zip/download

Jmol.___JmolVersion=14.3.16_2015.08.21

new feature: load var x
  -- same as load @x
  -- similar in syntax to write var x t.png
  -- example:

  var x = load(quartz.cif)
  load var x {1 1 1}

bug fix: creating and running and saving binary hash from PNGJ fails
  -- allows creating an associative binary array from a PNGJ file
 then modifying it and loading that variable
 then saving it as a new PNGJ file
  -- initial PNGJ file is not necessary if binary array x is created first
  -- example:

  var x = load(test.png,true)
  load @x
  write test2.png as PNGJ

bug fix: hover callback is not supposed to be stopped with HOVER OFF
bug fix: atom.sx and atom.syhttp://atom.sy/ and atom.szhttp://atom.sz/ 
report incorrectly when antialiasing is on
bug fix: write VAR x test.png creates a ZIP file instead of a PNGJ file when 
x is from load(test.png,true)
bug fix: write test.png as PNGJ (without initial quotes) fails


​comments:

OK, that wasn't so bad. Thank you, Rolf, for suggesting this. It is a nice 
complement to write var x.

This completes the capability for Jmol or JSmol to read, modify,  load, and 
save PNGJ and ZIP files.

1) Reading a PNGJ or ZIP file into a variable using TRUE to indicate binary 
file:

x = load(test.png, TRUE)
# [x is a binary associative array]
print x.keys
$_BINARY_$
JmolManifest.txt
Jmol_version_14.3.16_2015.08.21__2015-08-21_09.06
_IMAGE_
http___cactus.nci.nih.gov_chemical_structure_caffeine_file_format_sdf_get3d_True
state.spt

where $_BINARY_$ indicates that entries are byte arrays.
and _IMAGE_ is the PNG image, indicating this is from a PNGJ file

2) modifying that file if desired

# coerce to string:
s =  + x[state.spt]
# ...modify here...
# replace state.spt in PNGJ file data
x[state.spt] = s

# Or, for example, adding an image that will be used for an optional background 
image

x = load(test.png,true)
# a standard binary associative array will have just two keys, $BINARY$ and 
_DATA_
# only PNGJ has _IMAGE_

x[z.jpg] = load(z.jpg,true)._DATA_
print x.keys
write var x test3.png
sometime later...
load test3.png
background image test3.png|z.jpg


3) write to a new PNGJ file

write var x test2.png

4) optionally, load that PNGJ data directly from the variable, perhaps to see 
that the modifications are correct:

load var x

(new syntax; same as older load @x)

Note that both of these syntaxes work with standard string file data and can be 
extended with options:

x = load(quartz.cif)
load var x {1 1 1}

Bob



--
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.netmailto:Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

--
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Hover label - change style (other than font, color and background) and its position

2015-08-22 Thread trematodeo
Thanks Robert I will try it.


best regards
Fausto

On 21 August 2015 at 09:29, Robert Hanson hans...@stolaf.edu wrote:

 that's it. Could take some ingenuity, but it seems possible to me. Here is
 a way to get the coordinate displayed on the document tab of the browser.

 Jmol.script(jmolApplet0,set hoverCallback 'myHover';*hover off*)
 myHover = function(appletID,label,index){
   var app = Jmol._applets[appletID];
   var atom = app._applet.viewer.ms.at[index];
   var isAntialiased = app._applet.viewer.antialiased;
   var sx = atom.sX * (isAntialiased ? 0.5 : 1);
   var sy = atom.sY * (isAntialiased ? 0.5 : 1);
   var offset = $(app._canvas).offset();
   offset.top = Math.floor(offset.top + sy);
   offset.left = Math.floor(offset.left + sx);
   document.title = JSON.stringify(offset)
 }

 Notice that we are tapping into JSmol in a way that is not possible in
 Java -- going straight into the variables. This is faster, but I don't
 generally recommend this.

 There is a bug in Jmol right now that when you turn  hover off, it does
 turn off the callback. That is not supposed to happen. I found the bug, but
 it is not available yet, so in the mean time just don't include hover off
 for now, or, if you want to go into jsmol/core/corejmol.z.js, you can change

 a(!this.hoverEnabled

 to

 a(!this.hoverEnabled  !this.sm.haveHoverCallback()

 yourself.


 On Thu, Aug 20, 2015 at 5:08 PM, tremato...@gmail.com wrote:

 Hi Robert,

 Now I understood your suggestion! Disable at jsmol and do it myself using
 the data from the hovercallback method. Sorry, I was confused.

 best regards
 Fausto

 On 20 August 2015 at 15:53, Robert Hanson hans...@stolaf.edu wrote:

 You will have to turn off the canvas hover that Jmol uses and instead
 use your own, totally outside of Jmol.

 On Thu, Aug 20, 2015 at 12:43 PM, tremato...@gmail.com wrote:


 I'm trying to get there - where the label is - but as it is inside the
 canvas element it's hard to inspect. There is a way with chrome experiments
 but I can't put to work here. Anyway I will keep trying.

 Thanks!
 Fausto

 On 17 August 2015 at 22:34, Robert Hanson hans...@stolaf.edu wrote:

 In order to do that you will need to learn some CSS and JavaScript.
 The best way to do this is probably with jQuery. But I do not know exactly
 how to do that.

 On Mon, Aug 17, 2015 at 10:10 AM, tremato...@gmail.com wrote:

 Hello Robert,

 Thanks for your explanation, I have been thinking about it but I
 still didn't realize how to do it. Could you tell me what kind of return
 this callback needs to give to change the hover label position and style?

 Have a great day!
 Fausto



 On 17 August 2015 at 00:59, amitesh sharma siprusha...@gmail.com
 wrote:

 please describe me how I use in html.

 Amitesh kumar sharma
 Noida Uttar Pradesh

 On Sat, Aug 15, 2015 at 11:56 PM, Robert Hanson hans...@stolaf.edu
 wrote:

 sorry --

 ​... using jmolApplet0._applet.viewer.ms.at[iatom].sX and ...sY




 --

 ___
 Jmol-users mailing list
 Jmol-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-users




 --

 ___
 Jmol-users mailing list
 Jmol-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-users




 --

 ___
 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
 Chair, Department 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



 --

 ___
 Jmol-users mailing list
 Jmol-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-users




 --

 ___
 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
 Chair, Department 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



 --

 ___
 Jmol-users