On 11/07/2012 04:39 PM, Angel Herráez wrote:
> Hi all
>
> I'm trying to set a JmolScript that counts the numbers of chains in a
> model.
>
> It seems that the data are in getProperty("chainInfo"), in the form
> chainInfo.models[0].chains=new Array()
>
> but I have trouble parsing this information into a number.
> I've gone as far as
> var chI = getProperty ("chainInfo", {protein});
> which I can print to the console, so the data is there,
> but I am unable to proceed further into the structure of that data.
>
> (jmolscript, no javascript; this is for the app)
>
> Any hints are welcome. Thanks
>
The 'chainInfo' output is very complicated. I would suggest using the 
"show chain" command instead, for example like this:

   select protein;
   var chain_count = script("show chain").lines.size - 1;
   print chain_count

The "-1" is in there because the "show chain" output has always an empty 
line at the end.
Useful for determining things like this is using the "show" command 
instead of the "print" command for looking at variable values:
   var x = script("show chain");
   show x;

Regards,
Rolf

-- 

Rolf Huehne
Postdoc

Leibniz Institute for Age Research - Fritz Lipmann Institute (FLI)
Beutenbergstrasse 11
07745 Jena, Germany

Phone:   +49 3641 65 6205
Fax:     +49 3641 65 6210
E-Mail:  [email protected]
Website: http://www.fli-leibniz.de

           Scientific Director: Prof. Dr. K. Lenhard Rudolph
        Head of Administration: Dr. Daniele Barthel
Chairman of Board of Trustees: Dennys Klein

VAT No: DE 153 925 464
Register of Associations: No. 296, Amtsgericht Jena
Tax Number: 162/141/08228


------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to