annotate filter/ob_filter.xml @ 10:cc63a42fd22e

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