|
0
|
1 <tool id="ctb_filter" name="Filter" version="1.0">
|
|
|
2 <description> a set of molecules from a file</description>
|
|
|
3 <parallelism method="multi" split_inputs="infile" split_mode="to_size" split_size="10000" shared_inputs="" merge_outputs="outfile"></parallelism>
|
|
|
4 <requirements>
|
|
|
5 <requirement type="package" version="2.3.2">openbabel</requirement>
|
|
|
6 </requirements>
|
|
|
7 <command interpreter="python">
|
|
|
8 ob_filter.py
|
|
|
9 -i "${infile}"
|
|
|
10 -o "${outfile}"
|
|
|
11 -iformat "${infile.ext}"
|
|
|
12 -oformat "${infile.ext}"
|
|
|
13 --filters '{
|
|
|
14 #if $filter_methods.filter_methods_opts == "ruleof5":
|
|
|
15 "hbd" : [0, 5],
|
|
|
16 "hba" : [0, 10],
|
|
|
17 "molwt" : [0, 500],
|
|
|
18 "logp" : [-5, 5],
|
|
|
19 #elif $filter_methods.filter_methods_opts == "LeadLike":
|
|
|
20 "rotbonds" : [0, 7],
|
|
|
21 "molwt" : [0, 350],
|
|
|
22 "logp" : [-5, 3.5],
|
|
|
23 #elif $filter_methods.filter_methods_opts == "DrugLike":
|
|
|
24 "hba" : [0, 10],
|
|
|
25 "rotbonds" : [0, 8],
|
|
|
26 "molwt" : [150, 500],
|
|
|
27 "logp" : [-5, 5],
|
|
|
28 "psa" : [0, 150],
|
|
|
29 #elif $filter_methods.filter_methods_opts == "FragmentLike":
|
|
|
30 "rotbonds" : [0, 5],
|
|
|
31 "molwt" : [0, 250],
|
|
|
32 "logp" : [-5, 2.5],
|
|
|
33 #else:
|
|
|
34 #for $filter in $filter_methods.filter_set:
|
|
|
35 #set $filter_selected = $filter.filter_sel.filter_sel_opts
|
|
|
36 #set $filter_min = $filter_selected + "_min"
|
|
|
37 #set $filter_max = $filter_selected + "_max"
|
|
|
38 "$filter_selected" : [$filter.filter_sel[$filter_min], $filter.filter_sel[$filter_max] ],
|
|
|
39 #end for
|
|
|
40 #end if
|
|
|
41 }'
|
|
|
42 </command>
|
|
|
43 <inputs>
|
|
|
44 <param name="infile" type="data" format="sdf,smi,mol,mol2,cml,inchi" label="Select input file previously created with the 'Compute physico-chemical properties' tool"/>
|
|
|
45 <conditional name="filter_methods">
|
|
|
46 <param name="filter_methods_opts" type="select" label="Select a pre-defined filtering set">
|
|
|
47 <option value="user">User-defined properties</option>
|
|
|
48 <option value="ruleof5">Lipinski's Rule-of-Five</option>
|
|
|
49 <option value="LeadLike">Lead-like properties</option>
|
|
|
50 <option value="DrugLike">Drug-like properties</option>
|
|
|
51 <option value="FragmentLike">Fragment-like properties</option>
|
|
|
52 </param>
|
|
7
|
53 <when value="ruleof5" />
|
|
|
54 <when value="LeadLike" />
|
|
|
55 <when value="DrugLike" />
|
|
|
56 <when value="FragmentLike" />
|
|
0
|
57 <when value="user">
|
|
|
58 <repeat name="filter_set" title="Filters selection">
|
|
|
59 <conditional name="filter_sel">
|
|
|
60 <param name="filter_sel_opts" type="select" label="Select properties to filter">
|
|
|
61 <option value="hbd">Number of Hydrogen-bond donor groups</option>
|
|
|
62 <option value="hba">Number of Hydrogen-bond acceptor groups</option>
|
|
|
63 <option value="psa">Total polar Surface Area</option>
|
|
|
64 <option value="rotbonds">Number of rotatable bonds</option>
|
|
|
65 <option value="molwt">Molecular weight</option>
|
|
|
66 <option value="logp">Predicted value of LogP</option>
|
|
|
67 <option value="mr">Predicted value for the Molecular Refractivity</option>
|
|
|
68 <option value="atoms">Number of atoms</option>
|
|
7
|
69 <!-- Add later, we need to add a new smarts pattern to plugindefines.txt
|
|
|
70 <option value="hatoms">Number of heavy atoms</option>-->
|
|
0
|
71 <!-- We skip that options, for further information please read: http://www.dalkescientific.com/writings/diary/archive/2011/06/04/dealing_with_sssr.html -->
|
|
|
72 <!--<option value="rings">Number of rings</option>-->
|
|
|
73 </param>
|
|
|
74 <when value="hbd">
|
|
|
75 <param name="hbd_min" size="3" type="integer" value="" label="Minimum number of HB donors"/>
|
|
|
76 <param name="hbd_max" size="3" type="integer" value="" label="Maximum number of HB donors"/>
|
|
|
77 </when>
|
|
|
78 <when value="hba">
|
|
|
79 <param name="hba_min" size="3" type="integer" value="" label="Minimum number of HB acceptors"/>
|
|
|
80 <param name="hba_max" size="3" type="integer" value="" label="Maximum number of HB acceptors"/>
|
|
|
81 </when>
|
|
|
82 <when value="psa">
|
|
|
83 <param name="psa_min" size="5" type="integer" value="" label="Minimum threshold for the Total Polar Surface Area"/>
|
|
|
84 <param name="psa_max" size="5" type="integer" value="" label="Maximum threshold for the Total Polar Surface Area"/>
|
|
|
85 </when>
|
|
|
86 <when value="rotbonds">
|
|
|
87 <param name="rotbonds_min" size="3" type="integer" value="" label="Minimum number of rotatable bonds"/>
|
|
|
88 <param name="rotbonds_max" size="3" type="integer" value="" label="Maximum number of rotatable bonds"/>
|
|
|
89 </when>
|
|
|
90 <when value="molwt">
|
|
|
91 <param name="molwt_min" size="5" type="integer" value="" label="Minimum threshold value for the Molecular Weight"/>
|
|
|
92 <param name="molwt_max" size="5" type="integer" value="" label="Maximum threshold value for the Molecular Weight"/>
|
|
|
93 </when>
|
|
|
94 <when value="logp">
|
|
|
95 <param name="logp_min" size="4" type="float" value="" label="Minimum threshold value for the log-P"/>
|
|
|
96 <param name="logp_max" size="4" type="float" value="" label="Maximum threshold value for the log-P"/>
|
|
|
97 </when>
|
|
|
98 <when value="mr">
|
|
|
99 <param name="mr_min" size="4" type="float" value="" label="Minimum threshold value for the Molecular Refractivity"/>
|
|
|
100 <param name="mr_max" size="4" type="float" value="" label="Maximum threshold value for the Molecular Refractivity"/>
|
|
|
101 </when>
|
|
|
102 <when value="atoms">
|
|
|
103 <param name="atoms_min" size="3" type="integer" value="" label="Minimum number of atoms"/>
|
|
|
104 <param name="atoms_max" size="3" type="integer" value="" label="Maximum number of atoms"/>
|
|
|
105 </when>
|
|
|
106 <!--<when value="rings">
|
|
|
107 <param name="rings_min" size="3" type="integer" value="" label="Minimum number of rings"/>
|
|
|
108 <param name="rings_max" size="3" type="integer" value="" label="Maximum number of rings"/>
|
|
|
109 </when>-->
|
|
|
110 </conditional>
|
|
|
111 </repeat>
|
|
|
112 </when>
|
|
|
113 </conditional>
|
|
|
114 </inputs>
|
|
|
115 <outputs>
|
|
|
116 <data format_source="infile" name="outfile" />
|
|
|
117 </outputs>
|
|
|
118 <tests>
|
|
|
119 <test>
|
|
|
120 <param name="infile" ftype="smi" value="CID_2244.smi"/>
|
|
|
121 <param name="filter_methods_opts" value="ruleof5" />
|
|
|
122 <output name="outfile" ftype="smi" file="ob_filter_on_CID2244.smi" />
|
|
|
123 </test>
|
|
7
|
124 <!--
|
|
|
125 Limitation of the test framework:
|
|
|
126 https://trello.com/card/disambiguated-conditional-parameters-not-supported-in-unit-tests/506338ce32ae458f6d15e4b3/820
|
|
0
|
127 <test>
|
|
|
128 <param name="infile" ftype="smi" value="CID_2244.smi"/>
|
|
|
129 <param name="filter_methods_opts" value="user" />
|
|
|
130 <param name="filter_sel_opts" value="hba" />
|
|
|
131 <param name="hbd_min" value="0" />
|
|
|
132 <param name="hbd_max" value="5" />
|
|
|
133 <output name="outfile" ftype="smi" file="ob_filter_on_CID2244_2.smi" />
|
|
|
134 </test>
|
|
7
|
135 -->
|
|
0
|
136 </tests>
|
|
|
137 <help>
|
|
|
138
|
|
|
139
|
|
|
140 **What does this tool do?**
|
|
|
141
|
|
|
142 This tool filters a library of compounds provided by the user, based on a set of physico-chemical user-defined parameters. Multiple parameters can be selected for more specific queries.
|
|
|
143
|
|
|
144 -----
|
|
|
145
|
|
|
146 .. class:: infomark
|
|
|
147
|
|
|
148 **Tip:** If your input file is in SDF format you can use the 'Compute physico-chemical properties' tool to precalulate the properties and use the filter on that precomputed dataset. It should be faster and can be reused but its bigger than a SMILES file.
|
|
|
149
|
|
|
150 **Tip:** for exact matchings please use the target value for both the minimum and maximum parameters (e.g. a selection of EXACTLY 4 rotatable bonds can be performed by selecting 4 minimum and 4 maximum as values for the property).
|
|
|
151
|
|
|
152 **Tip:** selecting multiple times the same property with different parameters will result in querying the largest overlapping subset of values for the parameter (e.g. a selection of between 0 and 3 rotatable bonds plus a selection between 2 and 4 will result in a query for compounds between 2 and 3 rotatable bonds).
|
|
|
153
|
|
|
154 -----
|
|
|
155
|
|
|
156 .. class:: infomark
|
|
|
157
|
|
|
158 **Definition of the pre-defined filtering rules:**
|
|
|
159 **# Lipinski's Rule of Five:**
|
|
|
160 =< 5 Hydrogen-bond donor groups
|
|
|
161
|
|
|
162 =< 10 Hydrogen-bond acceptor groups
|
|
|
163
|
|
|
164 =< 500 Molecular weight
|
|
|
165
|
|
|
166 =< 5 octanol/water partition coefficient (log P)
|
|
|
167
|
|
|
168 **# Lead Like properties** (Teague, Davis, Leeson, Oprea, Angew Chem Int Ed Engl. 1999 Dec 16;38(24):3743-3748):
|
|
|
169 =< 7 rotatable bonds
|
|
|
170
|
|
|
171 =< 350 Molecular weight
|
|
|
172
|
|
|
173 =< 3.5 octanol/water partition coefficient (log P)
|
|
|
174
|
|
|
175 **# Drug Like properties** (Lipinski, J Pharmacol Toxicol Methods. 2000 Jul-Aug;44(1):235-49):
|
|
|
176 =< 10 Hydrogen-bond acceptor groups
|
|
|
177
|
|
|
178 =< 8 rotatable bonds
|
|
|
179
|
|
|
180 150 =< Molecular weight =< 500
|
|
|
181
|
|
|
182 =< 150 Polar Surface Area
|
|
|
183
|
|
|
184 =< 5 octanol/water partition coefficient (log P)
|
|
|
185
|
|
|
186 **# Fragment Like properties** (Carr RA, Congreve M, Murray CW, Rees DC, Drug Discov Today. 2005 Jul 15;10(14):987):
|
|
|
187 =< 5 rotatable bonds
|
|
|
188
|
|
|
189 =< 250 Molecular weight
|
|
|
190
|
|
|
191 =< 2.5 octanol/water partition coefficient (log P)
|
|
|
192
|
|
|
193 -----
|
|
|
194
|
|
|
195 .. class:: infomark
|
|
|
196
|
|
|
197 **Output:** the output formats included in this implementation are:
|
|
|
198
|
|
|
199 # sdf formatted coordinates of the molecules, with selected properties stored as meta-data for each compound.
|
|
|
200
|
|
|
201 # SMILES, InChI or mol2 formatted files containing the 1D strings or 3D coordinates of each compound.
|
|
|
202
|
|
|
203 -----
|
|
|
204
|
|
|
205 **This tool uses Pybel:** N. M. O'Boyle, C. Morley and G. R. Hutchison. Pybel: a Python wrapper for the OpenBabel cheminformatics toolkit Chem. Cent. J. 2008, 2, 5.
|
|
|
206
|
|
|
207 </help>
|
|
|
208 </tool>
|