Re: [Jmol-users] Chemical elements and counts

2015-07-29 Thread Robert Hanson
Yes, sorry - must have erred in my cut/paste of the file. On Thu, Jul 16, 2015 at 8:04 AM, Angel Herráez wrote: > Jaim, that's what 1crn has. No H's, since it's an X-ray structure. > I'm getting the same results in load =1crn (i.e. the pdb file) > > I guess Bob run the script through a differen

Re: [Jmol-users] Chemical elements and counts

2015-07-15 Thread Angel Herráez
Jaim, that's what 1crn has. No H's, since it's an X-ray structure. I'm getting the same results in load =1crn (i.e. the pdb file) I guess Bob run the script through a different molecule ;-) -- Don't Limit Your Business. R

Re: [Jmol-users] Chemical elements and counts

2015-07-15 Thread Jaime Prilusky
> On Jul 15, 2015, at 11:46 PM, Robert Hanson wrote: > Most recent Jmol version allows > X = Jmol.evaluateVar(jmolApplet0, {*}.element.pivot > > $ load =1crn > $ print {*}.element.pivot > { > "C" : 1017 > "H" : 532 > "N" : 268 > "O" : 375 > "S" : 10 > } What exactly happens

Re: [Jmol-users] Chemical elements and counts

2015-07-15 Thread Robert Hanson
Most recent Jmol version allows X = Jmol.evaluateVar(jmolApplet0, {*}.element.pivot $ load =1crn $ print {*}.element.pivot { "C" : 1017 "H" : 532 "N" : 268 "O" : 375 "S" : 10 } $ :) ​ -- Don't Limit

Re: [Jmol-users] Chemical elements and counts

2015-07-14 Thread Eric Martz
Dear Angel, Your suggestions worked perfectly, with a little tweaking. Thanks! Eric On 7/14/15 2:07 PM, Angel Herráez wrote: > http://stackoverflow.com/questions/5667888/counting-occurences-of-javascri > pt-array-elements -

Re: [Jmol-users] Chemical elements and counts

2015-07-14 Thread Angel Herráez
Dear Eric, A possible solution in javascript, try something like this function test() { Jmol.script(myJmol, 'load =1d66'); d = Jmol.evaluateVar(myJmol, '{*}.element'); } and then http://stackoverflow.com/questions/5667888/counting-occurences-of-javascri pt-array-elements -

[Jmol-users] Chemical elements and counts

2015-07-14 Thread Eric Martz
print {*}.element.sort prints a sorted list of all chemical elements that occur in the loaded model. 1. How would I convert this to a list of the chemical elements in the loaded model (one line per element) and the atom count for each element? Perhaps as two arrays. Something like this, for 1d