annotate qed/qed.py @ 2:5f1d98674a21 draft default tip

Uploaded
author bgruening
date Sun, 20 Apr 2014 09:03:37 -0400
parents bb92d30b4f52
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
1 #!/usr/bin/env python
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
2 __all__ = ['weights_max', 'weights_mean', 'weights_none', 'default']
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
3
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
4 # Silicos-it
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
5 from errors import WrongArgument
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
6
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
7 # RDKit
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
8 from rdkit.Chem import Descriptors
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
9 from rdkit import Chem
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
10
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
11 # General
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
12 from copy import deepcopy
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
13 from math import exp, log
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
14 import sys, os, re
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
15 import argparse
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
16
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
17 def check_filetype(filepath):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
18 mol = False
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
19 possible_inchi = True
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
20 for line_counter, line in enumerate(open(filepath)):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
21 if line_counter > 10000:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
22 break
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
23 if line.find('$$$$') != -1:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
24 return 'sdf'
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
25 elif line.find('@<TRIPOS>MOLECULE') != -1:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
26 return 'mol2'
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
27 elif line.find('ligand id') != -1:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
28 return 'drf'
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
29 elif possible_inchi and re.findall('^InChI=', line):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
30 return 'inchi'
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
31 elif re.findall('^M\s+END', line):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
32 mol = True
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
33 # first line is not an InChI, so it can't be an InChI file
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
34 possible_inchi = False
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
35
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
36 if mol:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
37 # END can occures before $$$$, so and SDF file will
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
38 # be recognised as mol, if you not using this hack'
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
39 return 'mol'
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
40 return 'smi'
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
41
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
42 AliphaticRings = Chem.MolFromSmarts('[$([A;R][!a])]')
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
43
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
44 AcceptorSmarts = [
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
45 '[oH0;X2]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
46 '[OH1;X2;v2]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
47 '[OH0;X2;v2]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
48 '[OH0;X1;v2]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
49 '[O-;X1]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
50 '[SH0;X2;v2]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
51 '[SH0;X1;v2]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
52 '[S-;X1]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
53 '[nH0;X2]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
54 '[NH0;X1;v3]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
55 '[$([N;+0;X3;v3]);!$(N[C,S]=O)]'
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
56 ]
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
57 Acceptors = []
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
58 for hba in AcceptorSmarts:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
59 Acceptors.append(Chem.MolFromSmarts(hba))
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
60
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
61 StructuralAlertSmarts = [
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
62 '*1[O,S,N]*1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
63 '[S,C](=[O,S])[F,Br,Cl,I]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
64 '[CX4][Cl,Br,I]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
65 '[C,c]S(=O)(=O)O[C,c]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
66 '[$([CH]),$(CC)]#CC(=O)[C,c]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
67 '[$([CH]),$(CC)]#CC(=O)O[C,c]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
68 'n[OH]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
69 '[$([CH]),$(CC)]#CS(=O)(=O)[C,c]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
70 'C=C(C=O)C=O',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
71 'n1c([F,Cl,Br,I])cccc1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
72 '[CH1](=O)',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
73 '[O,o][O,o]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
74 '[C;!R]=[N;!R]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
75 '[N!R]=[N!R]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
76 '[#6](=O)[#6](=O)',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
77 '[S,s][S,s]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
78 '[N,n][NH2]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
79 'C(=O)N[NH2]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
80 '[C,c]=S',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
81 '[$([CH2]),$([CH][CX4]),$(C([CX4])[CX4])]=[$([CH2]),$([CH][CX4]),$(C([CX4])[CX4])]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
82 'C1(=[O,N])C=CC(=[O,N])C=C1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
83 'C1(=[O,N])C(=[O,N])C=CC=C1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
84 'a21aa3a(aa1aaaa2)aaaa3',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
85 'a31a(a2a(aa1)aaaa2)aaaa3',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
86 'a1aa2a3a(a1)A=AA=A3=AA=A2',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
87 'c1cc([NH2])ccc1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
88 '[Hg,Fe,As,Sb,Zn,Se,se,Te,B,Si,Na,Ca,Ge,Ag,Mg,K,Ba,Sr,Be,Ti,Mo,Mn,Ru,Pd,Ni,Cu,Au,Cd,Al,Ga,Sn,Rh,Tl,Bi,Nb,Li,Pb,Hf,Ho]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
89 'I',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
90 'OS(=O)(=O)[O-]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
91 '[N+](=O)[O-]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
92 'C(=O)N[OH]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
93 'C1NC(=O)NC(=O)1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
94 '[SH]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
95 '[S-]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
96 'c1ccc([Cl,Br,I,F])c([Cl,Br,I,F])c1[Cl,Br,I,F]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
97 'c1cc([Cl,Br,I,F])cc([Cl,Br,I,F])c1[Cl,Br,I,F]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
98 '[CR1]1[CR1][CR1][CR1][CR1][CR1][CR1]1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
99 '[CR1]1[CR1][CR1]cc[CR1][CR1]1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
100 '[CR2]1[CR2][CR2][CR2][CR2][CR2][CR2][CR2]1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
101 '[CR2]1[CR2][CR2]cc[CR2][CR2][CR2]1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
102 '[CH2R2]1N[CH2R2][CH2R2][CH2R2][CH2R2][CH2R2]1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
103 '[CH2R2]1N[CH2R2][CH2R2][CH2R2][CH2R2][CH2R2][CH2R2]1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
104 'C#C',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
105 '[OR2,NR2]@[CR2]@[CR2]@[OR2,NR2]@[CR2]@[CR2]@[OR2,NR2]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
106 '[$([N+R]),$([n+R]),$([N+]=C)][O-]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
107 '[C,c]=N[OH]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
108 '[C,c]=NOC=O',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
109 '[C,c](=O)[CX4,CR0X3,O][C,c](=O)',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
110 'c1ccc2c(c1)ccc(=O)o2',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
111 '[O+,o+,S+,s+]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
112 'N=C=O',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
113 '[NX3,NX4][F,Cl,Br,I]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
114 'c1ccccc1OC(=O)[#6]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
115 '[CR0]=[CR0][CR0]=[CR0]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
116 '[C+,c+,C-,c-]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
117 'N=[N+]=[N-]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
118 'C12C(NC(N1)=O)CSC2',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
119 'c1c([OH])c([OH,NH2,NH])ccc1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
120 'P',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
121 '[N,O,S]C#N',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
122 'C=C=O',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
123 '[Si][F,Cl,Br,I]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
124 '[SX2]O',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
125 '[SiR0,CR0](c1ccccc1)(c2ccccc2)(c3ccccc3)',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
126 'O1CCCCC1OC2CCC3CCCCC3C2',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
127 'N=[CR0][N,n,O,S]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
128 '[cR2]1[cR2][cR2]([Nv3X3,Nv4X4])[cR2][cR2][cR2]1[cR2]2[cR2][cR2][cR2]([Nv3X3,Nv4X4])[cR2][cR2]2',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
129 'C=[C!r]C#N',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
130 '[cR2]1[cR2]c([N+0X3R0,nX3R0])c([N+0X3R0,nX3R0])[cR2][cR2]1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
131 '[cR2]1[cR2]c([N+0X3R0,nX3R0])[cR2]c([N+0X3R0,nX3R0])[cR2]1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
132 '[cR2]1[cR2]c([N+0X3R0,nX3R0])[cR2][cR2]c1([N+0X3R0,nX3R0])',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
133 '[OH]c1ccc([OH,NH2,NH])cc1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
134 'c1ccccc1OC(=O)O',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
135 '[SX2H0][N]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
136 'c12ccccc1(SC(S)=N2)',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
137 'c12ccccc1(SC(=S)N2)',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
138 'c1nnnn1C=O',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
139 's1c(S)nnc1NC=O',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
140 'S1C=CSC1=S',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
141 'C(=O)Onnn',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
142 'OS(=O)(=O)C(F)(F)F',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
143 'N#CC[OH]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
144 'N#CC(=O)',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
145 'S(=O)(=O)C#N',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
146 'N[CH2]C#N',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
147 'C1(=O)NCC1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
148 'S(=O)(=O)[O-,OH]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
149 'NC[F,Cl,Br,I]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
150 'C=[C!r]O',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
151 '[NX2+0]=[O+0]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
152 '[OR0,NR0][OR0,NR0]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
153 'C(=O)O[C,H1].C(=O)O[C,H1].C(=O)O[C,H1]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
154 '[CX2R0][NX3R0]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
155 'c1ccccc1[C;!R]=[C;!R]c2ccccc2',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
156 '[NX3R0,NX4R0,OR0,SX2R0][CX4][NX3R0,NX4R0,OR0,SX2R0]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
157 '[s,S,c,C,n,N,o,O]~[n+,N+](~[s,S,c,C,n,N,o,O])(~[s,S,c,C,n,N,o,O])~[s,S,c,C,n,N,o,O]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
158 '[s,S,c,C,n,N,o,O]~[nX3+,NX3+](~[s,S,c,C,n,N])~[s,S,c,C,n,N]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
159 '[*]=[N+]=[*]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
160 '[SX3](=O)[O-,OH]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
161 'N#N',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
162 'F.F.F.F',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
163 '[R0;D2][R0;D2][R0;D2][R0;D2]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
164 '[cR,CR]~C(=O)NC(=O)~[cR,CR]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
165 'C=!@CC=[O,S]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
166 '[#6,#8,#16][C,c](=O)O[C,c]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
167 'c[C;R0](=[O,S])[C,c]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
168 'c[SX2][C;!R]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
169 'C=C=C',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
170 'c1nc([F,Cl,Br,I,S])ncc1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
171 'c1ncnc([F,Cl,Br,I,S])c1',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
172 'c1nc(c2c(n1)nc(n2)[F,Cl,Br,I])',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
173 '[C,c]S(=O)(=O)c1ccc(cc1)F',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
174 '[15N]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
175 '[13C]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
176 '[18O]',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
177 '[34S]'
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
178 ]
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
179
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
180 StructuralAlerts = []
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
181 for smarts in StructuralAlertSmarts:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
182 StructuralAlerts.append(Chem.MolFromSmarts(smarts))
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
183
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
184
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
185 # ADS parameters for the 8 molecular properties: [row][column]
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
186 # rows[8]: MW, ALOGP, HBA, HBD, PSA, ROTB, AROM, ALERTS
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
187 # columns[7]: A, B, C, D, E, F, DMAX
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
188 # ALOGP parameters from Gregory Gerebtzoff (2012, Roche)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
189 pads1 = [ [2.817065973, 392.5754953, 290.7489764, 2.419764353, 49.22325677, 65.37051707, 104.9805561],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
190 [0.486849448, 186.2293718, 2.066177165, 3.902720615, 1.027025453, 0.913012565, 145.4314800],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
191 [2.948620388, 160.4605972, 3.615294657, 4.435986202, 0.290141953, 1.300669958, 148.7763046],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
192 [1.618662227, 1010.051101, 0.985094388, 0.000000001, 0.713820843, 0.920922555, 258.1632616],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
193 [1.876861559, 125.2232657, 62.90773554, 87.83366614, 12.01999824, 28.51324732, 104.5686167],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
194 [0.010000000, 272.4121427, 2.558379970, 1.565547684, 1.271567166, 2.758063707, 105.4420403],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
195 [3.217788970, 957.7374108, 2.274627939, 0.000000001, 1.317690384, 0.375760881, 312.3372610],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
196 [0.010000000, 1199.094025, -0.09002883, 0.000000001, 0.185904477, 0.875193782, 417.7253140] ]
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
197 # ALOGP parameters from the original publication
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
198 pads2 = [ [2.817065973, 392.5754953, 290.7489764, 2.419764353, 49.22325677, 65.37051707, 104.9805561],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
199 [3.172690585, 137.8624751, 2.534937431, 4.581497897, 0.822739154, 0.576295591, 131.3186604],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
200 [2.948620388, 160.4605972, 3.615294657, 4.435986202, 0.290141953, 1.300669958, 148.7763046],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
201 [1.618662227, 1010.051101, 0.985094388, 0.000000001, 0.713820843, 0.920922555, 258.1632616],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
202 [1.876861559, 125.2232657, 62.90773554, 87.83366614, 12.01999824, 28.51324732, 104.5686167],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
203 [0.010000000, 272.4121427, 2.558379970, 1.565547684, 1.271567166, 2.758063707, 105.4420403],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
204 [3.217788970, 957.7374108, 2.274627939, 0.000000001, 1.317690384, 0.375760881, 312.3372610],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
205 [0.010000000, 1199.094025, -0.09002883, 0.000000001, 0.185904477, 0.875193782, 417.7253140] ]
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
206
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
207 def ads(x, a, b, c, d, e, f, dmax):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
208 return ((a+(b/(1+exp(-1*(x-c+d/2)/e))*(1-1/(1+exp(-1*(x-c-d/2)/f))))) / dmax)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
209
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
210 def properties(mol):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
211 """
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
212 Calculates the properties that are required to calculate the QED descriptor.
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
213 """
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
214 matches = []
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
215 if (mol is None):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
216 raise WrongArgument("properties(mol)", "mol argument is \'None\'")
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
217 x = [0] * 9
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
218 x[0] = Descriptors.MolWt(mol) # MW
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
219 x[1] = Descriptors.MolLogP(mol) # ALOGP
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
220 for hba in Acceptors: # HBA
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
221 if (mol.HasSubstructMatch(hba)):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
222 matches = mol.GetSubstructMatches(hba)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
223 x[2] += len(matches)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
224 x[3] = Descriptors.NumHDonors(mol) # HBD
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
225 x[4] = Descriptors.TPSA(mol) # PSA
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
226 x[5] = Descriptors.NumRotatableBonds(mol) # ROTB
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
227 x[6] = Chem.GetSSSR(Chem.DeleteSubstructs(deepcopy(mol), AliphaticRings)) # AROM
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
228 for alert in StructuralAlerts: # ALERTS
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
229 if (mol.HasSubstructMatch(alert)): x[7] += 1
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
230 ro5_failed = 0
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
231 if x[3] > 5:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
232 ro5_failed += 1 #HBD
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
233 if x[2] > 10:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
234 ro5_failed += 1 #HBA
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
235 if x[0] >= 500:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
236 ro5_failed += 1
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
237 if x[1] > 5:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
238 ro5_failed += 1
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
239 x[8] = ro5_failed
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
240 return x
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
241
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
242
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
243 def qed(w, p, gerebtzoff):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
244 d = [0.00] * 8
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
245 if gerebtzoff:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
246 for i in range(0, 8):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
247 d[i] = ads(p[i], pads1[i][0], pads1[i][1], pads1[i][2], pads1[i][3], pads1[i][4], pads1[i][5], pads1[i][6])
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
248 else:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
249 for i in range(0, 8):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
250 d[i] = ads(p[i], pads2[i][0], pads2[i][1], pads2[i][2], pads2[i][3], pads2[i][4], pads2[i][5], pads2[i][6])
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
251 t = 0.0
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
252 for i in range(0, 8):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
253 t += w[i] * log(d[i])
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
254 return (exp(t / sum(w)))
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
255
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
256
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
257 def weights_max(mol, gerebtzoff = True, props = False):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
258 """
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
259 Calculates the QED descriptor using maximal descriptor weights.
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
260 If props is specified we skip the calculation step and use the props-list of properties.
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
261 """
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
262 if not props:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
263 props = properties(mol)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
264 return qed([0.50, 0.25, 0.00, 0.50, 0.00, 0.50, 0.25, 1.00], props, gerebtzoff)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
265
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
266
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
267 def weights_mean(mol, gerebtzoff = True, props = False):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
268 """
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
269 Calculates the QED descriptor using average descriptor weights.
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
270 If props is specified we skip the calculation step and use the props-list of properties.
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
271 """
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
272 if not props:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
273 props = properties(mol)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
274 return qed([0.66, 0.46, 0.05, 0.61, 0.06, 0.65, 0.48, 0.95], props, gerebtzoff)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
275
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
276
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
277 def weights_none(mol, gerebtzoff = True, props = False):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
278 """
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
279 Calculates the QED descriptor using unit weights.
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
280 If props is specified we skip the calculation step and use the props-list of properties.
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
281 """
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
282 if not props:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
283 props = properties(mol)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
284 return qed([1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00], props, gerebtzoff)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
285
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
286
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
287 def default(mol, gerebtzoff = True):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
288 """
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
289 Calculates the QED descriptor using average descriptor weights and Gregory Gerebtzoff parameters.
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
290 """
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
291 return weights_mean(mol, gerebtzoff)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
292
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
293
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
294 if __name__ == "__main__":
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
295 parser = argparse.ArgumentParser()
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
296 parser.add_argument('-i', '--input',
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
297 required=True,
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
298 help='path to the input file name')
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
299 parser.add_argument("-m", "--method",
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
300 dest="method",
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
301 choices=['max', 'mean', 'unweighted'],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
302 default="mean",
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
303 help="Specify the method you want to use.")
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
304 parser.add_argument("--iformat",
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
305 help="Input format. It must be supported by openbabel.")
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
306 parser.add_argument('-o', '--outfile', type=argparse.FileType('w+'),
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
307 default=sys.stdout,
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
308 help="path to the result file, default it sdtout")
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
309 parser.add_argument("--header", dest="header", action="store_true",
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
310 default=False,
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
311 help="Write header line.")
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
312
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
313
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
314 args = parser.parse_args()
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
315
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
316 # Elucidate filetype and open supplier
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
317 ifile = os.path.abspath(args.input)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
318 if not os.path.isfile(ifile):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
319 print "Error: ", ifile, " is not a file or cannot be found."
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
320 sys.exit(1)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
321 if not os.path.exists(ifile):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
322 print "Error: ", ifile, " does not exist or cannot be found."
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
323 sys.exit(1)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
324 if not os.access(ifile, os.R_OK):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
325 print "Error: ", ifile, " is not readable."
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
326 sys.exit(1)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
327
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
328 if not args.iformat:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
329 # try to guess the filetype
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
330 filetype = check_filetype( ifile )
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
331 else:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
332 filetype = args.iformat # sdf or smi
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
333
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
334
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
335 """
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
336 We want to store the original SMILES in the output. So in case of a SMILES file iterate over the file and convert each line separate.
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
337 """
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
338 if filetype == 'sdf':
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
339 supplier = Chem.SDMolSupplier( ifile )
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
340 # Process file
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
341 if args.header:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
342 args.outfile.write("MW\tALOGP\tHBA\tHBD\tPSA\tROTB\tAROM\tALERTS\tLRo5\tQED\tNAME\n")
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
343 count = 0
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
344 for mol in supplier:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
345 count += 1
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
346 if mol is None:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
347 print "Warning: skipping molecule ", count, " and continuing with next."
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
348 continue
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
349 props = properties(mol)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
350
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
351 if args.method == 'max':
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
352 calc_qed = weights_max(mol, True, props)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
353 elif args.method == 'unweighted':
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
354 calc_qed = weights_none(mol, True, props)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
355 else:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
356 calc_qed = weights_mean(mol, True, props)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
357
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
358 args.outfile.write( "%.2f\t%.3f\t%d\t%d\t%.2f\t%d\t%d\t%d\t%s\t%.3f\t%-s\n" % (
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
359 props[0],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
360 props[1],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
361 props[2],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
362 props[3],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
363 props[4],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
364 props[5],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
365 props[6],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
366 props[7],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
367 props[8],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
368 calc_qed,
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
369 mol.GetProp("_Name"),
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
370 ))
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
371 elif filetype == 'smi':
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
372 supplier = Chem.SmilesMolSupplier( ifile, " \t", 0, 1, False, True )
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
373
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
374 # Process file
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
375 if args.header:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
376 args.outfile.write("MW\tALOGP\tHBA\tHBD\tPSA\tROTB\tAROM\tALERTS\tLRo5\tQED\tNAME\tSMILES\n")
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
377 count = 0
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
378 for line in open(ifile):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
379 tokens = line.strip().split('\t')
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
380 if len(tokens) > 1:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
381 smiles, title = tokens
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
382 else:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
383 smiles = tokens[0]
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
384 title = ''
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
385 mol = Chem.MolFromSmiles(smiles)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
386 count += 1
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
387 if mol is None:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
388 print "Warning: skipping molecule ", count, " and continuing with next."
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
389 continue
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
390 props = properties(mol)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
391
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
392 if args.method == 'max':
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
393 calc_qed = weights_max(mol, True, props)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
394 elif args.method == 'unweighted':
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
395 calc_qed = weights_none(mol, True, props)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
396 else:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
397 calc_qed = weights_mean(mol, True, props)
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
398
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
399 args.outfile.write( "%.2f\t%.3f\t%d\t%d\t%.2f\t%d\t%d\t%d\t%s\t%.3f\t%-s\t%s\n" % (
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
400 props[0],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
401 props[1],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
402 props[2],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
403 props[3],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
404 props[4],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
405 props[5],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
406 props[6],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
407 props[7],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
408 props[8],
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
409 calc_qed,
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
410 title,
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
411 smiles
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
412 ))
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
413 else:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
414 sys.exit("Error: unknown file-type: ", filetype)