Skip to content

Commit

Permalink
Adding Solvent Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mgt16-LANL committed Oct 17, 2024
1 parent 3723cf0 commit 8403c56
Show file tree
Hide file tree
Showing 7 changed files with 2,201 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
*.traj
*__pycache__*
**/.vscode/
meta_production_sample.pkl
meta_production_sample.pkl
development/**/*.csv
development/**/*.mol2
11 changes: 6 additions & 5 deletions architector/complex_construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def complex_driver(inputDict1):
ligandDict = newligDict
else: # Generate from scratch
ligandDict = {} #

coreCoordList = core_geo_class.geometry_dict[coreType]

# Assign con atoms based on all ligands
Expand Down Expand Up @@ -540,7 +540,7 @@ def complex_driver(inputDict1):
out_energies.append(complexClass.calculator.energy)
if inputDict['parameters']['return_only_1']:
break
if not isinstance(complexClass, bool): # Catch cases where no conformation generated.
if not isinstance(complexClass, bool): # Catch cases where no conformation generated.
order = np.argsort(out_energies)
for ind, j in enumerate(order[0:inputDict[
'parameters']['n_conformers']]):
Expand Down Expand Up @@ -585,7 +585,7 @@ def complex_driver(inputDict1):
return conf_dict,inputDict,core_preprocess_time,symmetry_preprocess_time,int_time1
else:
return {},inputDict,0,0,0

def build_complex_driver(inputDict1):
"""build_complex_driver overall driver building of the complex
Expand Down Expand Up @@ -787,12 +787,13 @@ def build_complex(inputDict):
keys.append(key)
vals.append(val)
order = np.argsort(xtb_energies)
for j,i in enumerate(order):
for j, i in enumerate(order):
if tmp_inputDict['parameters']['add_secondary_shell_species'] and \
(j < tmp_inputDict['parameters'][
'secondary_shell_n_conformers']):
if tmp_inputDict['parameters']['debug']:
print('Starting secondary shell addition on {} of {}!'.format(j+1,len(order)))
print('Starting secondary shell addition on {} of {}!'.format(j+1,
len(order)))
print('Normally adds a chunk of time to generation.')
# Use the docking function to add species specified in inputDict/parameters
mol_plus_species, species_list = \
Expand Down
10 changes: 6 additions & 4 deletions architector/io_process_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -1094,12 +1094,13 @@ def inparse(inputDict):
if metal in io_ptable.metal_charge_dict:
outparams['metal_ox'] = io_ptable.metal_charge_dict[metal]
else: # Pull lowest positive "main" oxidation state from mendeleev
elem = mendeleev.__dict__[newinpDict['core']['metal']]
elem = mendeleev.element(newinpDict['core']['metal'])
outparams['metal_ox'] = [x.oxidation_state for x in elem._oxidation_states if (x.category == 'main') and (x.oxidation_state > 0)][0]
if outparams['metal_spin'] is None:
if outparams['metal_ox'] != io_ptable.metal_charge_dict.get(metal,100):
# Calculate from mendeleev reference - Generally aufbau.
outparams['metal_spin'] = mendeleev.__dict__[newinpDict['core']['metal']].ec.ionize(outparams['metal_ox']).unpaired_electrons()
outparams['metal_spin'] = mendeleev.element(
newinpDict['core']['metal']).ec.ionize(outparams['metal_ox']).unpaired_electrons()
else: # Otherwise use refdict.
outparams['metal_spin'] = io_ptable.metal_spin_dict[metal]

Expand Down Expand Up @@ -1434,12 +1435,13 @@ def inparse_2D(inputDict):
if metal in io_ptable.metal_charge_dict:
outparams['metal_ox'] = io_ptable.metal_charge_dict[metal]
else: # Pull lowest positive "main" oxidation state from mendeleev
elem = mendeleev.__dict__[newinpDict['core']['metal']]
elem = mendeleev.element(newinpDict['core']['metal'])
outparams['metal_ox'] = [x.oxidation_state for x in elem._oxidation_states if (x.category == 'main') and (x.oxidation_state > 0)][0]
if outparams['metal_spin'] is None:
if outparams['metal_ox'] != io_ptable.metal_charge_dict.get(metal,100):
# Calculate from mendeleev reference - Generally aufbau.
outparams['metal_spin'] = mendeleev.__dict__[newinpDict['core']['metal']].ec.ionize(outparams['metal_ox']).unpaired_electrons()
outparams['metal_spin'] = mendeleev.element(
newinpDict['core']['metal']).ec.ionize(outparams['metal_ox']).unpaired_electrons()
else: # Otherwise use refdict.
outparams['metal_spin'] = io_ptable.metal_spin_dict[metal]

Expand Down
Loading

0 comments on commit 8403c56

Please sign in to comment.