Commit 16938776 authored by jspiegel's avatar jspiegel

update gypsum, dimorphite, readme, changelog

parent 4fefbeeb
......@@ -4,15 +4,16 @@ Changes
WIP (4.0.1)
-----------
* Updated
* Updated Gypsum-DL to version 1.1.4.
* Updated Dimorphite-DL to version 1.2.3.
* Revised
`$PATH/autogrow4/accessory_scripts/convert_vina_docked_pdbqt_to_pdbs.py` to
convert files that label atoms as `HETATM`, Previously, this script only
converted atoms that were labeled as `ATOM`.
* Updated
* Revised
`$PATH/autogrow4/autogrow/operators/convert_files/conversion_to_3d.py` to
remove `None` objects which failed to be imported into RDKit. This prevents
the `None` objects from causing errors in `def convert_single_sdf_to_pdb`.
* Updated Gypsum-DL to version 1.1.3.
* Add `raise Exception` in
`$PATH/autogrow4/autogrow/operators/convert_files/conversion_to_3d.py` with
debugging instructions if Gypsum-Dl produced are no SDF files. `raise
......@@ -22,12 +23,16 @@ WIP (4.0.1)
privileges.
* Add `--override_sudo_admin_privelledges` variable for
`$PATH/autogrow4/docker/autogrow_in_docker.py` skip the check for `sudo` and administer
privileges for docker-compatible OS that do not have such permissions.
* Added a AutoGrow4 citation to the print statement and `RunAutogrow.py`.
privileges for docker-compatible OS that do not have such permissions.
* Fix dependency versions installed in `$PATH/autogrow4/docker/Dockerfile`. This
ensures that AutoGrow4 continues to run in Docker even if dependency updates
cause compatibility issues.
* Added a AutoGrow4 citation to the print statement and `$PATH/autogrow4/RunAutogrow.py`.
* Revised `./docker/README.md` to clarify docker use.
* Updated the docker scripts. Bug fixes, added `--rm` to the docker command,
etc.
* Revised `$PATH/autogrow4/autogrow/user_vars.py` to correct minor typos with OS checks.
* Updated `$PATH/autogrow4/README.md` with minor updates and developer notes.
* Added `$PATH/autogrow4/CHANGELOG.md`.
4.0.0
......
......@@ -36,13 +36,13 @@ We strongly recommend running AutoGrow4 via Docker using
## Developer Note
Gypsum-DL is Version 1.1.2 with two `sys.flush()` commands added to the
`Parallelizer.py` script. These minor changes help ensure that print
statements properly output in large MPI runs.
Dimorphite is Version 1.2.2 with the citation print statement commented out.
We commented out the citation to prevent the AutoGrow4 print logs from growing
too large. Please remember to cite Dimorphite-DL: Ropp PJ, Kaminsky JC,
Dimorphite is Version 1.2.3 with the citation print statements silenced.
Please remember to cite Dimorphite-DL: Ropp PJ, Kaminsky JC,
Yablonski S, Durrant JD (2019) Dimorphite-DL: An open-source program for
enumerating the ionization states of drug-like small molecules. J Cheminform
11:14. doi:10.1186/s13321-019-0336-9.
Running AutoGrow4 using Docker uses the most current versions of its dependencies
as of May 2020. These have been tested to be compatible with AutoGrow4. Future
development of AutoGrow4 should test the most current versions of these dependencies
and update `$PATH/docker/Dockerfile` appropriately.
\ No newline at end of file
Changes
=======
1.1.4
-----
* Updated Dimorphite-DL to 1.2.3.
* Added `sys.stdout.flush()` commands to ParallelMPI.run in
`$PATH/gypsum_dl/gypsum_dl/Parallelizer.py`. These should help
to ensure that print statements properly output in large MPI runs.
1.1.3
-----
......
# Gypsum-DL 1.1.3
# Gypsum-DL 1.1.4
Gypsum-DL is a free, open-source program for preparing 3D small-molecule
models. Beyond simply assigning atomic coordinates, Gypsum-DL accounts for
......
Changes
=======
1.2.3
-----
* Updated protonation of nitrogen, oxygen, and sulfur atoms to be compatible
with the latest version of RDKit, which broke backwards compatibility.
* Added "silent" option to suppress all output.
* Added code to suppress unnecessary RDKit warnings.
* Updated copyright to 2020.
1.2.2
-----
......
Dimorphite-DL 1.2.2
Dimorphite-DL 1.2.3
===================
What is it?
......@@ -34,8 +34,8 @@ usage: dimorphite_dl.py [-h] [--min_ph MIN] [--max_ph MAX]
[--smiles_file FILE] [--output_file FILE]
[--label_states] [--test]
Dimorphite 1.2.2: Creates models of appropriately protonated small moleucles.
Apache 2.0 License. Copyright 2018 Jacob D. Durrant.
Dimorphite 1.2.3: Creates models of appropriately protonated small moleucles.
Apache 2.0 License. Copyright 2020 Jacob D. Durrant.
optional arguments:
-h, --help show this help message and exit
......
# Copyright 2018 Jacob D. Durrant
# Copyright 2020 Jacob D. Durrant
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -30,19 +30,25 @@ except ImportError:
# Python3
from io import StringIO
# Always let the user know a help file is available.
# print("\nFor help, use: python dimorphite_dl.py --help")
def print_header():
"""Prints out header information."""
# Always let the user know a help file is available.
print("\nFor help, use: python dimorphite_dl.py --help")
# # And always report citation information.
# print("\nIf you use Dimorphite-DL in your research, please cite:")
# print("Ropp PJ, Kaminsky JC, Yablonski S, Durrant JD (2019) Dimorphite-DL: An")
# print("open-source program for enumerating the ionization states of drug-like small")
# print("molecules. J Cheminform 11:14. doi:10.1186/s13321-019-0336-9.\n")
# And always report citation information.
print("\nIf you use Dimorphite-DL in your research, please cite:")
print("Ropp PJ, Kaminsky JC, Yablonski S, Durrant JD (2019) Dimorphite-DL: An")
print("open-source program for enumerating the ionization states of drug-like small")
print("molecules. J Cheminform 11:14. doi:10.1186/s13321-019-0336-9.\n")
try:
import rdkit
from rdkit import Chem
from rdkit.Chem import AllChem
# Disable the unnecessary RDKit warnings
from rdkit import RDLogger
RDLogger.DisableLog("rdApp.*")
except:
msg = "Dimorphite-DL requires RDKit. See https://www.rdkit.org/"
print(msg)
......@@ -61,6 +67,8 @@ def main(params=None):
parser = ArgParseFuncs.get_args()
args = vars(parser.parse_args())
if not args["silent"]:
print_header()
# Add in any parameters in params.
if params is not None:
......@@ -69,10 +77,11 @@ def main(params=None):
# If being run from the command line, print out all parameters.
if __name__ == "__main__":
print("\nPARAMETERS:\n")
for k in sorted(args.keys()):
print(k.rjust(13) + ": " + str(args[k]))
print("")
if not args["silent"]:
print("\nPARAMETERS:\n")
for k in sorted(args.keys()):
print(k.rjust(13) + ": " + str(args[k]))
print("")
if args["test"]:
# Run tests.
......@@ -137,9 +146,9 @@ class ArgParseFuncs:
:return: A parser object.
"""
parser = MyParser(description="Dimorphite 1.2.2: Creates models of " +
parser = MyParser(description="Dimorphite 1.2.3: Creates models of " +
"appropriately protonated small moleucles. " +
"Apache 2.0 License. Copyright 2018 Jacob D. " +
"Apache 2.0 License. Copyright 2020 Jacob D. " +
"Durrant.")
parser.add_argument('--min_ph', metavar='MIN', type=float, default=6.4,
help='minimum pH to consider (default: 6.4)')
......@@ -158,6 +167,8 @@ class ArgParseFuncs:
parser.add_argument('--label_states', action="store_true",
help='label protonated SMILES with target state ' + \
'(i.e., "DEPROTONATED", "PROTONATED", or "BOTH").')
parser.add_argument('--silent', action="store_true",
help='do not print any messages to the screen')
parser.add_argument('--test', action="store_true",
help='run unit tests (for debugging)')
......@@ -711,6 +722,7 @@ class ProtSubstructFuncs:
"PROTONATED": [0],
"BOTH": [-1, 0]}
charges = state_to_charge[target_prot_state]
# Now make the actual smiles match the target protonation state.
......@@ -740,7 +752,7 @@ class ProtSubstructFuncs:
for charge in charges:
# The charge for Nitrogens is 1 higher than others (i.e.,
# protonated state is positively charged).
nitro_charge = charge + 1
nitrogen_charge = charge + 1
# But there are a few nitrogen moieties where the acidic group is
# the neutral one. Amides are a good example. I gave some thought
......@@ -748,7 +760,7 @@ class ProtSubstructFuncs:
# nitrogen-containing moieties where the acidic group is neutral
# (rather than positively charged) will have "*" in the name.
if "*" in prot_site_name:
nitro_charge = nitro_charge - 1 # Undo what was done previously.
nitrogen_charge = nitrogen_charge - 1 # Undo what was done previously.
for mol in mols:
# Make a copy of the molecule.
......@@ -763,20 +775,46 @@ class ProtSubstructFuncs:
atom = mol_copy.GetAtomWithIdx(idx)
explicit_bond_order_total = sum([b.GetBondTypeAsDouble() for b in atom.GetBonds()])
# Assign the protonation charge, with special care for
# nitrogens
element = atom.GetAtomicNum()
if element == 7:
atom.SetFormalCharge(nitro_charge)
atom.SetFormalCharge(nitrogen_charge)
# Need to figure out how many hydrogens to add.
if nitrogen_charge == 1 and explicit_bond_order_total == 1:
atom.SetNumExplicitHs(3)
elif nitrogen_charge == 1 and explicit_bond_order_total == 2:
atom.SetNumExplicitHs(2)
elif nitrogen_charge == 1 and explicit_bond_order_total == 3:
atom.SetNumExplicitHs(1)
elif nitrogen_charge == 0 and explicit_bond_order_total == 1:
atom.SetNumExplicitHs(2)
elif nitrogen_charge == 0 and explicit_bond_order_total == 2:
atom.SetNumExplicitHs(1)
elif nitrogen_charge == -1 and explicit_bond_order_total == 2:
atom.SetNumExplicitHs(0)
elif nitrogen_charge == -1 and explicit_bond_order_total == 1:
atom.SetNumExplicitHs(1)
#### JDD
else:
atom.SetFormalCharge(charge)
if element == 8 or element == 16: # O and S
if charge == 0 and explicit_bond_order_total == 1:
atom.SetNumExplicitHs(1)
elif charge == -1 and explicit_bond_order_total == 1:
atom.SetNumExplicitHs(0)
# import pdb; pdb.set_trace()
# Deprotonating protonated aromatic nitrogen gives [nH-]. Change this
# to [n-].
if "[nH-]" in Chem.MolToSmiles(mol_copy):
atom.SetNumExplicitHs(0)
mol_copy.UpdatePropertyCache()
mol_copy.UpdatePropertyCache(strict=False)
# prod.UpdatePropertyCache(strict=False)
output.append(mol_copy)
......@@ -925,6 +963,7 @@ class TestFuncs:
args["smiles"] = smi
TestFuncs.test_check(args, [protonated], ["PROTONATED"])
# Test phosphates separately
for smi, protonated, mix, deprotonated, category in smis_phos:
args["smiles"] = smi
TestFuncs.test_check(args, [protonated], ["PROTONATED"])
......
......@@ -15,7 +15,7 @@
# limitations under the License.
"""
Gypsum-DL 1.1.3 is a conversion script to transform smiles strings and 2D SDFs
Gypsum-DL 1.1.4 is a conversion script to transform smiles strings and 2D SDFs
into 3D models.
"""
......@@ -73,7 +73,7 @@ from gypsum_dl import Utils
PARSER = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description="""
Gypsum-DL 1.1.3, a free, open-source program for preparing 3D small-molecule
Gypsum-DL 1.1.4, a free, open-source program for preparing 3D small-molecule
models. Beyond simply assigning atomic coordinates, Gypsum-DL accounts for
alternate ionization, tautomeric, chiral, cis/trans isomeric, and
ring-conformational forms.""",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment