Hi Ben
First of all I would like to apologise for a so basic question. However, I am not a pyton expert and do not have another one to ask here.
I run the loop.py scritp to generate 200 models.
However, my attempt to rank the models by DOPE score fails.
I am using the script below:
############################################ from modeller import * from modeller.automodel import *
log.verbose() env = environ()
env.io.atom_files_directory = ['.', '../atom_files']
# Read in HETATM records from template PDBs env.io.hetatm = True
# Create a new class based on 'loopmodel' so that we can redefine # select_loop_atoms class MyLoop(loopmodel): # This routine picks the residues to be refined by loop modeling def select_loop_atoms(self): # Two residue ranges (both will be refined simultaneously) return selection(self.residue_range('23:A', '25:A'), self.residue_range('73:A', '75:A'))
m = MyLoop(env, inimodel='Modeloutput23.pdb', sequence='Target1', loop_assess_methods=(assess.DOPE, assess.GA341))
m.loop.starting_model= 1 # index of the first loop model m.loop.ending_model = 200 # index of the last loop model m.loop.md_level = refine.very_fast # loop refinement method
m.make()
# Get a list of all successfully built models from a.outputs ok_models = filter(lambda x: x['failure'] is None, a.outputs)
# Rank the models by DOPE score key = 'DOPE score' ok_models.sort(lambda a,b: cmp(a[key], b[key]))
# Get top model m = ok_models[0]
print "Top model 1: %s (DOPE score %.3f)" % (m['name'], m[key]) m = ok_models[1]
print "Top model 2: %s (DOPE score %.3f)" % (m['name'], m[key]) m = ok_models[2]
print "Top model 3: %s (DOPE score %.3f)" % (m['name'], m[key]) m = ok_models[3]
print "Top model 4: %s (DOPE score %.3f)" % (m['name'], m[key]) m = ok_models[4]
print "Top model 5: %s (DOPE score %.3f)" % (m['name'], m[key])
##############################
I realise that "loop assess methods" could not be the same sintax for "model assess methods", but I do not know how to correct it in the script
Could you give me any help?
Thanks in advance,
Flavio
On 11/22/11 10:28 AM, flavio seixas wrote: > First of all I would like to apologise for a so basic question.
But what is your question?
> However, my attempt to rank the models by DOPE score fails.
What is the failure? Do you get an error message? Without knowing what your problem is, I can only guess at the solution.
> I am using the script below: ... > m.make() > > # Get a list of all successfully built models from a.outputs > ok_models = filter(lambda x: x['failure'] is None, a.outputs)
Since your loopmodel object is called 'm' here, I think you mean m.outputs, not a.outputs. Otherwise, your script looks fine to me.
Ben Webb, Modeller Caretaker
Hi Ben,
Thanks for answer.
I have corrected the script as your suggestion. However, the best models still not be ranked in the log file.
This error appears in the shell:
Traceback (most recent call last): File "loop.py", line 30, in ? ok_models = filter(lambda x: x['failure'] is None, m.outputs) TypeError: iteration over non-sequence
--- On Tue, 11/22/11, Modeller Caretaker modeller-care@salilab.org wrote:
> From: Modeller Caretaker modeller-care@salilab.org > Subject: Re: [modeller_usage] Loop Model ranking > To: "flavio seixas" oivalf_nix@yahoo.com > Cc: "Modeller Usage" modeller_usage@salilab.org > Date: Tuesday, November 22, 2011, 7:06 PM > On 11/22/11 10:28 AM, flavio seixas > wrote: > > First of all I would like to apologise for a so basic > question. > > But what is your question? > > > However, my attempt to rank the models by DOPE score > fails. > > What is the failure? Do you get an error message? Without > knowing what your problem is, I can only guess at the > solution. > > > I am using the script below: > ... > > m.make() > > > > # Get a list of all successfully built models from > a.outputs > > ok_models = filter(lambda x: x['failure'] is None, > a.outputs) > > Since your loopmodel object is called 'm' here, I think you > mean m.outputs, not a.outputs. Otherwise, your script looks > fine to me. > > Ben Webb, Modeller Caretaker > -- modeller-care@salilab.org > http://www.salilab.org/modeller/ > Modeller mail list: http://salilab.org/mailman/listinfo/modeller_usage >
On 11/23/11 3:55 AM, flavio seixas wrote: > This error appears in the shell: > > Traceback (most recent call last): > File "loop.py", line 30, in ? > ok_models = filter(lambda x: x['failure'] is None, m.outputs) > TypeError: iteration over non-sequence
Ah, that's because m.outputs gives you all of the comparative models built in this run. You didn't build any comparative models, hence the error. To get all of the loop models instead, use m.loop.outputs.
Ben Webb, Modeller Caretaker
participants (2)
-
flavio seixas
-
Modeller Caretaker