You are here

Executing the mc simulation of polyalanine fragment

9 posts / 0 new
Last post
Executing the mc simulation of polyalanine fragment
#1

Hi,

I am trying to run the monte carlo simulation of a polyalanine fragment given in the tutorial .. After typing the whole script in notepad and saving with .py extension and after ruuning on xterm window I am getting the following error ...

In [41]: ipython mc.py
------------------------------------------------------------
File "", line 1
ipython mc.py
^
SyntaxError: invalid syntax

Can anybody let me know how do I have to run such scripts or how to execute that tutorial

----
BHARAT

Post Situation: 
Mon, 2011-01-17 19:18
bharat_46010

You can execute the script from within ipython with the run command:

ln [41]: run mc.py

alternatively, you can run the script from the command line (i.e. before entering ipython) with:

ipython mc.py

Tue, 2011-01-18 09:55
evan

I tried first with run mc.py command . its showing the following error :-

In [1]: run mc.py
------------------------------------------------------------
File "mc.py", line 9
def perturb_bb = function(pose):
^
SyntaxError: invalid syntax

WARNING: Failure executing file:

-------------------------------------------

Then I tried running the script from command line and I got the following error :-

bash-3.2$ ipython mc.py
------------------------------------------------------------
File "mc.py", line 9
def perturb_bb = function(pose):
^
SyntaxError: invalid syntax

Tue, 2011-01-18 18:44
bharat_46010

python syntax for a method is:

def function_name( function_input_variables):

the "def perturb_bb = function(pose):" will cause a syntax error (as noted above), use the "return" keyword if you want to return the value of a variable "perturb_bb"
the syntax you entered is similar to a lambda function but both methods you used to execute the script are correct

Wed, 2011-01-19 06:04
evan

I have copied the code given in the Pyrosetta manual for Monte carlo simulation .. It means that there is some error in the program written there in the manual

Wed, 2011-01-19 16:59
bharat_46010

I am trying to execute the monte carlo simulation tutorial given in pyrosetta manual .. but after execution its giving the following \error..
Non-ASCII character '\x93' in file mc.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details (mc.py, line 2) ...... pls help

Wed, 2011-02-02 20:48
bharat_46010

Poking around the internet says \x93 is a unicode encoding for an accented O. Try replacing it with an O.

Where did mc.py come from? Is it a file or was it cut-and-pasted out of a tutorial PDF? (I know very little about pyrosetta so excuse my ignorance)

Thu, 2011-02-03 07:07
smlewis

Actually I copied it from the pyrosetta pdf tutorial and pasted on note pad and saved it as a python script... After executing it with command run mc.py .. I got the error.... Also I want to know the full detail of pyrosetta package which I think is involved in ROsetta also... Since I don't understand much about this packer and mover stuff .. can u refer me through some good paper to have good grip on pyrosetta ... I tried searching in rosetta manual but there they have not explained that much .. Since I find working with pyrosetta and rosetta interesting I would like to have a grip on it ..

Thu, 2011-02-03 17:24
bharat_46010

I think this error is caused by the cut and paste operation out of the PDF. It's a bizzarre encoding error; there's no reason for the script to have non-ASCII characters, so it's probably an issue with the PDF having strange characters that look like normal characters to the eye.

Try pasting it with a different tool set - do you have something like "paste as plain text"? By "notepad" I assume you're on Windows, try passaging it through Word or something instead of directly into notepad. Or point out to me which PDF (there are at least a dozen...) it was and I'll see if I can attach a functional version for you here.

Fri, 2011-02-04 07:22
smlewis