Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-22 Thread Ian Thomas
Hi Bob, That's excellent - thanks very much for looking into it. I'll give the '\?' a go soon. When will this be included in a publicly available build, and which build(s) will it go into? Thanks again, Ian Robert Hanson wrote: OK, the \? is in and has been tested with CIF files. Jmol

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-22 Thread Ian Thomas
Hi Bob, Thanks for your message. 1) DO NOT poll the applet with a setTimeout(). This will occasionally crash the applet and could cause one of the strangest bugs in Firefox -- while polling, if you type in the address line, your text comes out sdrawkcab. No kidding. I kid you not. That's

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-22 Thread Robert Hanson
Ian, You are very welcome. It was just a few lines of code. You can get the file now -- http://chemapps.stolaf.edu/jmol/docs/examples-11/Jmol-11.zip Should be released later this week as Jmol 11.7.34. Bob -- Robert M. Hanson Professor of Chemistry St. Olaf College 1520 St. Olaf Ave.

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-21 Thread Robert Hanson
OK, two threads of discussion here. 1) DO NOT poll the applet with a setTimeout(). This will occasionally crash the applet and could cause one of the strangest bugs in Firefox -- while polling, if you type in the address line, your text comes out sdrawkcab. No kidding. I kid you not. 2) You need

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-21 Thread Robert Hanson
OK, the \? is in and has been tested with CIF files. Jmol doesn't allow * at the beginning of atom names, and some PDB atom names already have * in them, so \* is not an option. But what you can do is match specific numbers of characters, and make that wide enough to encompass all reasonable

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-15 Thread Chris Foley
I'm neither a _javascript_ programmer nor a proficient Jmol scripter but would these options be workable with those technologies: 1. Is there a way to check if Jmol is ready (either in _javascript_ or Jmol)? Do somehting like this: while(! isJmolReady()) { wait for 0.1s } Call the Jmol

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-15 Thread Ian Thomas
Hi Chris, Thanks for your suggestions. I'm not too sure about your suggestion 1 - perhaps a Jmol expert will know how to check if Jmol has finished loading the molecule? However, your suggestion 2 has got me somewhere. I modified my javascript so that if 'jmolGetPropertyAsArray(atomInfo,

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-15 Thread Ian Thomas
Hi Angel, Angel Herráez wrote: In my experience, the only safe solution is to have Jmol call the javascript, and to include that call in the jmolApplet() call itself. So, it could be something like jmolApplet(300, 'load myFile.cif; javascript parseAtoms(); ') I tried what you suggested

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-15 Thread Angel Herráez
I'm not too sure about your suggestion 1 - perhaps a Jmol expert will know how to check if Jmol has finished loading the molecule? I would say that is exactly what the LoadStructCallback function does. That's the best choice in my opinion. Cannot imagine why it is not working.

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-15 Thread Chris Foley
Sounds good. Glad I could help. :) Chris Ian Thomas wrote: Hi Chris, Thanks for your suggestions. I'm not too sure about your suggestion 1 - perhaps a Jmol expert will know how to check if Jmol has finished loading the molecule? However, your suggestion 2 has got me somewhere. I

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-15 Thread Chris Foley
Again, this won't solve the ? problem but it may be a way of avoiding the issue. A simple script to change all ? characters in atom names to $ (or whatever character might be legal in CIF files and convenient in Jmol scripts) would be an easy solution. If you don't want to alter your CIF

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-15 Thread Robert Hanson
Rich, what you can do to select 'C33?' is select C33? and not C33 If you also have C330 or C331 then you will have to exclude those explicitly: select C33? and not (C33,C330,C331) Bob Hanson -- Robert M. Hanson Professor of Chemistry St. Olaf College 1520 St. Olaf Ave. Northfield, MN 55057

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-15 Thread Ian Thomas
Hi Bob, Thanks for your message. Your suggestions would be great if I knew a priori what the atom labels up to the '?' were, but I don't. I need a wildcard filter that selects all atoms whose names end with (or even just contain) a literal '?'. Before I had this problem, as a new Jmol user I

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-15 Thread rgb
This is a good suggestion Chris. For Ian's problem (since it is a well-defined in-house setup) the preprocessing could change the ? of an atom name to disordered (no need to stick with one character). Rich On Wed, April 15, 2009 9:05 am, Chris Foley wrote: Again, this won't solve the ? problem

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-15 Thread Chris Foley
Thanks. :) Similar to Bob's suggestion, how about: select C33? and not (C33,C330,C331,C332,C333,C334,C335,C336,C337,C338,C339) Are letters allowed? select C33? and not (C33,C330,C331,C332,C333,C334,C335,C336,C337,C338,C339,C33a,C33b...) Clumsy but easily generated. As a suggestion

[Jmol-users] How to select atoms with names ending in '?'

2009-04-14 Thread thomas
Hello, I'm sure there's a really easy way to do this but as a new Jmol scripter I'm struggling to see how! I need to write a Jmol script to select all atoms with names ending in '?'. My input file is a CIF and the presence of a trailing question mark in the atom name indicates a disordered atom,

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-14 Thread Angel Herráez
Hello Ian I'm sorry to say that I have no experience with CIF files. That ? character is quite a bad choice. I had a similar problem once with PDB files having * in their atom IDs, and solved it using ? as the wildcard. Not usable for you ;.( Regarding your javascript method, the problem of

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-14 Thread rgb
On Tue, April 14, 2009 3:02 pm, tho...@ccdc.cam.ac.uk wrote: Hello, I'm sure there's a really easy way to do this but as a new Jmol scripter I'm struggling to see how! I need to write a Jmol script to select all atoms with names ending in '?'. My input file is a CIF and the presence of a

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-14 Thread thomas
Hi Rich, My input file is a CIF and the presence of a trailing question mark in the atom name indicates a disordered atom, e.g. 'C33?'. Is this construct a legal CIF atom_site_label Ian? As far as I am aware the CIF dictionary doesn't allow for that type of label. Or is this just for

Re: [Jmol-users] How to select atoms with names ending in '?'

2009-04-14 Thread rgb
tho...@ccdc.cam.ac.uk wrote: Hi Rich, My input file is a CIF and the presence of a trailing question mark in the atom name indicates a disordered atom, e.g. 'C33?'. Is this construct a legal CIF atom_site_label Ian? As far as I am aware the CIF dictionary doesn't allow for that