I seem to have run into a bug while trying to use a cryoEM restraint with IMP.pmi 2.8.0. Reading the BuildSystem code, it looks like it will add individual gaussians to the flexible beads as long as a non-zero value is given for the em_residues_per_gaussian column in the topology file. However, this then crashes when the system is shuffled with IMP.pmi.tools.shuffle_configuration. If I do not shuffle the system and start the simulation via the IMP.pmi.macros.ReplicaExchange0 routine, I get the same error while performing replica exchange.

 

I am setting up my complex using a topology file and the BuildSystem macro, following the code below.

 

m = IMP.Model()

topology = IMP.pmi.topology.TopologyReader(topology_file,

                                           pdb_dir=os.path.join("data/PDBs"),

                                           fasta_dir=os.path.join("data/Sequences"),

                                           gmm_dir=os.path.join("data/subunitEMs"))

bs = IMP.pmi.macros.BuildSystem(m, resolutions=[1,10])

bs.add_state(topology)

root_hier, dof = bs.execute_macro()

#Add restraints..

<snip>

#

IMP.pmi.tools.shuffle_configuration(root_hier)

 

This fails with the following error:

 

shuffling 23 rigid bodies

shuffling 186 flexible beads

Traceback (most recent call last):

  File "..\modelling\simulate_tfiid.py", line 690, in <module>

    main()

  File "..\modelling\simulate_tfiid.py", line 686, in main

    simulation = TFIIDModelling(parser.parse_args())

  File "..\modelling\simulate_tfiid.py", line 333, in __init__

    self.initialise()

  File "..\modelling\simulate_tfiid.py", line 357, in initialise

    tools.shuffle_configuration(self.root_hier)

  File "C:\Users\fduffy\AppData\Local\Continuum\Anaconda2\envs\IMP\lib\site-packages\IMP\pmi\tools.py", line 2087, in shuffle_configuration

    IMP.core.transform(d, transformation)

  File "C:\Users\fduffy\AppData\Local\Continuum\Anaconda2\envs\IMP\lib\site-packages\IMP\core\__init__.py", line 8878, in transform

    return _IMP_core.transform(*args)

_IMP_kernel.UsageException: Usage check failure: Particle is also a RigidBody, so this function would do the wrong thing; decorate your Particle as a RigidBody instead and call transform(RigidBody a, const algebra::Transformation3D &tr)

 

Looking at the tools.shuffle_configuration code, the problem seems to lie around line 2111, where

 

<https://github.com/salilab/imp/blob/develop/modules/pmi/pyext/src/tools.py>

1987     rigid_bodies,flexible_beads = get_rbs_and_beads(hierarchies)

2090 for fb in flexible_beads:

2110 # For gaussians, treat this fb as an rb

2111 if IMP.core.NonRigidMember.get_is_setup(fb):

2112     xyz=[fb.get_value(IMP.FloatKey(4)), fb.get_value(IMP.FloatKey(5)), fb.get_value(IMP.FloatKey(6))]

2126 else:

2127    d =IMP.core.XYZ(fb)

 

Presumably, the IMP.core.NonRigidMember.get_is_setup(fb) call should return True for floppy bodies with gaussians, but it currently is returning False, which causes the co-ordinate transformation to fail.

 

Is there any easy solution or workaround for this?

 

Fergal Duffy
Staff Scientist

Center for Infectious Disease Research
307 Westlake Ave N, Suite 500 | Seattle, WA 98109
206.256.7435 | fergal.duffy@cidresearch.org