Skip to content

Commit 3d89f6e

Browse files
author
ABrethome
committed
Minor updates
- added comments - removed "run log.py" text following recent changes - minor changes to optimisation.py
1 parent 75b64a2 commit 3d89f6e

File tree

8 files changed

+24
-21
lines changed

8 files changed

+24
-21
lines changed

wsterimol/filter_gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Filter impossible structures after being generated via Pymol.
1515
# Plausible structures can be visualized from visualize.py
1616
# Use in Pymol command prompt:
17-
# run log.py
17+
# run wSterimol.py
1818
# run sterimoltools.py
1919
# run setup.py
2020
# run filter_gen.py

wsterimol/filter_opt.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313

1414
# Filter optimised structures generated from Mopac or Gaussian
1515
# Use in Pymol command prompt:
16-
# run log.py
16+
# run wSterimol.py
1717
# run sterimoltools.py
1818
# run setup.py
1919
# run filter_opt.py
2020
# filter_opt (directory, verbose, setup_path)
21-
# example:
22-
2321

2422
def filter_opt(directory = "temp", setup_path = "default", verbose = "False"):
2523
# If the directory exists

wsterimol/generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
# Generate possible conformer structures via Pymol
1313
# Use in Pymol command prompt:
14-
# run log.py
14+
# run wSterimol.py
1515
# run setup.py
1616
# run generate.py
1717
# generate [dihedral 1, .. ], (directory, setup_path, verbose, force)

wsterimol/optimisation.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515
# Optimisation of the structures via Pymol with MOPAC
1616
# Use in Pymol command prompt:
17-
# run log.py
17+
# run wSterimol.py
1818
# run sterimoltools.py
1919
# run setup.py
2020
# run optimisation.py
2121
# optimisation (directory, walltime, verbose, setup_path)
2222
# example: optimisation conformers
2323

