Re: [PyMOL] How to catch PyMOL command exception within a Python script

2019-02-22 Thread Thomas Evangelidis
Hi Thomas, With regard to selections, sometimes a residue has missing atoms or is non-standard amino acid. In the first case it is matched with another residue in a second structure during the alignment and then when I try to fit the two selections of atoms from the two structures I get the

Re: [PyMOL] How to catch PyMOL command exception within a Python script

2019-02-22 Thread Thomas Holder
Hi Thomas, In general, the PyMOL API should raise pymol.CmdException if things go wrong. But in case of cmd.pair_fit() this wasn't happening (see my fix that I pushed few minutes ago: https://github.com/schrodinger/pymol-open-source/commit/b26d91c40d20344fef511ea9d6bb664a93f1bb4a )

Re: [PyMOL] How to catch PyMOL command exception within a Python script

2019-02-22 Thread Thomas Evangelidis
Hi Thomas, This is great! I can even include more atom types in the selection. Just for the record, is it possible to catch PyMOL exceptions like "Selector-Error" from within a Python script? Is there any general strategy to select which exception type to look for? In the past, I was catching

Re: [PyMOL] How to catch PyMOL command exception within a Python script

2019-02-22 Thread Thomas Holder
Hi Thomas, Getting rid of the string length limitations would need some major refactoring. There is currently no good workaround, other than avoiding such long selections. In this particular case, the script could use cmd.select_list() instead of concatenating the index list to a string:

[PyMOL] How to catch PyMOL command exception within a Python script

2019-02-22 Thread Thomas Evangelidis
Greetings, I am trying to run focus_alignment command ( https://pymolwiki.org/index.php/Focus_alignment) from within a Python script with my own custom selection (I include CA+CB atoms instead of only CA as in the default). Sometimes the selection is very large and PyMOL cannot hand it: