Hi Benedikt, You can do a work around with '<' or '>': Sele qm, q>0.9999999 and q<1.0000001
I checked that this works like this for my "obj" in PyMOL: stored.q = [] iterate obj, stored.q.append(q) q_arr = np.array(stored.q) q_1 = q_arr[q_arr == 1] # only keep values of q that equal 1 print(len(q_1)) You can make actually use this numpy feature to slice the atom indices into an array (lets say atom_arr) then make a selection with it like this: cmd.select("qm",f"index {'+',join(atom_arr)}") But '<' or '>' operators are quicker and seem safe Kind regards, Ali Kusay Ali Kusay | BPharm (Hons) | PhD Candidate & Pharmacist The University of Sydney School of Pharmacy | Faculty of Medicine and Health 424, Brain and Mind Centre | The University of Sydney | NSW 2050 On 12/2/21, 11:34 pm, "Benedikt Floeser" <benedikt.floe...@cec.mpg.de> wrote: Dear fellow users, among other things I use pymol to edit PDB files so as to use them in an ORCA calculation. This entails changing the occupancy and B-factors to values of 0, 1 and 2. Changing these entries to the appropriate values but selecting, e.g., all atoms with a q value of 1 or 1.00 with something like 'select qm, q = 1' fails whereas it works with partial charges or formal charges. Is there any way to do this without resorting to workarounds with '<' or '>'? Best -- Dr. Benedikt M. Flöser Max-Planck-Institute for Chemical Energy Conversion Stiftstraße 34-36 45470 Mülheim a.d. Ruhr Germany _______________________________________________ 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