forked from martin-sicho/papyrus-scaffold-visualizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample_depiction_smiles.py
25 lines (19 loc) · 1.04 KB
/
example_depiction_smiles.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""
example_depiction_smiles
Created by: Martin Sicho
On: 10.10.22, 16:05
"""
from qsprpred.data.utils.descriptorcalculator import MoleculeDescriptorsCalculator
from qsprpred.data.utils.descriptorsets import FingerprintSet
from qsprpred.data.data import MoleculeTable
from qsprpred.data.utils.scaffolds import BemisMurcko
from scaffviz.clustering.manifold import TSNE
from scaffviz.depiction.plot import Plot
if __name__ == "__main__":
dataset = MoleculeTable.fromSMILES('smiles', ['CN1C2CCC1C(C(C2)OC(=O)C3=CC=CC=C3)C(=O)OC', 'O=C(OCCN(CC)CC)c1ccc(N)cc1', 'CCO'], store_dir='data')
dataset.addProperty("Name", ["cocaine", "procaine", "ethanol"])
desc_calculator = MoleculeDescriptorsCalculator(descsets=[FingerprintSet(fingerprint_type="MorganFP", radius=3, nBits=2048)])
dataset.addDescriptors(desc_calculator, recalculate=True)
dataset.addScaffolds([BemisMurcko(convert_hetero=False)])
plt = Plot(TSNE(perplexity=1))
plt.plot(dataset, recalculate=True, mols_per_scaffold_group=1, title_data="Name",card_data=["Name"], port=9292)