Hi Thomas, If you add "and present" to the selection expression, then you'll only include atoms which have coordinates in the current state:
select s1, 2hduA & present I had a quick look at 2hduA and 2r9wA and don't see any non-standard residues, but a lot of alternate coordinates. Depending on what your script exactly does, you might need: select s1, 2hduA & alt +A Another (maybe the best) approach would be to use an alignment object: align 2hduA, 2r9wA, object=aln, cycles=0, transform=0 select s1, 2hduA & aln Cheers, Thomas > On Feb 22, 2019, at 4:05 PM, Thomas Evangelidis <teva...@gmail.com> wrote: > > 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 following error: > > Calculating RMSD between pocket of model 2hduA and 2r9wA. > ExecutiveRMS-Error: Atom counts between selections don't match (799 vs 797) > Executive: Error -- no atoms left after refinement! > RMSD = -1.000000 > > Can you think of a clever way to exclude amino acids with missing atoms or > non-standard ones from pair_fit() or rms_cur()? > > Best, > Thomas > > > > > > On Fri, 22 Feb 2019 at 12:32, Thomas Holder <thomas.hol...@schrodinger.com> > wrote: > 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 > ) > > cmd.select() correctly raises an exception, so if you want to make a script > more robust against selection failures, you could always create a named > selection first to check if it's valid. > > tmpsele1 = cmd.get_unused_name('_sele1') > try: > cmd.select(tmpsele1, someexpression, 0) > except pymol.CmdException: > print('invalid selection') > finally: > cmd.delete(tmpsele1) > > > Cheers, > Thomas > > > On Feb 22, 2019, at 12:11 PM, Thomas Evangelidis <teva...@gmail.com> wrote: > > > > 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 > > exceptions from 'tmalign' with "except AssertionError:" which doesn't work > > for "Selector-Error". > > > > Best, > > Thomas > > -- > ====================================================================== > Dr Thomas Evangelidis > Research Scientist > IOCB - Institute of Organic Chemistry and Biochemistry of the Czech Academy > of Sciences > Prague, Czech Republic > & > CEITEC - Central European Institute of Technology > Brno, Czech Republic > > email: teva...@gmail.com > website: https://sites.google.com/site/thomasevangelidishomepage/ -- Thomas Holder PyMOL Principal Developer Schrödinger, Inc. _______________________________________________ PyMOL-users mailing list Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net Unsubscribe: https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe