Skip to content

Commit 20fde70

Browse files
committed
Update_solv_workflow
1 parent 8403c56 commit 20fde70

File tree

4 files changed

+1360
-641
lines changed

4 files changed

+1360
-641
lines changed

architector/io_obabel.py

+9-10
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
# Imports
88
import ase
9-
import itertools
109
from ase.io import read
1110
from ase import units
1211
import numpy as np
@@ -20,8 +19,8 @@
2019
from pynauty import Graph as pnGraph
2120
from pynauty import canon_label
2221

23-
# ob.obErrorLog.SetOutputLevel(0) # Set warnings to only critical.
2422
ob.obErrorLog.StopLogging() # Turn off ALL openbabel logging.
23+
# ob.obErrorLog.SetOutputLevel(0) # Set warnings to only critical.
2524

2625
warnings.filterwarnings('ignore') # Supress warnings.
2726

@@ -442,27 +441,27 @@ def generate_obmol_conformers(structure, rmsd_cutoff=0.4, conf_cutoff=3000,
442441
_, anums, graph = get_OBMol_coords_anums_graph(obmol, return_coords=False,
443442
get_types=False)
444443
syms = [io_ptable.elements[x] for x in anums]
445-
act_inds = [i for i,x in enumerate(syms) if x in io_ptable.actinides]
446-
swapped=False
444+
act_inds = [i for i, x in enumerate(syms) if x in io_ptable.actinides]
445+
swapped = False
447446
if len(act_inds) > 0:
448447
an_symbols = [syms[x] for x in act_inds]
449448
ln_symbols = [io_ptable.lanthanides[io_ptable.actinides.index(x)] for x in an_symbols]
450449
j = 0
451450
for i, atom in enumerate(ob.OBMolAtomIter(obmol)):
452451
if i in act_inds:
453452
atom.SetAtomicNum(io_ptable.elements.index(ln_symbols[j]))
454-
j+=1
455-
swapped=True
453+
j += 1
454+
swapped = True
456455
mmff94_ok = check_mmff_okay(obmol)
457456
if mmff94_ok:
458457
FF = ob.OBForceField.FindForceField("MMFF94")
459-
FF.Setup(obmol) # Make sure setup works OK
458+
FF.Setup(obmol) # Make sure setup works OK
460459
else:
461460
FF = ob.OBForceField.FindForceField("UFF")
462-
FF.Setup(obmol) # Make sure setup works OK
461+
FF.Setup(obmol) # Make sure setup works OK
463462
if fix_m_neighbors:
464-
mets = [i for i,x in enumerate(syms) if x in io_ptable.all_metals]
465-
if len(mets) == 1: # Freeze metal and neighbor positions - relax ligands
463+
mets = [i for i, x in enumerate(syms) if x in io_ptable.all_metals]
464+
if len(mets) == 1: # Freeze metal and neighbor positions - relax ligands
466465
frozen_atoms = [mets[0]+1] + (np.nonzero(np.ravel(graph[mets[0]]))[0] + 1).tolist()
467466
constr = ob.OBFFConstraints()
468467
for j in frozen_atoms:

development/solubility_dev/Soldb_workflow_dev.ipynb

+1,337-628
Large diffs are not rendered by default.

development/solubility_dev/gbsa_opt.txt

-2
This file was deleted.

development/solubility_dev/xtb_solvent.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66

77

88
def read_solv_params(file):
9+
"""XTB output parser for solvent parameters
10+
11+
Parameters
12+
----------
13+
file : str
14+
file to load
15+
16+
Returns
17+
-------
18+
outdict : dict
19+
dictionary of output
20+
"""
921
with open(file, "r") as file1:
1022
lines = file1.readlines()
1123
solvent_area_start_key = "generalized Born model for continuum solvation"
@@ -93,7 +105,8 @@ def xtb_solv_params(structure, solvent="water"):
93105
xtbPath, int(mol_charge), int(uhf), solvent
94106
)
95107

96-
sub.run(execStr, shell=True, check=True)
108+
sub.run(execStr, shell=True, check=True,
109+
stderr=sub.DEVNULL, stdout=sub.DEVNULL)
97110

98111
# Read conformers from file
99112
result_dict = read_solv_params("output.xtb")

0 commit comments

Comments
 (0)