Hello,
I'm wondering what's the easiest way to extract the number of residues from a PyMOL molecular object?? I need to be able to do this in an automated way for a python script I'm writing. I guess a roundabout way would be to define a selection (say "X_ca") from an object ("X"), and then use something like this to extract the number of atoms in the X_ca object:

        calphas = cmd.get_model("X_ca");
        num_residues = length(calphas.atom);

But, this seems unneccesary? I thought I could load in the chempy "models" module and then use its "get_residues()" function, but the command fails as follows:

###
models.get_residues("all")
PyMOL>models.get_residues("all")
Traceback (most recent call last):
  File "modules/pymol/parser.py", line 251, in parse
    exec(com2[nest]+"\n",pymol_names,pymol_names)
  File "<string>", line 1, in ?
AttributeError: 'module' object has no attribute 'get_residues'
###

So, I'm wondering what I'm missing...is there an easy way to do this?

Thanks anyone,
        Cameron



Reply via email to