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