I would use:
x = {_S and connected (_S)}.size / 2
or for the applet in JavaScript:
var nSS = jmolEvaluate("{_S and connected({_S})}.length / 2")
Bob
On Mon, Apr 12, 2010 at 7:58 AM, Eric Martz <[email protected]>wrote:
> I would like to get the count of disulfide bonds.
>
> At http://chemapps.stolaf.edu/jmol/docs/examples-11/new.htm
>
> javascript alert(jmolGetPropertyAsArray("bondInfo", "cys.sg").length)
>
> alerts "3", the number of ssbonds in 1crn. It also correctly alerts
> "6" for 3kwb (which six disulfides and four cys residues not in
> disulfide bonds). Perfect!
>
> 1. Is the above syntax the correct/recommended method for javascript?
>
> getproperty bondinfo sulfur
> and
> getproperty bondinfo "cys.sg" # quotes are required
>
> report six bonded atoms for 3kwb.
>
> 2. However, I have not discerned the correct syntax for assigning the
> number of ssbonds to a Jmol variable.
>
> x = getproperty bondinfo "cys.sg"
> print x
>
> produces
>
> Token[keyword(5/0x8101005) value="getproperty"]
>
> print x.length
>
> produces
>
> 0
>
> ???
>
> The example at http://chemapps.stolaf.edu/jmol/docs/#getproperty
>
> var modelInfo = jmolGetPropertyAsArray("modelInfo")
> alert(modelInfo.modelCount)
> for (int i = 0; i < modelInfo.modelCount; i++)
> alert(modelInfo.models[i].name).
>
> used .modelCount.
>
> However, I see no .bondCount in the report from getproperty bondinfo "
> cys.sg".
>
> 3. How would I get the .bondCount in Jmol?
>
> 4. If I successfully get the .bondCount into a Jmol variable (or any
> other value), can I retrieve that value in javascript?
>
> x = 5
> javascript alert(jmolGetPropertyAsString(x))
>
> produces no alert at new.htm.
>
> Thanks, -Eric
>
>
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> 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
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users