Mercurial > repos > bgruening > openbabel
comparison filter/ob_filter.xml @ 0:527ecd2fc500 draft
Uploaded
author | bgruening |
---|---|
date | Thu, 15 Aug 2013 03:25:06 -0400 |
parents | |
children | 125da3a296ca |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:527ecd2fc500 |
---|---|
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 <requirement type="package" version="0.1">cheminfolib</requirement> | |
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> | |
54 <when value="ruleof5" /> | |
55 <when value="LeadLike" /> | |
56 <when value="DrugLike" /> | |
57 <when value="FragmentLike" /> | |
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> | |
70 <!-- Add later, we need to add a new smarts pattern to plugindefines.txt | |
71 <option value="hatoms">Number of heavy atoms</option>--> | |
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> | |
125 <!-- | |
126 Limitation of the test framework: | |
127 https://trello.com/card/disambiguated-conditional-parameters-not-supported-in-unit-tests/506338ce32ae458f6d15e4b3/820 | |
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> | |
136 --> | |
137 </tests> | |
138 <help> | |
139 | |
140 | |
141 .. class:: infomark | |
142 | |
143 **What this tool does** | |
144 | |
145 Filters a library of compounds based on user-defined physico-chemical parameters or predefined options (e.g. Ro5, lead-like properties, etc.). Multiple parameters can be selected for more specific queries. | |
146 | |
147 ----- | |
148 | |
149 .. class:: warningmark | |
150 | |
151 **Hint** | |
152 | |
153 | 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 it's bigger than a SMILES file. | |
154 | | |
155 | For exact matches please use the target value for both minimum and maximum parameters (e.g. a selection of exactly 4 rotatable bonds can be performed by selecting 4 as minimum and maximum value). | |
156 | | |
157 | Selecting the same property multiple times 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). | |
158 | |
159 ----- | |
160 | |
161 .. class:: infomark | |
162 | |
163 **Definition of the pre-defined filtering rules** | |
164 | |
165 **# Lipinski's Rule of Five:** | |
166 =< 5 Hydrogen-bond donor groups | |
167 | |
168 =< 10 Hydrogen-bond acceptor groups | |
169 | |
170 =< 500 Molecular weight | |
171 | |
172 =< 5 octanol/water partition coefficient (log P) | |
173 | |
174 **# Lead Like properties** (Teague, Davis, Leeson, Oprea, Angew Chem Int Ed Engl. 1999 Dec 16;38(24):3743-3748): | |
175 =< 7 rotatable bonds | |
176 | |
177 =< 350 Molecular weight | |
178 | |
179 =< 3.5 octanol/water partition coefficient (log P) | |
180 | |
181 **# Drug Like properties** (Lipinski, J Pharmacol Toxicol Methods. 2000 Jul-Aug;44(1):235-49): | |
182 =< 10 Hydrogen-bond acceptor groups | |
183 | |
184 =< 8 rotatable bonds | |
185 | |
186 150 =< Molecular weight =< 500 | |
187 | |
188 =< 150 Polar Surface Area | |
189 | |
190 =< 5 octanol/water partition coefficient (log P) | |
191 | |
192 **# Fragment Like properties** (Carr RA, Congreve M, Murray CW, Rees DC, Drug Discov Today. 2005 Jul 15;10(14):987): | |
193 =< 5 rotatable bonds | |
194 | |
195 =< 250 Molecular weight | |
196 | |
197 =< 2.5 octanol/water partition coefficient (log P) | |
198 | |
199 ----- | |
200 | |
201 .. class:: infomark | |
202 | |
203 **Input** | |
204 | |
205 | - `SD-Format`_ | |
206 | - `SMILES Format`_ | |
207 | |
208 .. _SD-Format: http://en.wikipedia.org/wiki/Chemical_table_file | |
209 .. _SMILES Format: http://en.wikipedia.org/wiki/Simplified_molecular_input_line_entry_specification | |
210 | |
211 ----- | |
212 | |
213 .. class:: infomark | |
214 | |
215 **Output** | |
216 | |
217 | SDF formatted coordinates of the molecules, with selected properties stored as meta-data for each compound. | |
218 | | |
219 | SMILES, InChI or mol2 formatted files containing the 1D strings or 3D coordinates of each compound. | |
220 | |
221 ----- | |
222 | |
223 .. class:: infomark | |
224 | |
225 **Cite** | |
226 | |
227 N M O'Boyle, C Morley and G R Hutchison - `Pybel: a Python wrapper for the OpenBabel cheminformatics toolkit`_ | |
228 | |
229 .. _`Pybel: a Python wrapper for the OpenBabel cheminformatics toolkit`: http://journal.chemistrycentral.com/content/2/1/5 | |
230 | |
231 N M O'Boyle, M Banck, C A James, C Morley, T Vandermeersch, and G R Hutchison - `Open Babel: An open chemical toolbox.`_ | |
232 | |
233 .. _`Open Babel: An open chemical toolbox.`: http://www.jcheminf.com/content/3/1/33 | |
234 | |
235 `Open Babel`_ | |
236 | |
237 .. _`Open Babel`: http://openbabel.org/wiki/Main_Page | |
238 | |
239 </help> | |
240 </tool> |