- This topic has 2 replies, 3 voices, and was last updated 10 years, 1 month ago by Anonymous.
October 31, 2013 at 7:35 am #1742Anonymous
I have folder in workspace(domain_name) with subfiles (file_pdb) . I want to run script , where argument is a domain_name, and then the script makes some operations on subfiles. But I get error
Traceback (most recent call last):
“, line 1, in
File “C:Program Files (x86)Python27x32energy_model”, line 58, in results_all_models
results = energy_model(ff)
File “C:Program Files (x86)Python27x32energy_model”, line 8, in energy_model
File “C:Program Files (x86)PyRosettarosetta__init__.py”, line 1131, in exit_callback
I ve checked if file pdb is a full path and it is. I ve chcecke if def energy_model works alone and it is. Whats wrong is here?
from rosetta import *
#result = 
def scorefunction_show(scorefxn, pose):
pose_score = scorefxn(pose) #make sure scores are set
#print ” Scores Weight Raw Score Wghtd.Score”
result = 
for scoretype in scorefxn.get_nonzero_weighted_scoretypes():
#scoretype = core.scoring.ScoreType(i)
if scorefxn.has_nonzero_weight( scoretype ):
weight = scorefxn[ scoretype ];
raw = pose.energies().total_energies()[ scoretype ]
weighted = weight*raw
#print ” %-24s %9.3f” % ( scoretype, weight*raw)
sum_weighted += weight * raw
name_score = name_from_score_type(scoretype)
path = “./”+domain_name
input_files = [f for f in os.listdir(path) if f.endswith(‘.pdb’)]
for i in range(len(input_files)):
filenamein = “‘”+os.getcwd()+”/”+input_files+”‘”
#f = os.path.expanduser(filenamein)
ff = os.path.normpath(filenamein)
results = energy_model(ff)
outfile.write(“Results for model “+filenamein+”:n”)
outfile.write(” %-24s %9.3f”+results)
outfile.write(” Total weighted score: %9.3″+results[i+2])
October 31, 2013 at 3:06 pm #9459Anonymous
Are you getting any additional diagnostic error messages? Often there will be some error or warning from the C++ portion of Rosetta printed prior to the Traceback. (BTW, the forum eats whitespace, so it’s better to post Python scripts as attachments to preserve indentation.)
I suspect that there’s something wrong with one or more of the PDB files you’re trying to load. I’d add a line in energy_model() to print the name of the PDB you’re loading prior to the pose_from_pdb(s) line. Then take a look at the PDB name it prints right before it gives you the traceback. Is it just that one PDB that’s giving you a problem, or is it any PDB you try? Where did you get the PDBs you’re loading from? What do they look like? (If you can post an example here as an attachment, we can take a look at it.)
October 31, 2013 at 3:15 pm #9457Anonymous
It looks like your missing rosetta.init() statement after your import. Your init() is half way through the script. Put it at the beginning after the import statement, and see if it works then.
Also, ‘standard’ is not the right scorefunction. If you are using the newest binaries, the scorefunction should be ‘talaris2013’; if you have an older version, like the windows version, you will want to use ‘standard’ plus the ‘score12’ patch:
score = create_score_function_ws_patch(‘standard’, ‘score12’)
You can also use standard/score12 with the newest binaries, but you must pass the option -restore_pre_talaris_2013_behavior.
See http://www.pyrosetta.org/faq#TOC-1.-How-do-I-interact-with-the-Rosetta-Options-system-using-PyRosetta- for setting options in PyRosetta.
- You must be logged in to reply to this topic.