view sort_filter.xml @ 2:4ba7350f00ad draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/rxdock commit 4a2d8ff54cacd0a755154760729058ab3cf28ee1"
author bgruening
date Wed, 03 Jun 2020 12:57:11 -0400
parents 7be0793dd448
children 3e4244e74d41
line wrap: on
line source

<tool id="rxdock_sort_filter" name="SDF sort and filter" version="0.1.5">
    <description>using the sdsort provided with rxDock</description>
    <macros>
        <import>rxdock_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 rxDock suite.
See https://www.rxdock.org for more details about rxDock 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>