Re: [PyMOL] How to count the number of molecules in a selection?

2020-07-10 Thread Pedro Lacerda
Thank you! Em qui., 9 de jul. de 2020 às 18:40, Thomas Holder < thomas.hol...@schrodinger.com> escreveu: > @cmd.extend > def count_molecules(selection="all", quiet=0): > tmpsele = cmd.get_unused_name("_tmp") > count = 0 > if cmd.select(tmpsele, selection): > count += 1 >

Re: [PyMOL] How to count the number of molecules in a selection?

2020-07-09 Thread Thomas Holder
@cmd.extend def count_molecules(selection="all", quiet=0): tmpsele = cmd.get_unused_name("_tmp") count = 0 if cmd.select(tmpsele, selection): count += 1 while cmd.select(tmpsele, f'{tmpsele} &! bm. first {tmpsele}'): count += 1 cmd.delete(tmpsele) if

[PyMOL] How to count the number of molecules in a selection?

2020-07-09 Thread Pedro Lacerda
... via programming -- Pedro Sousa Lacerda Laboratório de Bioinformática e Modelagem Molecular Faculdade de Farmácia / UEFS @pslacerda +55 71 9 9981-1856 http://lattes.cnpq.br/8338596525330907 ___ PyMOL-users mailing list Archives: http://www.mail-arc