Hi,

Am 30.03.2013 um 17:37 schrieb Eric Martz:

> Seems to work perfectly! I never would have figured that out myself! 
> Thanks, Alex!
> 
> How about the number of atoms per residue/group?
> Anything more elegant than
> 
> print {nhw}.groupindex.all.count / {nhw}.groupindex.all.count().length
> 

It is already in the array which .count() returns:

{nhw}.groupindex.all.count()

gives you an array of length n by 2. Lets access the first element.

{nhw}.groupindex.all.count()[1]

which gives you an array of length 2. The first element is a groupindex and the 
second element is the number of times this groupindex occurs. To access the 
second element do:

( {nhw}.groupindex.all.count()[1] )[2]  

you need the () parenthesis because double [] parentheses have a range select 
meaning in Jmolscript  e.g. array[1][4] return element 1 to 4 of the array


Best
Alex

> ???
> 
> Eric
> 
> At 3/29/13, Alexander Rose wrote:
>> Hi,
>> 
>> A while ago I came up with this:
>> 
>> print {nhw}.groupindex.all.count().length
>> 
>> It is also very fast. Much faster then using a for loop in Jmolscript.
>> 
>> 
>> Best
>> Alex
>> 
>> Am 29.03.2013 um 18:39 schrieb Eric Martz:
>> 
>>> I have been enjoying jmolEvaluate, e.g.
>>> jmolEvaluate("{mse.ca}.count") to get the number of selenomethionines
>>> in the model.
>>> 
>>> What is a general method to get the number of groups/copies of a
>>> group (e.g. ligand molecule)? Not the number of atoms, but the number
>>> of groups? For example, 4b14 has 3 copies of a ligand molecule
>>> designated NHW (2-oxopentadecyl-CoA).
>>> 
>>> print {nhw}.count
>>> 
>>> gives 192 atoms. How do I generate a report that there are 3 copies of NHW?
>>> 
>>> Thanks, Eric
>>> 
>>> 
>>> 
> 
> 
> ------------------------------------------------------------------------------
> Own the Future-Intel(R) Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest. Compete 
> for recognition, cash, and the chance to get your game on Steam. 
> $5K grand prize plus 10 genre and skill prizes. Submit your demo 
> by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users


------------------------------------------------------------------------------
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to