
Hi I'm trying to apply a restraint to keep fixed the CA of a specific residue using a Gaussian form. This mathematical form of restraints accept four arguments:
forms.Gaussian(group, feature, mean, stdev)
mean and stdev are defined by me according to my system. In the `feature` I could use features.ZCoordinate(*atom_ids).
But I`m struggling with the group argument. I think the group is a physical restraints type and I have defined the type `z_coord_type', but I always get an error from MODELLER/10.4.
* rsr.add(forms.Gaussian(group=physical.z_coordinate,AttributeError: 'module' object has no attribute 'z_coordinate'*
Am I doing this right? Below I include my script file.
Thank you in advance.
*from modeller import *from modeller.automodel import *from modeller.physical import PhysicalTypez_coord_type = PhysicalType(99, 'z_coordinate')import syslog.verbose()env = Environ()class MyModel(AutoModel): def special_restraints(self, aln): rsr = self.restraints at = self.atoms rsr.add(forms.Gaussian(group=physical.z_coordinate, feature=features.ZCoordinate(at['CA:25:A']), mean=193.8, stdev=0.1)) a = MyModel(env, alnfile='multi-co.ali', knowns=('HPI1_fit'), sequence='multi', assess_methods=(assess.DOPE,assess.GA341))a.starting_model = 1a.ending_model = 10a.make()*

On 5/23/25 7:05 AM, Fred Pontes via modeller_usage wrote: > I'm trying to apply a restraint to keep fixed the CA of a specific > residue using a Gaussian form. This mathematical form of restraints > accept four arguments: > > forms.Gaussian(group, feature, mean, stdev) > > mean and stdev are defined by me according to my system. In the > `feature` I could use features.ZCoordinate(*atom_ids). > > But I`m struggling with the group argument. I think the group is a > physical restraints type and I have defined the type `z_coord_type', but > I always get an error from MODELLER/10.4. > > * rsr.add(forms.Gaussian(group=physical.z_coordinate, > AttributeError: 'module' object has no attribute 'z_coordinate'*
The group is just where violations of the restraint are tabulated or it is scaled, so in most cases it doesn't really matter. But if you really want to separate these restraints from others used in Modeller, use physical.absposition:
https://salilab.org/modeller/10.6/manual/node267.html#tab:physrsrtypes
The predefined Python classes correspond to constants in the underlying Fortran code, so I don't think creating your own class would work.
Ben Webb, Modeller Caretaker
participants (2)
-
Fred Pontes
-
Modeller Caretaker