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 On Fri, 22 Feb 2019 at 11:28, Thomas Holder <thomas.hol...@schrodinger.com> wrote: > 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: > > cmd.select_list('sel1', obj1, [int(i) for i in id1], mode='index') > cmd.select_list('sel2', obj2, [int(i) for i in id2], mode='index') > cmd.pair_fit("sel1 and aln", "sel2 and aln") > cmd.delete('sel1') > cmd.delete('sel2') > > Hope that helps. > > Cheers, > Thomas > > > > On Feb 22, 2019, at 9:32 AM, Thomas Evangelidis <teva...@gmail.com> > wrote: > > > > 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: > > > > Selector-Error: Word too long. Truncated: > > Selector-Error: > 183+186+191+194+196+199+203+206+208+211+437+440+445+448+456+459+465+468+473+477+480+483+486+490+493+496+499+505+508+512+515+523+526+530+534+537+541+544+827+830+832+835+1138+1141+1150+1153+1155+115Selector-Error: > Invalid selection name "730". > > poly and 4kz6A and aln and index > 183+186+191+194+196+199+203+206+208+211+437+440+445+448+456+459+465+468+473+477+480+483+486+490+493+496+499+505+508+512+515+523+526+530+534+537+541+544+827+830+832+835+1138+1141+1150+1153+1155+1158+1175+1178+1183+1421+1424+1428+1431+1647+1650+1655+1658+ > 730<-- > > Selector-Error: Word too long. Truncated: > > Selector-Error: > 216+219+224+227+229+232+236+239+241+244+479+482+487+490+498+501+507+510+515+519+522+525+528+532+535+538+541+547+550+554+557+565+568+572+576+579+583+586+873+876+878+881+1192+1195+1204+1207+1209+121Selector-Error: > Invalid selection name "868". > > poly and 2r9wA and aln and index > 216+219+224+227+229+232+236+239+241+244+479+482+487+490+498+501+507+510+515+519+522+525+528+532+535+538+541+547+550+554+557+565+568+572+576+579+583+586+873+876+878+881+1192+1195+1204+1207+1209+1212+1229+1232+1237+1491+1494+1498+1501+1747+1750+1755+1758+ > 868<-- > > ExecutiveRMS-Error: No atoms selected. > > Selector-Error: Word too long. Truncated: > > Selector-Error: > 183+186+191+194+196+199+203+206+208+211+437+440+445+448+456+459+465+468+473+477+480+483+486+490+493+496+499+505+508+512+515+523+526+530+534+537+541+544+827+830+832+835+1138+1141+1150+1153+1155+115Selector-Error: > Word too long. Truncated: > > Selector-Error: > 216+219+224+227+229+232+236+239+241+244+479+482+487+490+498+501+507+510+515+519+522+525+528+532+535+538+541+547+550+554+557+565+568+572+576+579+583+586+873+876+878+881+1192+1195+1204+1207+1209+121Selector-Error: > Invalid selection name "730". > > ( ( poly and 4kz6A and aln and index > 183+186+191+194+196+199+203+206+208+211+437+440+445+448+456+459+465+468+473+477+480+483+486+490+493+496+499+505+508+512+515+523+526+530+534+537+541+544+827+830+832+835+1138+1141+1150+1153+1155+1158+1175+1178+1183+1421+1424+1428+1431+1647+1650+1655+1658+ > 730 ) in ( poly and 2r9wA and aln and index > 216+219+224+227+229+232+236+239+241+244+479+482+487+490+498+501+507+510+515+519+522+525+528+532+535+538+541+547+550+554+557+565+568+572+576+579+583+586+873+876+878+881+1192+1195+1204+1207+1209+1212+1229+1232+1237+1491+1494+1498+1501+1747+1750+1755+1758+ > 868 ) )<-- > > > > Is there a way to ask PyMOL to accept longer selection strings? > > Alternatively, is it possible to catch this exception from within the > script using "try: ... except <some exception>:" statement? > > > > Thanks in advance. > > 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. > > -- ====================================================================== Dr Thomas Evangelidis Research Scientist IOCB - Institute of Organic Chemistry and Biochemistry of the Czech Academy of Sciences <https://www.uochb.cz/web/structure/31.html?lang=en> Prague, Czech Republic & CEITEC - Central European Institute of Technology <https://www.ceitec.eu/> Brno, Czech Republic email: teva...@gmail.com website: https://sites.google.com/site/thomasevangelidishomepage/
_______________________________________________ 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