Skip to content

Commit b7c450c

Browse files
committed
add readme
1 parent 6e37398 commit b7c450c

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

README.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# MolHighlighter
2+
3+
[![Powered by RDKit](https://img.shields.io/badge/Powered%20by-RDKit-3838ff.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEXc3NwUFP8UPP9kZP+MjP+0tP////9ZXZotAAAAAXRSTlMAQObYZgAAAAFiS0dEBmFmuH0AAAAHdElNRQfmAwsPGi+MyC9RAAAAQElEQVQI12NgQABGQUEBMENISUkRLKBsbGwEEhIyBgJFsICLC0iIUdnExcUZwnANQWfApKCK4doRBsKtQFgKAQC5Ww1JEHSEkAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wMy0xMVQxNToyNjo0NyswMDowMDzr2J4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDMtMTFUMTU6MjY6NDcrMDA6MDBNtmAiAAAAAElFTkSuQmCC)](https://www.rdkit.org/)
4+
5+
Fancy colored substructure highlights with labels
6+
7+
<p float="left">
8+
<img alt="Paired highlight of IUPAC name" height="200" src="assets/iupac_highlight.png"/>
9+
<img alt="Paired highlight of SMILES string" height="200" src="assets/smiles_highlight.png"/>
10+
</p>
11+
12+
## 🐍 Installation
13+
14+
```python
15+
pip install git+https://github.com/cbouy/molhighlighter.git
16+
```
17+
18+
## 📜 Usage
19+
20+
### Simple substructure highlight
21+
22+
```python
23+
from rdkit import Chem
24+
from molhighlighter import MH, Highlight
25+
26+
mol = Chem.MolFromSmiles("C1=CC(=CC=C1N=NC2=CC=C(C=C2)Br)O")
27+
28+
highlights = [
29+
Highlight.from_smarts(mol, "c1ccccc1Br", "#93e467", fill_ring=True),
30+
Highlight.from_smarts(mol, "N=N", "#e36262"),
31+
Highlight.from_smarts(mol, "c1ccccc1O", "#62d4e3", True),
32+
]
33+
MH(mol, highlights).display()
34+
```
35+
36+
### Substructure highlight paired with label highlighting
37+
38+
```python
39+
from rdkit import Chem
40+
from molhighlighter import LMH, LabelledHighlight
41+
42+
mol = Chem.MolFromSmiles("C1=CC(=CC=C1N=NC2=CC=C(C=C2)Br)O")
43+
name = "4-[(4-bromophenyl)diazenyl]phenol"
44+
45+
highlights = [
46+
Highlight.from_smarts(mol, "c1ccccc1Br", "#93e467", fill_ring=True),
47+
Highlight.from_smarts(mol, "N=N", "#e36262"),
48+
Highlight.from_smarts(mol, "c1ccccc1O", "#62d4e3", True),
49+
]
50+
LMH(name, mol, highlights).display()
51+
```
52+
53+
See the [demo notebook](demo.ipynb) for more info
54+
55+
## ⚖ License
56+
57+
Unless otherwise noted, all files in this directory and all subdirectories are distributed under the Apache License, Version 2.0:
58+
```text
59+
Copyright 2022 Cédric BOUYSSET
60+
61+
Licensed under the Apache License, Version 2.0 (the "License");
62+
you may not use this file except in compliance with the License.
63+
You may obtain a copy of the License at
64+
65+
http://www.apache.org/licenses/LICENSE-2.0
66+
67+
Unless required by applicable law or agreed to in writing, software
68+
distributed under the License is distributed on an "AS IS" BASIS,
69+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
70+
See the License for the specific language governing permissions and
71+
limitations under the License.
72+
```

assets/iupac_highlight.png

31.9 KB
Loading

assets/smiles_highlight.png

39.5 KB
Loading

0 commit comments

Comments
 (0)