Platform: Windows, Linux
Version: 2.14 and the latest IMP-develop branch
Description: The pmi.tools.shuffle_configuration does not shuffle (randomize the coordinates of) a single rigid body when the topology has all other domains/molecules setup as beads (with the gaussians setup, i.e. em_residues_per_gaussian non-zero). This is because all the gaussian-setup beads are added to the collision_excluded_idxs (to avoid considering them for collisions) initially. The script calculates the set of beads other_idxs = members of rigid body - collisions_excluded_idxs, and if this set is empty, skips over the subsequent randomizing step. The script works properly if more than one rigid bodies are present (or gaussians are not setup).
Reproduce the issue: Use the topology file below with appropriate pdb/fastas -> build the system (BuildSystem macro in pmi) -> call pmi.tools.shuffle_configuration on the root_hierarchy -> compare the coordinates of the rigid body before and after the randomization step. Repeat the same procedure with an added copy (pkp1a.1) and the script runs properly.
All the files necessary to reproduce the bug are attached.
files.zip
I am opening a PR for an attempted fix, though I am not certain why the continue statement was kept in the original code. Currently assuming it was to prevent the execution of the second block of collision-avoidance code when other_idxs is empty.
Platform: Windows, Linux Version: 2.14 and the latest IMP-develop branch
Description: The
pmi.tools.shuffle_configuration
does not shuffle (randomize the coordinates of) a single rigid body when the topology has all other domains/molecules setup as beads (with the gaussians setup, i.e.em_residues_per_gaussian
non-zero). This is because all the gaussian-setup beads are added to thecollision_excluded_idxs
(to avoid considering them for collisions) initially. The script calculates the set of beadsother_idxs
= members of rigid body -collisions_excluded_idxs
, and if this set is empty, skips over the subsequent randomizing step. The script works properly if more than one rigid bodies are present (or gaussians are not setup).Reproduce the issue: Use the topology file below with appropriate pdb/fastas -> build the system (
BuildSystem
macro inpmi
) -> callpmi.tools.shuffle_configuration
on theroot_hierarchy
-> compare the coordinates of the rigid body before and after the randomization step. Repeat the same procedure with an added copy (pkp1a.1
) and the script runs properly.Topology file:
Output:
One possible expected Output:
All the files necessary to reproduce the bug are attached. files.zip
I am opening a PR for an attempted fix, though I am not certain why the
continue
statement was kept in the original code. Currently assuming it was to prevent the execution of the second block of collision-avoidance code whenother_idxs
is empty.