[Chimera-users] Chimera, Modeller, and socket modules

Casey Becker cbecker11 at mail.csuchico.edu
Mon Aug 31 15:55:33 PDT 2020


I'm attempting to do some loop refinements using Modeller in Chimera while
making use of Modeller's parallel job feature to use multiple CPUs. When I
run the scripts directly through python's IDLE interface, it works.
However, when I attempt to run a custom script including parallel jobs
directly through the Chimera interface, I receive an error stating that I'm
missing a socket module. I've contacted the Modeller help email and they
referred me to you after suggesting I replace the mod9.24.exe with
python.exe in the "Modeller executable," but that didn't work. In fact, it
froze my Chimera. I've attached copies of my scripts and the error I get.
Any assistance appreciated. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20200831/e62b0a06/attachment.html>
-------------- next part --------------
# --- UCSF Chimera Copyright ---
# Copyright (c) 2000 Regents of the University of California.
# All rights reserved.  This software provided pursuant to a
# license agreement containing restrictions on its disclosure,
# duplication and use.  This notice must be embedded in or
# attached to all copies, including partial copies, of the
# software or any revisions or derivations thereof.
# --- UCSF Chimera Copyright ---

# This script is generated by the Modeller Dialog in Chimera, 
# incorporating the settings from the user interface. User can revise 
# this script and submit the modified one into the Advanced Option panel. 

# Import the Modeller module
from modeller import *
from modeller.automodel import *
from modeller.parallel import *
from myloop import MyLoop

# ---------------------- namelist.dat --------------------------------
# A "namelist.dat" file contains the file names, which was output from 
# the Modeller dialog in Chimera based on user's selection.
# The first line it the name of the target sequence, the remaining 
# lines are name of the template structures
namelist = open( 'namelist.dat', 'r' ).read().split('\n')
tarSeq = namelist[0]
template = tuple( [ x.strip() for x in namelist[1:] if x != '' ] )
# ---------------------- namelist.dat --------------------------------
#Run a parallel job on3 CPUs
j = job()

# This instructs Modeller to display all log output. 

# create a new Modeller environment
env = environ()

# Directory of atom/PDB/structure files. It is a relative path, inside 
# a temp folder generated by Chimera. User can modify it and add their 
# absolute path containing the structure files.
env.io.atom_files_directory = ['.', './template_struc']

# Read in HETATM records from template PDBs 
env.io.hetatm = True

# Read in water molecules from template PDBs 
env.io.water = True

a = MyLoop(env,
                sequence = tarSeq,
		# alignment file with template codes and target sequence
		alnfile = 'alignment.ali',
		# PDB codes of the templates
		knowns = template,
                loop_assess_methods = assess.normalized_dope)
# one fixed model to base loops on
a.starting_model = 1
a.ending_model = 1

#Faster refinement at the cost of not as good MD annealing
a.loop.md_level = refine.fast
loopRefinement = True
a.loop.starting_model = 1
# index of the last model
a.loop.ending_model = 10

# 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.normalized_dope)

# ------------------------- build all models --------------------------


# ---------- Accesing output data after modeling is complete ----------

# Get a list of all successfully built models from a.outputs
ok_models = [x for x in a.loop.outputs if x['failure'] is None]

key = 'Normalized DOPE score'
ok_models.sort(key=lambda a: a[key])

# Output the list of ok_models to file ok_models.dat 
fMoutput = open('ok_models.dat', 'w')
fMoutput.write('File name of aligned model\t zDOPE \n')

for m in ok_models:
	results  = '%s\t' % m['name']
	#results += '%.5f\t' % m['GA341 score'][0]
	results += '%.5f\n' % m['Normalized DOPE score']
	fMoutput.write( results )


-------------- next part --------------
# Import the Modeller module
from modeller import *
from modeller.automodel import *

# create a subclass of automodel or loopmodel, MyModel.
# user can further modify the MyModel class, to override certain routine.
class MyLoop(loopmodel):
                def select_loop_atoms(self):
                        return selection(self.residue_range('54:','64:'))
                                        #self.residue_range('77:', '92:'),
		#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):

-------------- next part --------------
A non-text attachment was scrubbed...
Name: reply log
Type: application/octet-stream
Size: 1913 bytes
Desc: not available
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20200831/e62b0a06/attachment.obj>

More information about the Chimera-users mailing list