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

select ?\? or ??\? or ???\? or ????\?

for example.

This is illustrated at
http://chemapps.stolaf.edu/jmol/docs/examples-11/new.htm

with files in

http://chemapps.stolaf.edu/jmol/docs/examples-11/Jmol-11.zip

Bob


On Tue, Apr 21, 2009 at 4:30 PM, Robert Hanson <[email protected]> wrote:

> 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 to get loadStructCallback working. If you can't, ask. It's
> really the only way to go.
>
> 3) \? and \*. Great idea. I should be able to do that easily enough.
>
> Bob
>
>
> On Wed, Apr 15, 2009 at 9:37 AM, Chris Foley <
> [email protected]> wrote:
>
>>  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 for Jmol developers, giving access to Java's regex API (or
>> a third party OS regex if backwards compatibility is an issue) would give
>> loads of flexibility for any type of string matching. Not sure how feasible
>> that would be.
>>
>> Chris.
>>
>>
>>
>>
>> [email protected] wrote:
>>
>> 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 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 files, this could be done on the fly with a PHP script that serves a
>> modified version of the CIF file specified in the URL. For 
>> example:http://www.mysite.com/jmol-friendly.php?file=myfile.cif could serve a
>> modified copy of myfile.cif.
>>
>> Just a suggestion. Hope it helps.
>>
>> Cheers,
>> Chris.
>>
>>
>> [email protected] 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 trailing question mark in the atom name indicates a disordered atom,
>> e.g. 'C33?'.
>>
>> The trouble is a '?' is used as a wildcard in Jmol scripting, and I
>> cannot
>> find a way of escaping it to prevent it from matching any single
>> character.
>>
>> I have successfully written a Javascript solution that uses the
>> following:
>>
>> var atomList = jmolGetPropertyAsArray("atomInfo", "all");
>>
>> to get a list of atom objects and then uses the 'info' field to get at
>> the
>> atom labels. However, due to some kind of race condition that I don't
>> fully understand yet, the script sometimes fails as Jmol hasn't fully
>> initialised when it runs so the atomInfo property is empty. This is not
>> my
>> preferred solution anyway...
>>
>> I'd much rather tackle this the easy way using a standard Jmol selection
>> expression. Is there any way I can do this please? Sorry if it's
>> obvious.
>>
>> Thanks in advance,
>>
>> Ian
>>
>>
>> LEGAL NOTICE
>> Unless expressly stated otherwise, information contained in this
>> message is confidential. If this message is not intended for you,
>> please inform [email protected] and delete the message.
>> The Cambridge Crystallographic Data Centre is a company Limited
>> by Guarantee and a Registered Charity.
>> Registered in England No. 2155347 Registered Charity No. 800579
>> Registered office 12 Union Road, Cambridge CB2 1EZ.
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by:
>> High Quality Requirements in a Collaborative Environment.
>> Download a free trial of Rational Requirements Composer 
>> Now!http://p.sf.net/sfu/www-ibm-com
>> _______________________________________________
>> Jmol-users mailing 
>> [email protected]https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
>>        
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by:
>> High Quality Requirements in a Collaborative Environment.
>> Download a free trial of Rational Requirements Composer 
>> Now!http://p.sf.net/sfu/www-ibm-com
>> _______________________________________________
>> Jmol-users mailing 
>> [email protected]https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
>>      
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by:
>> High Quality Requirements in a Collaborative Environment.
>> Download a free trial of Rational Requirements Composer 
>> Now!http://p.sf.net/sfu/www-ibm-com
>> _______________________________________________
>> Jmol-users mailing 
>> [email protected]https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by:
>> High Quality Requirements in a Collaborative Environment.
>> Download a free trial of Rational Requirements Composer Now!
>> http://p.sf.net/sfu/www-ibm-com
>> _______________________________________________
>> Jmol-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
>>
>
>
> --
> Robert M. Hanson
> Professor of Chemistry
> St. Olaf College
> 1520 St. Olaf Ave.
> Northfield, MN 55057
> http://www.stolaf.edu/people/hansonr
> phone: 507-786-3107
>
>
> 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
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


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
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to