Hello, I'm fairly new to modeller, and I'm trying to run a parallel job. I can't seem to get the 'from modeller.parallel import *' line to work. When I input it, no models are created. I have python 3.8 installed, and I'm not sure why it's happening. My script is below.
from modeller import * from modeller.automodel import * from modeller.parallel import *
j= job() j.append(local_slave()) j.append(local_slave()) j.append(local_slave())
log.verbose()
env = environ()
env.io.atom_files_directory = ['.', './template_struc']
# create a subclass of automodel or loopmodel, MyModel. # user can further modify the MyModel class, to override certain routine. class MyModel(automodel): def customised_function(self): pass #code overrides the special_restraints method
#def special_restraints(self, aln):
#code overrides the special_patches method. # e.g. to include the addtional disulfides. #def special_patches(self, aln):
a = MyModel(env, sequence = tarSeq, # alignment file with template codes and target sequence alnfile = 'alignment.ali', # PDB codes of the templates knowns = template) # index of the first model a.starting_model = 1 # index of the last model a.ending_model = 100 loopRefinement = False
# Assesses the quality of models using # the DOPE (Discrete Optimized Protein Energy) method (Shen & Sali 2006) # and the GA341 method (Melo et al 2002, John & Sali 2003) a.assess_methods = (assess.GA341, assess.normalized_dope)
a.use_parallel_job(j) a.make()
I'm still figuring my way out around this. Any help appreciated. Thanks.
On 6/9/20 3:32 PM, Casey Becker via modeller_usage wrote: > I'm fairly new to modeller, and I'm trying to run a parallel job. I > can't seem to get the 'from modeller.parallel import *' line to work. > When I input it, no models are created.
Are you saying that your script works without that one line? I don't see how that could be possible. What error message do you get?
I notice that you are using a custom automodel subclass. If you want to do that you need to put the subclass in a separate file and import it, as Python's pickle module (used to send data between parallel tasks) can't see classes defined in your main script. See https://salilab.org/modeller/9.24/manual/node465.html for an example.
Ben Webb, Modeller Caretaker
participants (2)
-
Casey Becker
-
Modeller Caretaker