Skip to content

Commit f4842ba

Browse files
committed
Better error printing for 2D, updated ReadMe
1 parent efad196 commit f4842ba

File tree

6 files changed

+40
-5
lines changed

6 files changed

+40
-5
lines changed

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ Calculate Sterimol parameters<sup>1</sup> (L, Bmin, Bmax), %Buried Volume<sup>2<
2525
* `--noH` - exclude hydrogen atoms from steric measurements
2626
* `--addmetals` - add metals to steric measurements (traditionally metal centers are removed from steric measurements)
2727

28-
### 2-D Graph contribution features
29-
* Compute graph-based steric contributions in layers spanning outward from a reference functional group with the following input options:
28+
### 2-D Graph contribution features (Requires RDKit and Pandas packages to be installed):
29+
* Compute graph-based steric contributions in layers spanning outward from a reference functional group with the following input options:
3030
* `--2d` - Toggle 2D measurements on
3131
* `--fg` - Specify an atom or functional group to use as a reference as a SMILES string
3232
* `--maxpath` - The number of layers to measure. A connectivity matrix is used to compute the shortest path to each atom from the reference functional group.
@@ -153,6 +153,33 @@ A visualization of these parameters can be shown in the program PyMOL using the
153153
4.00 41.61 9.59
154154
```
155155

156+
5. 2D Additive sterics
157+
158+
To calculate 2d graph-based additive sterics, the arguments --2d --fg --maxpath and --2d-type can be used. An input file listing SMILES strings of desired molecule measurements is necessary for calculation. The --fg argument specifies a SMILES string that is common in all provided SMILES inputs to use as a reference point for layer 0. A connectivity matrix will then be used to find atoms 1, 2, 3... N bonds away where N is the max path length specified with the --maxpath argument. One of two types of measurements will be summed at each layer, either Crippen molar refractivities or McGowan volumes, computed for each atom. This can be changed with the --2d-type argument.
159+
160+
```
161+
>>>python -m dbstep examples/smiles.txt --2d --fg "C(O)=O" --maxpath 5 --2d-type mcgowan
162+
```
163+
where smiles.txt looks like:
164+
```
165+
CC(O)=O
166+
CCC(O)=O
167+
CCCC(O)=O
168+
CCCCC(O)=O
169+
CC(C)C(O)=O
170+
CCC(C)C(O)=O
171+
```
172+
The output will then be written to the file "smiles_2d_output.csv" in the format:
173+
|0_mcgowan| 1_mcgowan| 2_mcgowan| 3_mcgowan| 4_mcgowan| Structure|
174+
| ------- | ------- | ------- | ------- | ------- | ------- |
175+
|4.55| 11.68| 0| 0| 0| CC(O)=O|
176+
|4.55| 8.21| 11.68| 0| 0| CCC(O)=O|
177+
|4.55| 8.21| 8.21| 11.68| 0| CCCC(O)=O|
178+
|4.55| 8.21| 8.21| 8.21| 11.68| CCCCC(O)=O|
179+
|4.55| 4.74| 23.36| 0| 0| CC(C)C(O)=O|
180+
|4.55| 4.74| 19.89| 11.68| 0| CCC(C)C(O)=O|
181+
182+
156183
### Acknowledgements
157184

158185
This work is developed by Guilian Luchini and Robert Paton and is supported by the [NSF Center for Computer-Assisted Synthesis](https://ccas.nd.edu/), grant number [CHE-1925607](https://www.nsf.gov/awardsearch/showAward?AWD_ID=1925607&HistoricalAwards=false)

dbstep/Dbstep.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
# for grid sterimol, may be a problem that the value for Bmin slips between grid points to give an unusually low
1010
# add a check/warning for this (warning, Bmin is unusually small)
1111
# shoudn't be smaller than base atom VDW radius
12-
1312

1413
#for debug mode, a grid can be displayed using a pptk 3d graph, install with pip
1514
###############################################################

dbstep/examples/smiles.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CC(O)=O
2+
CCC(O)=O
3+
CCCC(O)=O
4+
CCCCC(O)=O
5+
CC(C)C(O)=O
6+
CCC(C)C(O)=O

dbstep/graph.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ def mol_to_vec(smifile, shared_fg, voltype, max_path_length, verbose=False):
111111
print("Parsing functional group from this structure failed. Skipping this structure")
112112
vec_df.append(pd.Series())
113113
continue
114+
else:
115+
if verbose:
116+
print("Found by parsing functional group as",lower_fg)
114117

115118
base_id = mol.GetSubstructMatch(patt)[0]
116119

meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set name = "dbstep" %}
2-
{% set version = "1.0a0" %}
2+
{% set version = "1.1a0" %}
33

44
package:
55
name: "{{ name|lower }}"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
setup(
1111
name='dbstep',
1212
packages=['dbstep'],
13-
version='1.0-alpha',
13+
version='1.1-alpha',
1414
description='DFT Based Steric Parameters',
1515
long_description=long_description,
1616
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)