[Chimera-users] using CalcAttr from a Python script

Roger L. Chang rlchang at ucsd.edu
Sun Feb 26 19:50:09 PST 2012


Hi,

1) I need to get residue.areaSES for two separate selections (all polar
amino acids and all nonpolar amino acids).  I have successfully generated
a list of residue.areaSES using the GUI simply by selecting the residues
of interest and then using the attribute calculator typing
"residue.areaSES" in the formula box of the Attribute Calculator, which
outputs the list to the Reply Log.  This is the data that I need, but I
need to get it for >2000 PDB structures and would like to automate this
analysis through a Python script.  I am somewhat new to Python and Chimera
and don't yet know all the ins and outs yet.  I dug through the code and
found a method "getResidueAttr" in the "ResidueDataWrapper" class from
"CalcAttr".  This seems to be what I need, but I don't know the proper
syntax to call it from my Python script.  Could someone please provide an
example?

2) I would like to sum the residue.areaSES values once I have them.  I
tried "sum(residue.areaSES)" in the formula box of the Attribute
Calculator in the GUI, but this returns the error "Formula evaluation
error: expecting vector argument in function".  I'm not sure again on the
proper syntax to use "sum()" in the Attribute Calculator.  If I knew how
to generate/save the residue.areaSES data from the command line, I could
just parse the saved file and sum the values in Python.  How can Attribute
Calculator formulas be used from the command line, and if they can't, how
can I save the residue.areaSES data to file from a Python script?

Thanks in advance,
Roger


-- 
Roger L. Chang
Graduate Student
Bioinformatics and Systems Biology Graduate Program
University of California, San Diego



More information about the Chimera-users mailing list