Trying to hold a range of atoms rigid during optimization. I get an error message. Can anyone spot what I’m doing wrong here?
Code: class MyModel(automodel): def special_restraints(self, aln): rsr = self.restraints at = self.atoms
rsr.add(secondary_structure.alpha(self.residue_range('138:A','149:A'))) rsr.add(secondary_structure.alpha(self.residue_range('523:B','530:B'))) r1 = rigid_body(self.residue_range('152:A','384:A')) rsr.rigid_bodies.append(rigid_body(r1))
a = MyModel(env, alnfile='KdpD_full_align.ali', knowns=('KdpD_GAF_bent_dimerA','KdpD_GAF_bent_dimerB','4CTI_mod_HAMP-delA','4CTI_mod_HAMP-delB'), sequence='KdpD_GDK_homodimer', assess_methods=(assess.DOPE, # #soap_protein_od.Scorer(), assess.GA341)) a.starting_model = 1 a.ending_model = 5
a.make() ———— Result:
Traceback (most recent call last): File "model-single-restraint.py", line 28, in <module> a.make() File "/Library/modeller-9.19/modlib/modeller/automodel/automodel.py", line 112, in make self.homcsr(exit_stage) File "/Library/modeller-9.19/modlib/modeller/automodel/automodel.py", line 561, in homcsr self.mkhomcsr(selection(self), aln) File "/Library/modeller-9.19/modlib/modeller/automodel/automodel.py", line 649, in mkhomcsr self.special_restraints(aln) File "model-single-restraint.py", line 15, in special_restraints rsr.rigid_bodies.append(rigid_body(r1)) File "/Library/modeller-9.19/modlib/modeller/util/modlist.py", line 77, in append self[dim] = obj File "/Library/modeller-9.19/modlib/modeller/util/modlist.py", line 38, in __setitem__ self._setfunc(ret, val) File "/Library/modeller-9.19/modlib/modeller/rigid_body_list.py", line 24, in _setfunc _modeller.mod_rigid_body_set(mdl.modpt, indx, obj._get_base_atoms(mdl), File "/Library/modeller-9.19/modlib/modeller/rigid_body.py", line 18, in _get_base_atoms return mdl.get_list_atom_indices(self._atoms, None) File "/Library/modeller-9.19/modlib/modeller/coordinates.py", line 298, in get_list_atom_indices (objinds, mdl) = obj.get_atom_indices() AttributeError: 'rigid_body' object has no attribute 'get_atom_indices'
On 6/5/18 12:26 PM, Richard E. Gillilan wrote: > Trying to hold a range of atoms rigid during optimization.
In most cases it's easier and more efficient to do that by simply excluding the atoms from the optimization, by defining select_atoms as per https://salilab.org/modeller/9.20/manual/node23.html
> I get an error message. Can anyone spot what I’m doing wrong here? ... > r1 = rigid_body(self.residue_range('152:A','384:A')) > rsr.rigid_bodies.append(rigid_body(r1))
Sure, you are trying to make a rigid body containing another rigid body, which isn't supported in Modeller. If you want to go the rigid body route the following should work:
r1 = rigid_body(self.residue_range('152:A','384:A')) rsr.rigid_bodies.append(r1)
Ben Webb, Modeller Caretaker
On Jun 5, 2018, at 6:38 PM, Modeller Caretaker <modeller-care@salilab.orgmailto:modeller-care@salilab.org> wrote:
On 6/5/18 12:26 PM, Richard E. Gillilan wrote: Trying to hold a range of atoms rigid during optimization.
In most cases it's easier and more efficient to do that by simply excluding the atoms from the optimization, by defining select_atoms as per https://salilab.org/modeller/9.20/manual/node23.html
Nice idea! I can do this for one of the rigid bodies. The other, which isn’t defined yet in the code snip I sent, needs to move relative to the other, so I’m thinking it will have to be defined as a true rigid body.
I get an error message. Can anyone spot what I’m doing wrong here? ... r1 = rigid_body(self.residue_range('152:A','384:A')) rsr.rigid_bodies.append(rigid_body(r1))
Sure, you are trying to make a rigid body containing another rigid body, which isn't supported in Modeller. If you want to go the rigid body route the following should work:
Ah ha! I see I split a line and accidentally duplicated the rigid_body function. Funny how you can stare at something simple and just not see it. Thanks!
r1 = rigid_body(self.residue_range('152:A','384:A')) rsr.rigid_bodies.append(r1)
Ben Webb, Modeller Caretaker -- modeller-care@salilab.orgmailto:modeller-care@salilab.org https://salilab.org/modeller/ Modeller mail list: https://salilab.org/mailman/listinfo/modeller_usage
participants (3)
-
Modeller Caretaker
-
Richard E. Gillilan
-
Richard Gillilan