Commit 66cc3266 authored by Jesse Kaminsky's avatar Jesse Kaminsky

Added documentation and typo fixes

parent 44343163
......@@ -21,9 +21,9 @@ Usage
```
usage: protonate.py [-h] [--min_ph MIN] [--max_ph MAX] [--st_dev STD]
[--smiles SMILES] [--smiles_file SMILES_FILE]
[--output_file OUTPUT_FILE]
[--output_file OUTPUT_FILE] [--label_states]
Protonates small moleucles.
Protonates small molecules.
optional arguments:
-h, --help show this help message and exit
......@@ -35,6 +35,8 @@ optional arguments:
File which contains SMILES strings to protonate.
--output_file OUTPUT_FILE
File to write protonated SMILES. (Optional)
--label_states Label protonated SMILES with target state
("DEPROTONATED", "PROTONATED", or "BOTH").
```
The default pH range is 6.4 to 8.4, considered biologically relevant pH.
......@@ -54,6 +56,10 @@ python protonate.py --smiles "CCC(=O)O" --min_ph -3 --max_ph -2
python protonate.py --smiles "CCCN" --min_ph -3 --max_ph -2 --output_file output.smi
```
```
python protonate.py --smiles_file sample_molecules.smi --st_dev 2.0 --label_states
```
Authors and Contacts
--------------------
......
......@@ -54,14 +54,16 @@ def protonate(args):
# in (not the one it IS in per the SMILES string). It's calculated
# based on the probablistic distributions obtained during training.
sites = get_prot_sites_and_target_states(smi, subs)
states = '\t'.join([x[1] for x in sites])
new_smis = [smi]
for site in sites:
# Make a new smiles with the correct protonation state. Note that
# new_smis is a growing list. This is how multiple protonation
# sites are handled.
new_smis = protonate_site(new_smis, site)
# If the user wants to see the target states, add those
# to the ends of each line.
if args["label_states"]:
states = '\t'.join([x[1] for x in sites])
new_lines = [x + "\t" + tag + "\t" + states for x in new_smis]
else:
new_lines = [x + "\t" + tag for x in new_smis]
......
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