Skip to content

Commit

Permalink
update addtoldb (#220)
Browse files Browse the repository at this point in the history
* update addtoldb 

Allows pi-bonded ligands to be added

* fix treatment of  mol2 filesg
  • Loading branch information
dbkchu committed Apr 24, 2024
1 parent 7d96dfb commit f998be6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions molSimplify/Scripts/addtodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ def addtoldb(smimol, sminame, smident, smicat, smigrps, smictg, ffopt, smichg=No
else:
cats = [int(a)-1 for a in ccats]
cs = [str(a) for a in cats]
# allows for pi-bonded ligands to be added
if smident == 1 and len(cs) > 1:
cs.append('pi')
css = ' '.join(cs)
# convert to unicode
smimol = unicodedata.normalize(
Expand Down Expand Up @@ -94,8 +97,9 @@ def addtoldb(smimol, sminame, smident, smicat, smigrps, smictg, ffopt, smichg=No
lig.charge = smichg
# new entry for dictionary
if '.mol' in smimol:
shutil.copy2(smimol, ligands_folder + sminame+'.mol')
snew = str(sminame)+':'+str(sminame)+'.mol,'+str(shortname)+','+str(css)+','+str(grp)+','+str(ffopt)+','+str(lig.charge)
ext = '.' + smimol.split('.')[-1]
shutil.copy2(smimol, ligands_folder + sminame+ ext)
snew = str(sminame)+':'+str(sminame)+ext + ','+str(shortname)+','+str(css)+','+str(grp)+','+str(ffopt)+','+str(lig.charge)
elif '.xyz' in smimol:
shutil.copy2(smimol, ligands_folder + sminame+'.xyz')
snew = str(sminame)+':'+str(sminame)+'.xyz,'+str(shortname)+','+str(css)+','+str(grp)+','+str(ffopt)+','+str(lig.charge)
Expand Down

0 comments on commit f998be6

Please sign in to comment.