Skip to content

Commit

Permalink
Add symmetry fixing prototyping.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgt16-LANL committed Aug 21, 2024
1 parent edac426 commit bad76b5
Show file tree
Hide file tree
Showing 7 changed files with 1,066 additions and 480 deletions.
43 changes: 26 additions & 17 deletions architector/complex_construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
class Ligand:
"""Class to contain all information about a ligand including conformers."""

def __init__(self, smiles, ligcoordList, corecoordList, core, ligGeo, ligcharge, ca_metal_dist_constraints,
covrad_metal=None, vdwrad_metal=None, debug=False):
def __init__(self, smiles, ligcoordList, corecoordList, core,
ligGeo, ligcharge, ca_metal_dist_constraints,
covrad_metal=None, vdwrad_metal=None, enforce_symmetry=False,
debug=False):
"""Set up initial variables for ligand and run conformer generation routines.
Parameters
Expand All @@ -50,6 +52,8 @@ def __init__(self, smiles, ligcoordList, corecoordList, core, ligGeo, ligcharge,
Covalent radii of the metal, default values from io_ptable.rcov1
vdwrad_metal : float, optional
VDW radii of the metal, default values from io_ptable.rvdw
enforce_symmetry : bool, optional
Enforce the ligand symmetry elements during conformer generation?
debug: bool, optional
debug turns on/off output text/comments.
"""
Expand All @@ -59,32 +63,35 @@ def __init__(self, smiles, ligcoordList, corecoordList, core, ligGeo, ligcharge,
self.corecoordList = corecoordList
self.metal = core
self.ca_metal_dist_constraints = ca_metal_dist_constraints
self.geo = ligGeo
self.geo = ligGeo
self.BO_dict = None
self.atom_types = None
self.out_ligcoordLists = None
self.charge = ligcharge
self.enforce_symmetry = enforce_symmetry
self.liggen_start_time = time.time()
# Generate conformations
if debug:
print("GENERATING CONFORMATIONS for {}".format(smiles))
conformers, rotscores, tligcoordList, relax, bo_dict, atypes, rotlist = io_lig.find_conformers(self.smiles,
self.ligcoordList,
self.corecoordList,
metal=self.metal,
ligtype=self.geo,
ca_metal_dist_constraints=self.ca_metal_dist_constraints,
covrad_metal=covrad_metal,
vdwrad_metal=vdwrad_metal,
debug=debug
)
conformers, rotscores, tligcoordList, relax, bo_dict, atypes, rotlist = io_lig.find_conformers(
self.smiles,
self.ligcoordList,
self.corecoordList,
metal=self.metal,
ligtype=self.geo,
ca_metal_dist_constraints=self.ca_metal_dist_constraints,
covrad_metal=covrad_metal,
vdwrad_metal=vdwrad_metal,
enforce_symmetry=self.enforce_symmetry,
debug=debug
)
if len(conformers) > 0:
self.conformerList = conformers
self.conformerRotScore = rotscores
self.rotList = rotlist
self.out_ligcoordLists = tligcoordList
self.selectedConformer = self.conformerList[0]
self.exists = True
self.exists = True
self.relax = relax
self.BO_dict = bo_dict
self.atom_types = atypes
Expand Down Expand Up @@ -238,10 +245,10 @@ def compute_conformer_efficacy(self,conformerList,rot_vals,ligand):
elif (not out_eval.successful) and (self.parameters['debug']):
print('Ligand {} failed xtb/uff or overlapped.'.format(i))
return bestConformer, assembled

def final_eval(self, single_point=False):
"""final_eval perform final evaulation of full complex conformer with XTB.
Involves either a relaxation or not for each "sane" conformer.
Parameters
Expand Down Expand Up @@ -366,7 +373,9 @@ def gen_aligned_complex(newLigInputDicts,
lig_ca_metal_dist_constraints,
covrad_metal=inputDict['parameters']['covrad_metal'],
vdwrad_metal=inputDict['parameters']['vdwrad_metal'],
debug=inputDict['parameters']['debug']
enforce_symmetry=inputDict['parameters'].get(
'enforce_ligand_internal_symmetry', False),
debug=inputDict['parameters']['debug'],
)
# Store results
ligandDict[ligid] = ligandClass
Expand Down
2 changes: 1 addition & 1 deletion architector/io_arch_dock.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# e.g. Reduce to allow for closer molecule-species distances
'species_location_method': 'default', # Default attempts a basic colomb repulsion placement, targeted
# Only other option is 'random' at the moment.
'species_add_copies': 1, # Number of species addition orientations to build
'species_add_copies': 1, # Number of species addition orientations to build
'species_method': 'GFN2-xTB', # Method to use on full species - right now only GFN2-xTB really works
'species_relax': True, # Whether or not to relax the generated secondary solvation structures.
'species_intermediate_method': 'GFN-FF', # Method to use for intermediate species screening - Suggested GFN-FF
Expand Down
2 changes: 1 addition & 1 deletion architector/io_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def __init__(self, structure, parameters={}, init_sanity_check=False,
self.detect_spin_charge = detect_spin_charge
if len(parameters) > 0:
for key,val in parameters.items():
setattr(self,key,val)
setattr(self, key, val)
if assembly:
self.init_sanity_check = True
self.relax = False
Expand Down
Loading

0 comments on commit bad76b5

Please sign in to comment.