view change_title_to_metadata_value.xml @ 16:a638d8d13bb3 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit d9c51279c061a1da948a2582d5b502ca7573adbf
author bgruening
date Thu, 15 Aug 2024 11:02:57 +0000
parents 3ecaa9634126
children
line wrap: on
line source

<tool id="openbabel_change_title" name="Change title" version="@TOOL_VERSION@+galaxy@GALAXY_VERSION@">
    <description>to metadata value.</description>
    <!--parallelism method="multi" split_inputs="infile" split_mode="to_size" split_size="10000" shared_inputs="" merge_outputs="outfile"></parallelism-->
    <macros>
        <import>macros.xml</import>
        <token name="@GALAXY_VERSION@">0</token>
    </macros>
    <expand macro="requirements"/>
    <command detect_errors="aggressive">
<![CDATA[
        python '$__tool_directory__/change_title_to_metadata_value.py'
            --infile '${infile}'
            --key '${key}'
            --outfile '${outfile}'
            $random
]]>
    </command>
    <inputs>
        <param name="infile" type="data" format="sdf,mol2" label="Compound file" help="Specify a compound file in SDF or MOL2 format."/>
        <param name="key" type="text" format="text" label="Compound identifier encoded in the SD-file." help="Specify the key name of the SDF metadata which contains the molecule identifier (e.g. 'PUBCHEM_SHAPE_VOLUME')"/>
        <param name="random" type="boolean" truevalue="--random" falsevalue="" label="Add a random suffix to the title"
            help="The title will be named like TITLE__xbrsjqssafh2t"/>
    </inputs>
    <outputs>
        <expand macro="output_like_input"/>
    </outputs>
    <tests>
        <test>
            <param name="infile" ftype="sdf" value="CID_3033.sdf"/>
            <param name="key" value="PUBCHEM_SHAPE_VOLUME"/>
            <output name="outfile" ftype="sdf" file="change_title_on_CID_3033.sdf" lines_diff="2"/>
        </test>
        <test>
            <param name="infile" ftype="sdf" value="transfs.sdf"/>
            <param name="key" value="Name"/>
            <param name="random" value="true"/>
            <output name="outfile" ftype="sdf">
                <assert_contents>
                    <has_text_matching expression="NC\(=NO\)NCCc1ccc\(S\(N\)\(=O\)=O\)cc1__(.*){13}" />
                </assert_contents>
            </output>
        </test>
    </tests>
    <help>
<![CDATA[

.. class:: infomark

**What this tool does**

Reassigns the title of a molecule file (SDF or MOL2) to a metadata value of a given ID in the same molecule file. For example, if the metadata identifier chosen is PUBCHEM_SHAPE_VOLUME, then the title of the file (in the first line) will be replaced by the variable listed under PUBCHEM_SHAPE_VOLUME.

-----

.. class:: infomark

**Input**

`SD-file`_ with metadata including the given ID.

.. _SD-file: http://en.wikipedia.org/wiki/Chemical_table_file

-----

.. class:: infomark

**Output**

Same as input, with changed title tag.


]]>
    </help>
    <expand macro="citations"/>
</tool>