diff simsearch.xml @ 1:0892f7ced10c draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/simsearch commit d786052cd04f8b25eb4aff80b1b9724f62031b61
author bgruening
date Sat, 20 May 2017 13:06:07 -0400
parents 52e5c0f2907f
children 497254c6c09e
line wrap: on
line diff
--- a/simsearch.xml	Thu Aug 15 03:36:37 2013 -0400
+++ b/simsearch.xml	Sat May 20 13:06:07 2017 -0400
@@ -1,12 +1,18 @@
-<tool id="ctb_simsearch" name="Similarity Search" version="0.1.1">
+<tool id="ctb_simsearch" name="Similarity Search" version="0.2">
     <description>of fingerprint data sets</description>
     <requirements>
         <requirement type="package" version="1.1p1">chemfp</requirement>
-        <requirement type="package" version="2.3.2">openbabel</requirement>
     </requirements>
     <command>
+<![CDATA[
         #if $method_opts.method_opts_selector == "chemfp":
-            simsearch 
+            ln -s '${method_opts.query_opts.targets}' ./targets.fps &&
+
+            #if $method_opts.query_opts.query_opts_selector == "normal":
+                ln -s '${method_opts.query_opts.query}' ./query.fps &&
+            #end if
+
+            simsearch
                 #if int($method_opts.knn) == 0:
                     #set $k = 'all'
                     ## count is only available if k nearest neighbor search is disabled
@@ -15,38 +21,38 @@
                     #set $k = int($method_opts.knn)
                 #end if
 
-                -k $k 
-
+                -k $k
                 --threshold $method_opts.threshold
-                --query-format fps
-                --target-format fps
-                -o "${outfile}"
+                -o ./output.fps
 
                 ## build and search an in-memory data structure (faster for multiple queries)
                 --memory
 
                 #if $method_opts.query_opts.query_opts_selector == "normal":
-                    -q "${method_opts.query_opts.query}"
+                    -q ./query.fps
                 #else:
                     --NxN
                 #end if
 
-                "${method_opts.query_opts.targets}" 
+                ./targets.fps
+                &&
+                mv ./output.fps '${outfile}'
         #else:
             ## OpenBabel needs the original molecule file (molecule.'fileformat') next to the fastsearch index (molecule.fs). We use a composite datatype to accomplish that.
             ## Furthermore OpenBabel is really picky with file extensions. We need to specify every datatype. I did not find a solution to specify the query-filetype.
             ## A workaround is to create a symlink with a proper file-extension.
-            #import tempfile
-            #set $temp_file = tempfile.NamedTemporaryFile()
-            #set $temp_link = "%s.%s" % ($temp_file.name, $method_opts.query.ext)
-            $temp_file.close()
-            ln -s $method_opts.query $temp_link;
-            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>&#38;1;
-            rm $temp_link
+            ln -s '$method_opts.query' ./temp_query.$method_opts.query.ext
+            obabel 
+                -i fs '$method_opts.fastsearch.files_path/molecule.fs'
+                -S ./temp_query.$method_opts.query.ext
+                -at${method_opts.threshold}
+                -O '${outfile}'
+                -osmi
+                -aa
         #end if
+]]>
     </command>
     <inputs>
-
         <conditional name="method_opts">
             <param name="method_opts_selector" type="select" label="Subject database/sequences">
               <option value="chemfp">Chemfp fingerprint file</option>
@@ -93,6 +99,7 @@
         </test>
     </tests>
     <help>
+<![CDATA[
 
 
 .. class:: infomark
@@ -104,18 +111,11 @@
 .. _chemfp: http://chemfp.com/
 .. _FastSearch: http://openbabel.org/wiki/FastSearch
 
------
 
-.. class:: infomark
-
-**Cite**
-
-| The chemfp_ project
-| 
-| N M O'Boyle, M Banck, C A James, C Morley, T Vandermeersch and G R Hutchison - `Open Babel: An open chemical toolbox`_
-
-.. _`Open Babel: An open chemical toolbox`: http://www.jcheminf.com/content/3/1/33
-
-
+]]>
     </help>
+    <citations>
+        <citation type="doi">10.1186/1758-2946-3-33</citation>
+        <citation type="doi">10.1186/1758-2946-5-S1-P36</citation>
+    </citations>
 </tool>