0
|
1 <tool id="chemfp_simsearch" name="Similarity Search" version="0.1">
|
|
2 <description>of fingerprint data sets</description>
|
|
3 <!--<parallelism method="multi" split_inputs="query" split_mode="to_size" split_size="10000" shared_inputs="targets,fastsearch" merge_outputs="outfile"></parallelism>-->
|
|
4 <requirements>
|
|
5 <requirement type="package" version="1.1p1">chemfp</requirement>
|
7
|
6 <requirement type="package" version="2.3.2">openbabel</requirement>
|
0
|
7 </requirements>
|
|
8 <command>
|
|
9 #if $method_opts.method_opts_selector == "chemfp":
|
|
10 ## TODO: remove all comment lines, in muti mode many comment lines will be appear, also in the middle of the result file, remove them
|
3
|
11 simsearch -k $method_opts.k --threshold $method_opts.threshold --query-format fps --target-format fps -q "${method_opts.query}" "${method_opts.targets}" -o "${outfile}"
|
0
|
12 #else:
|
|
13 ## OpenBabel needs the original molecule file (molecule.'fileformat') next to the fastsearch index (molecule.fs). We use a composite datatype to accomplish that.
|
|
14 ## Furthermore OpenBabel is really picky with fileextensions. We need to specify every datatype. I did not find a solution to specify the query-filetype.
|
|
15 ## A workaround is to create a symlink with a proper file-extension.
|
|
16 #import tempfile
|
|
17 #set $temp_file = tempfile.NamedTemporaryFile()
|
|
18 #set $temp_link = "%s.%s" % ($temp_file.name, $method_opts.query.ext)
|
|
19 $temp_file.close()
|
|
20 ln -s $method_opts.query $temp_link;
|
|
21 obabel -i fs "${os.path.join($method_opts.fastsearch.extra_files_path,'molecule.fs')}" -S "${temp_link}" -at${method_opts.threshold} -O "${outfile}" -osmi -aa 2>&1;
|
|
22 rm $temp_link
|
|
23 #end if
|
|
24 </command>
|
|
25 <inputs>
|
|
26
|
|
27 <conditional name="method_opts">
|
|
28 <param name="method_opts_selector" type="select" label="Subject database/sequences">
|
|
29 <option value="chemfp">Chemfp fingerprint file</option>
|
|
30 <option value="obabel">OpenBabel Fastsearch Index</option>
|
|
31 </param>
|
|
32 <when value="chemfp">
|
|
33 <param name="query" type='data' format="fps" label="query"/>
|
|
34 <param name="targets" type='data' format="fps" label="Target database"/>
|
|
35 <param name="k" type='text' label="k nearest neighbor" value='all'/>
|
|
36 <param name="threshold" type='float' label="threshold" value='0.7'/>
|
|
37 </when>
|
|
38 <when value="obabel">
|
|
39 <param name="query" type='data' format="smi,mol,sdf,inchi" label="query"/>
|
|
40 <param name="fastsearch" type='data' format="obfs" label="OpenBabel Fastsearch Index"/>
|
|
41 <param name="threshold" type='float' label="threshold" value='0.7'/>
|
|
42 </when>
|
|
43 </conditional>
|
|
44
|
|
45 </inputs>
|
|
46 <outputs>
|
|
47 <data name="outfile" format="tabular" />
|
|
48 </outputs>
|
|
49 <tests>
|
|
50 <test>
|
|
51 <param name="targets" ftype="fps" value="targets.fps"/>
|
|
52 <param name="query" ftype="fps" value="q.fps"/>
|
|
53 <param name="k" value='4'/>
|
|
54 <param name="th" value='0.7'/>
|
|
55 <output name="outfile" ftype="tabular" file="simsearch_on_tragets_and_q.tabular"/>
|
|
56 </test>
|
|
57 </tests>
|
|
58 <help>
|
|
59
|
|
60
|
|
61 **What it does**
|
|
62
|
|
63 similarity search of fingerprint data sets
|
|
64
|
|
65 -----
|
|
66
|
|
67 **Example**
|
|
68
|
|
69 * input::
|
|
70
|
|
71 - Target Database in FPS format
|
|
72
|
|
73 #FPS1
|
|
74 #num_bits=881
|
|
75 #type=CACTVS-E_SCREEN/1.0 extended=2
|
|
76 #software=CACTVS/unknown
|
|
77 #source=Desktop/3579363516810334491.sdf
|
|
78 #date=2012-02-03T13:07:47
|
|
79 07ce04000000000000000000000000000080060000000c000000000000001a800f0000780008100000701487e960
|
|
80 cc0bed3248000580644626004101b4844805901b041c2e19511e45039b8b2926101609401b13e408000000000001
|
|
81 00200000040080000010000002000000000000 55169009
|
|
82 07ce04000000000000000000000000000080060000000c000000000000001a800f0000780008100000701087e960
|
|
83 cc0bed3248000580644626004101b4844805901b041c2e19111e45039b8b2926105609401313e408000000000001
|
|
84 00200000040080000010000002000000000000 55079807
|
|
85 07ce04000000000000000000000000000080060000000c000000000000001a800f0000780008100000b01087e960
|
|
86 cc0bed3248000580644626004101b4844805901b041c2e19511e45039b8b2924101609401b13e408000000000001
|
|
87 00200000040080000010000002000000000000 3153534
|
|
88 07ce0c000000000000000000000000000080060000000c000000000000001a800f0000780008100000103c87e960
|
|
89 cc0bed3248000580644626204101b4844805901b041c2e19511e45039b8b2926101609401b13e408000000000001
|
|
90 00200000040080000010000002000000000000 55168823
|
|
91 07ce05000000000000000000000000000080060000000c000000000000001a800f0000780008100000101087e960
|
|
92 cc0bed3248000580644626204101b4844805901b041c2e19511e45039b8b2924101609401b13e408000000000001
|
|
93 00200000040080000010000002000000000000 55102353
|
|
94 07ce04000000000000000000000000000080060000000c000000000000001a800f0000780008100000b01487e9
|
|
95 60cc0bed3248000580644626204101b4844805901b041c2e19511e45039b8b2924101609401b13e40800003000
|
|
96 000100200000040080000010000002000000000000 55091849
|
|
97 07ce04000000000000000000000000000080060000000c000000000000001a800f0000780008100000103c87e9
|
|
98 60cc0bed3248000580644626204101b4844805901b041c2e19511e45039b8b2924101609401b13e40800000000
|
|
99 000100200000040080000010000002000000000000 55091752
|
|
100 07ce04000000000000000000000000000080060000000c000000000000001a800f0000780008100000b01487e9
|
|
101 60cc0bed3248000580644626204101b4844805901b041c2e19511e45039b8b2924101609401b13e40800001000
|
|
102 000100200000040080000010000002000000000000 55091467
|
|
103 07ce05000000000000000000000000000080060000000c000000000000001a800f0000780008100000101087e9
|
|
104 60cc0bed3248000580644626204101b4844805901b041c2e19511e45039b8b2924101609401b13e40800000000
|
|
105 000100200000040080000010000002000000000000 55091466
|
|
106 07ce05000000000000000000000000000080060000000c000000000000001a800f0000780008100000101087e9
|
|
107 60cc0bed3248000580644626204101b4844805901b041c2e19511e45039b8b2924101609401b13e40800000000
|
|
108 000100200000040080000010000002000000000000 55091416
|
|
109 03ce04000000000000000000000000000080060000000c000000000000001a800f0000780008100000101087e9
|
|
110 60cc0bed3248000580644626004101b4844805901b041c2e19511e45039b8b2924101609401b13e40800000000
|
|
111 000100200000040080000010000002000000000000 6499094
|
|
112 03ce04000000000000000000000000000080060000000c000000000000001a800f0000780008100000101087e9
|
|
113 60cc0bed3248000580644626204101b4844805901b041c2e19511e45039b8b2924101609401b13e40800000000
|
|
114 000100200000040080000010000002000000000000 6485578
|
|
115 07ce04000000000000000000000000000080060000000c000000000000001a800f0000780008100000b01087e9
|
|
116 60cc0bed3248000580644626004101b4844805901b041c2e19511e45039b8b2924101609401b13e40800001000
|
|
117 000100200000040080000010000002000000000000 6485577
|
|
118
|
|
119 - query :
|
|
120 #FPS1
|
|
121 #num_bits=881
|
|
122 #type=CACTVS-E_SCREEN/1.0 extended=2
|
|
123 #software=CACTVS/unknown
|
|
124 #source=CID_28434379.sdf
|
|
125 #date=2012-02-03T13:08:39
|
|
126 07ce04000000000000000000000000000080060000000c060000000000001a800f0000780008100000101487e9
|
|
127 608c0bed3248000580644626204101b4844805901b041c2e19511e45039b8b2924101609401b13e40800000000
|
|
128 000100200000040080000010000002000000000000 28434379
|
|
129 - k : 4
|
|
130 - threshold : 0.7
|
|
131
|
|
132 * output::
|
|
133
|
|
134 #Simsearch/1
|
|
135 #num_bits=881
|
|
136 #type=Tanimoto k=4 threshold=0.7
|
|
137 #software=chemfp/1.0
|
|
138 #queries=q.fps
|
|
139 #targets=target.fps
|
|
140 #query_sources=CID_28434379.sdf
|
|
141 #target_sources=Desktop/3579363516810334491.sdf
|
|
142 4 28434379 55091752 0.9684 55091466 0.9682 55091416 0.9682 55102353 0.9682
|
|
143
|
|
144
|
|
145 </help>
|
|
146 </tool>
|