Skip to content

Commit a7b8c92

Browse files
authored
Docs on draw_reaction usage (#20)
1 parent 97db233 commit a7b8c92

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ assert valid_mol_eval(valid_completion_smiles, partial_smiles)
113113

114114
### Visualization
115115

116-
If it helps, you can visualize the molecules:
116+
If it helps, you can visualize molecules:
117117

118118
```python
119119
from ether0.data import draw_molecule
@@ -134,6 +134,19 @@ or in your terminal via `chafa valid_molecule.svg`
134134

135135
![valid molecule](docs/assets/valid_molecule.svg)
136136

137+
Similarly, one can visualize reactions:
138+
139+
```python
140+
from ether0.data import draw_reaction
141+
142+
# Source: ether0-benchmark's test split's question 41251b01-7291-56a0-9030-ea51bab03a4c
143+
rxn_smiles = "CC1CNCC1c1nc2c(cnn2C(C)C)c(=O)[nH]1.COc1ccc(C=O)cn1>>"
144+
145+
rxn_text = draw_reaction(rxn_smiles)
146+
with open("reaction.svg", "w") as f:
147+
f.write(rxn_text)
148+
```
149+
137150
### Benchmark
138151

139152
Here is a sample baseline of

0 commit comments

Comments
 (0)