[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[modeller_usage] Multiple CPUs



Hello again,

I'm trying to use modeller directly through python's IDLE interface to run a parallel job. I've attached my script and also the python core file that's created up to a point, because it stops before it actually makes the models. Three files with .slave0, .slave1, and .slave2 are created, but when edited with notepad, show an error. I've attached one of them as well. Thanks.


Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> 
= RESTART: C:\Users\cbeck\Desktop\Summer 2020 research\Single script test\multiple CPU\MultipleCPU1.1.py

                         MODELLER 9.24, 2020/04/06, r11614

     PROTEIN STRUCTURE MODELLING BY SATISFACTION OF SPATIAL RESTRAINTS


                     Copyright(c) 1989-2020 Andrej Sali
                            All Rights Reserved

                             Written by A. Sali
                               with help from
              B. Webb, M.S. Madhusudhan, M-Y. Shen, G.Q. Dong,
          M.A. Marti-Renom, N. Eswar, F. Alber, M. Topf, B. Oliva,
             A. Fiser, R. Sanchez, B. Yerkovich, A. Badretdinov,
                     F. Melo, J.P. Overington, E. Feyfant
                 University of California, San Francisco, USA
                    Rockefeller University, New York, USA
                      Harvard University, Cambridge, USA
                   Imperial Cancer Research Fund, London, UK
              Birkbeck College, University of London, London, UK


Kind, OS, HostName, Kernel, Processor: 4, WinNT 10.0 build 18362, DESKTOP-98L3OMD, SMP, unknown
Date and time of compilation         : 2020/04/06 12:03:25
MODELLER executable type             : x86_64-w64
Job starting time (YY/MM/DD HH:MM:SS): 2020/06/30 12:22:12


check_ali___> Checking pairwise structural superpositions. 

Equivalent CA pairs with distance difference larger than  6.0 angstroms:

ALN_POS TMPL1 TMPL2  RID1  RID2  NAM1  NAM2     DIST
----------------------------------------------------
END OF TABLE

check_ali___> Checking the sequence-structure alignment. 

Implied intrachain target CA(i)-CA(i+1) distances longer than  8.0 angstroms:

ALN_POS  TMPL  RID1  RID2  NAM1  NAM2     DIST
----------------------------------------------
END OF TABLE
read_to_681_> topology.submodel read from topology file:        3
mdtrsr__446W> A potential that relies on one protein is used, yet you have at
              least one known structure available. MDT, not library, potential is used.
0 atoms in HETATM/BLK residues constrained
to protein atoms within 2.30 angstroms
and protein CA atoms within 10.00 angstroms
0 atoms in residues without defined topology
constrained to be rigid bodies
condens_443_> Restraints marked for deletion were removed.
              Total number of restraints before, now:    13040    12098
Running 3 tasks on 3 slaves
C:\Users\cbeck\AppData\Local\Programs\Python\Python38\pythonw.exe C:\Program Files\Modeller9.24/bin\modslave.py -slave localhost:14195:0:UCRLOYOU >& MultipleCPU1.1.slave0
C:\Users\cbeck\AppData\Local\Programs\Python\Python38\pythonw.exe C:\Program Files\Modeller9.24/bin\modslave.py -slave localhost:14195:1:LBFKOQIC >& MultipleCPU1.1.slave1
C:\Users\cbeck\AppData\Local\Programs\Python\Python38\pythonw.exe C:\Program Files\Modeller9.24/bin\modslave.py -slave localhost:14195:2:TCSECQYJ >& MultipleCPU1.1.slave2
# --- 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 *



# ---------------------- 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 --------------------------------
j = job(host='localhost')
for i in range(3):
    j.append(local_slave())


# This instructs Modeller to display all log output. 
#log.verbose()

# 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']



# 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 = 3
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)

# ------------------------- build all models --------------------------
a.use_parallel_job(j)

a.make()


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

# Get a list of all successfully built models from a.outputs
if loopRefinement:
	ok_models = filter(lambda x: x['failure'] is None, a.loop.outputs)
else:
	ok_models = filter(lambda x: x['failure'] is None, a.outputs)



# Rank the models by index number
#key = 'num'
#ok_models.sort(lambda c,b: cmp(c[key], b[key]))
#def numSort(c, b, key="num"):
	#return cmp(c[key], b[key])
#ok_models.sort(numSort)


# 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 GA341\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 )

fMoutput.close()


Attachment: MultipleCPU1.1.slave0
Description: Binary data