24-
def optimisation(directory = "temp", walltime = 300, verbose = "False", setup_path = "default"):
24+
def optimisation(directory = "temp", walltime = 300, verbose = "False", setup_path = "default", silentmode = "True"):
2525
# If the directory exists
2626
if os.path.exists(directory):
2727
# Log generation
@@ -33,6 +33,9 @@ def optimisation(directory = "temp", walltime = 300, verbose = "False", setup_pa
3333
#verbose
3434
if verbose.lower() in ['true', '1', 't', 'y', 'yes']: verbose = True
3535
else: verbose = False
36+
#silentmode
37+
if silentmode.lower() in ['true', '1', 't', 'y', 'yes']: silentmode = True
38+
else: silentmode = False
3639
# Retrieve all the files in the directory
3740
files = [f for f in listdir(directory) if isfile(join(directory, f))]
3841
if len(files) > 0:
@@ -56,7 +59,7 @@ def optimisation(directory = "temp", walltime = 300, verbose = "False", setup_pa
5659
log.write("\n-------------------------\nJob starts [%s]" % join(directory, filename), verbose)
5760
# calculate the energy
5861
startupinfo = None
59-
if platform.system() == "Windows":
62+
if platform.system() == "Windows" and silentmode == True:
6063
# Prevent .exe window from popping up in Windows
6164
startupinfo = subprocess.STARTUPINFO()
6265
startupinfo.dwFlags |= subprocess.STARTF_USESTDHANDLES | subprocess.STARTF_USESHOWWINDOW
@@ -93,7 +96,7 @@ def optimisation(directory = "temp", walltime = 300, verbose = "False", setup_pa
9396
log.write("\n-------------------------\nJob starts [%s]" % join(directory, filename), verbose)
9497
# calculate the energy
9598
startupinfo = None
96-
if platform.system() == "Windows":
99+
if platform.system() == "Windows" and silentmode == True:
97100
# Prevent .exe window from popping up in Windows
98101
startupinfo = subprocess.STARTUPINFO()
99102
startupinfo.dwFlags |= subprocess.STARTF_USESTDHANDLES | subprocess.STARTF_USESHOWWINDOW

wsterimol/prepare_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
# Prepare structures via Pymol for Mopac or Gaussian
1515
# Use in Pymol command prompt:
16-
# run log.py
16+
# run wSterimol.py
1717
# run sterimoltools.py
1818
# run setup.py
1919
# run prepare_file.py

wsterimol/setup.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ class Setup:
77
def __init__(self, log, path = "default", exe = "default"):
88
#default values
99
self.software = "MOPAC" # Mopac by default
10-
self.loaded = True # good by default
11-
self.exe = "C:\PROGRA~1\MOPAC\MOPAC2016.exe" #default install for Mopac in Windows
10+
self.loaded = True # good by default, then might get wrong
11+
self.exe = "C:\PROGRA~1\MOPAC\MOPAC2016.exe" #default install for MOPAC in Windows
1212
self.SE = "PM6-DH2" # default force field
1313
self.charge = "0" # uncharged
1414
self.scf = "" # optimisation
1515
self.rmsd_cutoff = 0.1 # Angstroms
16-
self.memories = "8"
17-
self.procsshared = "8"
16+
self.memories = "8"
17+
self.procsshared = "8"
1818
self.leveloftheory = "wb97xd/6-31g(d)"
1919
self.spin = "1"
2020
self.RJCT = 0.50
21-
self.singlepointcalculation = ""
21+
self.singlepointcalculation = "" #none
2222
self.Temperature = 298
23-
self.energywindow_cutoff = []
23+
self.energywindow_cutoff = [] # none
2424
self.print_cutoff = 5.0
2525
self.angle_count = 5
2626
self.radii = "cpk"
@@ -61,7 +61,7 @@ def __init__(self, log, path = "default", exe = "default"):
6161
log.write("Warning: Specified path to executable doesn't exist. Use setup.ini value.")
6262
if not os.path.exists(config[1]):
6363
self.loaded = False
64-
log.write("Error: Specified path to executable in self.ini doesn't exist. [%s]" % config[1])
64+
log.write("Error: Specified path to executable in setup.ini doesn't exist. [%s]" % config[1])
6565
return
6666
self.exe = config[1]
6767
elif config[0] == "SEMI_EMPIRICAL":

wsterimol/sterimol.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
# Generate the Sterimol parameters from the optimised structures
1818
# Use in Pymol command prompt:
19-
# run log.py
20-
# run sterimoltools.py
19+
# run wSterimol.py
2120
# run setup.py
2221
# run sterimoltools.py
2322
# run sterimol.py

wsterimol/weight.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ def weight(setup_path = "default", verbose = "False"):
106106
output.write("** For non-commercial use only Version %.2f **\n" % version)
107107
output.write("*******************************************************************************\n")
108108
output.write("** Developed by: **\n")
109-
output.write("** Alex Brethome - University of Oxford **\n")
109+
output.write("** Alexandre Brethome - University of Oxford **\n")
110110
output.write("** Robert Paton - Colorado State University (patonlab.com) **\n")
111-
output.write("** If you use wSterimol, please acknowledge: Brethome, A.; Fletcher, S. P.; **\n")
111+
output.write("** If you use wSterimol, please acknowledge:Brethome, A. V.; Fletcher, S. P.;**\n")
112112
output.write("** Paton, R. S. submitted 2018 **\n")
113113
output.write("*******************************************************************************\n")
114114
output.write("** ____ ______ ____ ___ ____ __ ___ ____ __ **\n")
@@ -166,6 +166,9 @@ def weight(setup_path = "default", verbose = "False"):
166166
output.write("** %7.2f %7.2f %7.2f **\n" % (L1_weighted,B1_weighted,B5_weighted))
167167
output.write("** **\n")
168168
output.write("*******************************************************************************\n")
169+
# log update showing results
170+
log.write(" wL (A) wB1 (A) wB5 (A) \n")
171+
log.write(" %7.2f %7.2f %7.2f \n" % (L1_weighted,B1_weighted,B5_weighted))
169172
# calculate min max for each different energy windows
170173
for k in range(len(setup.energywindow_cutoff)):
171174
output.write("\n\n*******************************************************************************\n")

0 commit comments

Comments
 (0)