Hi @lmiq
I’m encountering an issue when calculating the center of mass using cm.select(). Specifically, it seems that the selection is not correctly including all the specified residues.
For example, whether I use:
protein = cm.select(atoms, “protein and resnum 7”)
or
protein = cm.select(atoms, “protein and resnum 7 8 9 391 392 393 72”)
I observe that a similar number of solute atoms are being selected. Upon closer inspection, it looks like only the first residue ID is being considered during the calculation, even when multiple IDs are specified.
I’ve tried using a comma-separated list and other formats, but nothing seems to change the behavior. The script below runs without errors, but the selection appears incorrect:
atoms = cm.readPDB(“*.pdb”)
protein = cm.select(atoms, “protein and resnum 7 8 9 391 392 393 72”)
bgc = cm.select(atoms, “resname bgc”)
solute = cm.AtomSelection(protein, nmols=1)
solvent = cm.AtomSelection(bgc, natomspermol=24) # 24 atoms per BGC molecule
trajectory = cm.Trajectory(“../*.xtc”, solute, solvent)
options4 = cm.Options(bulk_range=(8.0, 12.0))
results = cm.mddf(trajectory, options4)
cm.save(results, “./save.json”)
print(“Results saved to save.json”)
Could you please advise on the correct syntax for selecting multiple residues, or let me know if this is a known issue?
Best regards,
Sneha Sahu