Hello:
I am trying to use the following script for restrain my secondary structure:
from modeller import * from modeller.automodel import * # Load the automodel class log.verbose() env = environ() # directories for input atom files env.io.atom_files_directory = [’.’, ’../atom_files’] class MyModel(automodel): def special_restraints(self, aln): rsr = self.restraints at = self.atoms # Add some restraints from a file: # rsr.append(file=’my_rsrs1.rsr’) # Residues 20 through 30 should be an alpha helix: rsr.add(secondary_structure.alpha(self.residue_range(’20:’, ’30:’))) # Two beta-strands: rsr.add(secondary_structure.strand(self.residue_range(’1:’, ’6:’))) rsr.add(secondary_structure.strand(self.residue_range(’9:’, ’14:’)))
a = MyModel(env, alnfile='CBM-mult.ali', knowns=('2z73A','3uonA'), sequence='CBM', assess_methods=(assess.DOPE, assess.GA341))
a.starting_model= 1 a.ending_model = 1
a.make()
But it always failed with messages:
File "model_mult.py", line 36 SyntaxError: Non-ASCII character '\xe2' in file model_mult.py on line 36, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details 02-modeller/work> python test.py File "test.py", line 7 SyntaxError: Non-ASCII character '\xe2' in file test.py on line 7, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
Does anybody have any idea where is the problem?
THX ALbert
On 8/17/14, 1:35 AM, Albert wrote: > I am trying to use the following script for restrain my secondary > structure:
Indentation is important in Python, but the script you show is not indented properly, so won't work. Your mail client may have stripped the indentation. It's better to attach this sort of thing rather than try to paste it into your email.
> SyntaxError: Non-ASCII character '\xe2' in file test.py on line 7, but > no encoding declared; see http://www.python.org/peps/pep-0263.html for > details
This is not a Modeller error. Like it says, you have a non-ASCII character in your script, and Python expects plain ASCII.
Ben Webb, Modeller Caretaker
participants (2)
-
Albert
-
Modeller Caretaker