[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[modeller_usage] Syntax errors in defining model atoms





Dear all,

I am trying to create distance restraints in a model based on an example script from the modeller manual named model-addrsr.py . I am following the exact same syntax of this script, yet I need to change the numbering of my residues (since my restraints are for a model that starts at residue 2 and not 1) so I add another restraint to renumber it (self.rename_segments), however, when I try to use my new script (listed at the bottom of this mail), I get an error message that the atom I listed OG1:132A:A does not exist: 'No such atom: OG1:132A:A', does anyone know what am I doing wrong here?

Thank you,
Doran

My script:

# Homology modeling by the automodel class
from modeller import *              # Load standard Modeller classes
from modeller.automodel import *    # Load the automodel class

log.verbose()                       # request verbose output
env = environ(rand_seed = -500) # create a new MODELLER environment to build this model in
env.io.atom_files_directory = './:'      # directories for input atom files
env.io.hetatm = True                # read HETATM records (for Na ions)

################################
# define the modeling parameters
class mymodel(automodel):
	def special_restraints(self, aln):
		self.rename_segments (segment_ids=('A'),renumber_residues=(2))
		rsr = self.restraints
		at = self.atoms
rsr.add(forms.gaussian(group=physical.xy_distance,feature=features.distance(at['OG1:132A:A'],at['NA:310A:A']),mean=2.4, stdev=0.1))

	def user_after_single_model(self):
	    self.rename_segments (segment_ids=('A'),renumber_residues=(2))


a = mymodel(env,
              alnfile  = 'file.pir',   # alignment filename
              knowns   = ('No_anis'),   # codes of the templates
sequence = ('target')) # code of the target in the pir file

a.starting_model= 1                # index of the first model
a.ending_model  = 1               # index of the last model
# (determines how many models to calculate)
a.deviation = 2.0                        # Deviation in models
#a.md_level = refine.very_slow
a.make()                            # do the actual homology modeling