Actually no - it turns out the CIF file I thought it was predicting bonds for that didn't have bonds in DID have bonds in. The bond prediction was haywire because the structure had its geometry artificially generated, but loading without the bond prediction displayed all the listed bonds a-ok.
I'm replying to the mailing list so others know autobonding, if set on, won't occur if the CIF contains _any_ bonds. Thanks Bob. Dave 2009/6/16 Robert Hanson <[email protected]>: > Do you really have to do that? Jmol won't autobond if the CIF file has > bonds. Or at least if it doesn't have enough bonds. The criterion for > triggering autobonding is: > > boolean doBond = (forceAutoBond || doAutoBond && ( > modelBondCount == 0 > || modelIsPDB && modelBondCount < modelAtomCount / 2 > || modelHasSymmetry && !symmetryAlreadyAppliedToBonds > )); > > So I think if you have no bonds, then modelBondCount will be 0, and Jmol > will automatically autobond. Were you having problems in that Jmol was > autobonding when you didn't want it to? > > Bob > > > > On Tue, Jun 16, 2009 at 11:23 AM, N David Brown <[email protected]> > wrote: >> >> 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 > > > > -- > 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

