diff sort_filter.xml @ 0:784a9f7f079e draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/rdock commit 9ffbed897a816616ac05c479dcff75103cf9a7e8"
author bgruening
date Tue, 17 Mar 2020 09:27:24 -0400
parents
children a6ec6c55267e
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sort_filter.xml	Tue Mar 17 09:27:24 2020 -0400
@@ -0,0 +1,84 @@
+<tool id="rdock_sort_filter" name="SDF sort and filter" version="0.1.0">
+    <description>using the sdsort provided with rDock</description>
+    <macros>
+        <import>rdock_macros.xml</import>
+    </macros>
+    <expand macro="requirements"/>
+    <command><![CDATA[
+
+sdsort -n $descending -s -f'$sort_field' -id'$name_field' '$input' |
+  sdfilter -f'\$_COUNT <= $top' -s'$name_field' |
+  sdsort -n $descending -f'$sort_field' > '$output'
+
+    ]]></command>
+
+    <inputs>
+        <param type="data" name="input" format="sdf" label="Molecules" help="Molecules in SDF format"/>
+        <param name="top" type="integer" value="1" label="Number of records to keep in output" help="Number of best scoring records to keep"/>
+        <param name="sort_field" type="text" label="Field to sort on" optional="false" help="Name of the field to sort records by">
+            <sanitizer>
+                <valid initial="string.printable">
+                    <remove value="&apos;"/>
+                </valid>
+                <mapping initial="none"/>
+            </sanitizer>
+        </param>
+        <param name="name_field" type="text" label="Grouping field name" optional="false" help="Name of the field to group records by (must be sequential)">
+            <sanitizer>
+                <valid initial="string.printable">
+                    <remove value="&apos;"/>
+                </valid>
+                <mapping initial="none"/>
+            </sanitizer>
+        </param>    
+        <param name="descending" type="boolean" label="Sort descending" truevalue="-r" falsevalue="" checked="true"
+               help="Generate the name field (first line) for cases where this is empty"/>
+    </inputs>
+    <outputs>
+        <data name="output" format="sdf" label="SDF sort+filter on ${on_string}"/>
+    </outputs>
+    <tests>
+        <test>
+            <param name="input" value="poses.sdf"/>
+            <param name="sort_field" value="TransFSScore"/>
+            <param name="name_field" value="Name"/>
+            <output name="output" file="poses-descending.sdf" ftype="sdf" />
+        </test>
+        <test>
+            <param name="input" value="poses.sdf"/>
+            <param name="sort_field" value="TransFSScore"/>
+            <param name="name_field" value="Name"/>
+            <param name="descending" value="False"/>
+            <output name="output" file="poses-ascending.sdf" ftype="sdf" />
+        </test>
+    </tests>
+    <help><![CDATA[
+
+.. class:: infomark
+
+This tool sorts and filters SD files using the sdsort and sdfilter tools from the rDock suite.
+See http://rdock.sourceforge.net/ for more details about rDock and associated programs.
+The expected use is for filtering and sorting virtual screening results such as docking.
+
+-----
+
+.. class:: infomark
+
+**Inputs**
+An SD-file, together with names of fields to sort and group records by, and the number of records to appear in the output.
+The sorting is performed on groups of molecules, with the group being identified by a field in the SDF (the name_field
+parameter). Records from a group MUST be sequential.
+The records within each group are sorted by the value of a field in the SDF (the sort_field parameter) and you can
+specify ascending or descending order (the descending parameter).
+Finally a number of top scoring (the top parameter, typically having a value of 1) are written to the output.
+
+-----
+
+.. class:: infomark
+
+**Outputs**
+An SD-file, containing molecules filtered by the field specified.
+
+    ]]></help>
+    <expand macro="citations"/>
+</tool>