My hero, thanks Bob. Ironically this is the placeholder code I put in, but
your response gives me that guarantee I needed!
For anyone else wanting to auto-predict bonds in a CIF when none are
present, here's the simple Jmol script required
load trajectory filename; var n = {*}.bondcount; if (n == 0); set
autobond on; load trajectory filename; end if;
::Note:: Both occurrences of 'filename' should changed to the path of your
CIF file. Note also that there are a variety of 'load' commands, of which
'load trajectory' is a shortcut version, so try a more suitable load command
if you have any problems.
Best,
Dave
2009/6/16 Robert Hanson <[email protected]>
> easy!
>
> x = {*}.bondcount
>
> It's an average value, but will return 0 if there are no bonds.
> If in JavaScript:
>
> var x = jmolEvaluate("{*}.bondcount")
>
>
>
> On Tue, Jun 16, 2009 at 10:16 AM, N David Brown <[email protected]>wrote:
>
>> Is there a simple way to get the number of bonds in a structure? Other
>> than the atom property 'bondcount', I can't find a suitable property.
>> I'm intending to test, after a CIF's been loaded, whether zero bonds are
>> present (i.e. the CIF didn't contain a bond list), and thereafter set
>> autobond ON and reload the file.
>>
>> Thanks,
>>
>> Dave
>>
>>
>> ------------------------------------------------------------------------------
>> Crystal Reports - New Free Runtime and 30 Day Trial
>> Check out the new simplified licensing option that enables unlimited
>> royalty-free distribution of the report engine for externally facing
>> server and web deployment.
>> http://p.sf.net/sfu/businessobjects
>> _______________________________________________
>> 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
>
--
- N David Brown
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users