view ob_depiction_svg.xml @ 15:75ee9c410951 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:03 +0000
parents d3b48303045b
children
line wrap: on
line source

<tool id="openbabel_svg_depiction" name="Visualisation" version="@TOOL_VERSION@+galaxy@GALAXY_VERSION@">
    <description>of compounds</description>
    <macros>
        <import>macros.xml</import>
        <token name="@GALAXY_VERSION@">1</token>
    </macros>
    <expand macro="requirements"/>
    <command detect_errors="aggressive">
<![CDATA[
    obabel
        -i${infile.ext}
        "${infile}"
        $embed_molecule_as_cml
        $draw_all_carbon_atoms
        -xC
        -O
        "${outfile}"
        -o$oformat
        #if $sort:
            --sort $sort
        #end if
        #if str($display_name) != "None" and len(str($display_name)) > 0 and str($display_name) != 'title':
            --append "$display_name"
            --title ""
        #end if
        $thick_lines
    2>&1
]]>
    </command>
    <inputs>
        <expand macro="infile_all_types"/>
        <param name="embed_molecule_as_cml" type="boolean" truevalue="-e" falsevalue="" label="Embed molecule as CML"/>
        <param name="draw_all_carbon_atoms" type="boolean" truevalue="-a" falsevalue="" label="Draw all carbon atoms"/>
        <param name="thick_lines" type="boolean" truevalue="-xt" falsevalue="" label="Use thicker lines"/>

        <param name='display_name' type='select' format='text' label="Property to display under the molecule">
            <option value='title'>Molecule title</option>
            <option value='MW'>Molecular weight</option>
            <option value='abonds'>Number of aromatic bonds</option>
            <option value='atoms'>Number of atoms</option>
            <option value='bonds'>Number of bonds</option>
            <option value='cansmi'>Canonical SMILES</option>
            <option value='cansmiNS'>Canonical SMILES without isotopes or stereo</option>
            <option value='dbonds'>Number of double bonds</option>
            <option value='formula'>Chemical formula</option>
            <option value='HBA1'>Number of hydrogen bond acceptors (JoelLib 1)</option>
            <option value='HBD'>Number of hydrogen bond donors (JoelLib)</option>
            <option value='InChI'>IUPAC InChI identifier</option>
            <option value='L5'>Lipinski Rule of Five</option>
            <option value='logP'>Octanol/water partition coefficient</option>
            <option value='MR'>Molar refractivity</option>
            <option value='nF'>Number of fluorine atoms</option>
            <option value='sbonds'>Number of single bonds</option>
            <option value='smarts'>SMARTS filter</option>
            <option value='tbonds'>Number of triple bonds</option>
            <option value='TPSA'>topological polar surface area</option>
        </param>

        <param name='sort' type='select' format='text' optional="True" label="Sort the displayed molecules (if input contains more than one) by">
            <option value='MW'>Molecular weight</option>
            <option value='abonds'>Number of aromatic bonds</option>
            <option value='atoms'>Number of atoms</option>
            <option value='bonds'>Number of bonds</option>
            <option value='dbonds'>Number of double bonds</option>
            <option value='HBA1'>Number of hydrogen bond acceptors (JoelLib 1)</option>
            <option value='HBD'>Number of hydrogen bond donors (JoelLib)</option>
            <option value='L5'>Lipinski Rule of Five</option>
            <option value='logP'>Octanol/water partition coefficient</option>
            <option value='MR'>Molar refractivity</option>
            <option value='nF'>Number of fluorine atoms</option>
            <option value='sbonds'>Number of single bonds</option>
            <option value='tbonds'>Number of triple bonds</option>
            <option value='TPSA'>Topological polar surface area</option>
        </param>

        <param name='oformat' type='select' format='text' label="Format of the resulting picture">
            <option value='svg'>SVG</option>
            <option value='png'>PNG</option>
        </param>

    </inputs>
    <outputs>
        <data name="outfile" format="png" label="${tool.name} on ${on_string}">
            <change_format>
                <when input="oformat" value="svg" format="svg"/>
            </change_format>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="infile" ftype="smi" value="8_mol.smi" />
            <param name="embed_molecule_as_cml" value="False" />
            <param name="draw_all_carbon_atoms" value="True" />
            <param name="thick_lines" value="True" />
            <param name='display_name' value="title" />
            <output name="outfile" ftype="svg" file="ob_depiction_svg_on_8_mol.svg" lines_diff="100" />
        </test>
    </tests>
    <help>
<![CDATA[

.. class:: infomark

**What this tool does**

Creates an SVG or PNG image of a small set of molecules (not more than a few hundred). Based on Open Babel PNG_/SVG_ 2D depiction. Note that PNG is a poor choice for representing more than one molecule, as resolution will be low.

.. _PNG: https://open-babel.readthedocs.io/en/latest/FileFormats/PNG_2D_depiction.html
.. _SVG: https://open-babel.readthedocs.io/en/latest/FileFormats/SVG_2D_depiction.html

-----

.. class:: warningmark

**Hint**

Use only libraries with at most a few hundred molecules.


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