forked from sctincman/oasa
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.py
More file actions
23 lines (19 loc) · 755 Bytes
/
test.py
File metadata and controls
23 lines (19 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from __future__ import print_function
import oasa
#print(oasa.CAIRO_AVAILABLE)
def cairo_out_test2():
mol = oasa.smiles.text_to_mol( "c1ccccc1Cl.c1ccccc1OC.CCCl")
mol.normalize_bond_length( 30)
mol.remove_unimportant_hydrogens()
c = oasa.cairo_out.cairo_out( color_bonds=True, color_atoms=True)
c.show_hydrogens_on_hetero = True
c.font_size = 20
mols = list( mol.get_disconnected_subgraphs())
c.mols_to_cairo( mols, "test.pdf", format="pdf")
c.mols_to_cairo( mols, "test.png")
c.mols_to_cairo( mols, "test.svg", format="svg")
def inchi_test():
mol = oasa.smiles.text_to_mol( "c1ccccc1\C=C/CC")
print(oasa.inchi.mol_to_text(mol, program="stdinchi-1.exe", fixed_hs=False))
cairo_out_test2()
#inchi_test()