view muspinsim_plot.xml @ 4:e15e8800c39e draft default tip

planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim_plot commit 70a4d37ecdf5d586703cfc509922311e95d3205c
author muon-spectroscopy-computational-project
date Tue, 18 Jul 2023 13:26:26 +0000
parents d7a0a31760b1
children
line wrap: on
line source

<tool id="muspinsim_plot" name="MuSpinSim Plot" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.05" license="MIT">
    <description>plot values generated from MuSpinSim</description>
    <macros>
        <!-- version of underlying tool (PEP 440) -->
        <token name="@TOOL_VERSION@">3.5.1</token>
        <!-- version of this tool wrapper (integer) -->
        <token name="@WRAPPER_VERSION@">2</token>
        <!-- citation should be updated with every underlying tool version -->
        <!-- typical fields to update are version, month, year, and doi -->
        <token name="@TOOL_CITATION@">10.1109/MCSE.2007.55</token>
        <import>muon_macros.xml</import>
    </macros>
    <creator>
        <person givenName="Anish" familyName="Mudaraddi" identifier="https://orcid.org/0000-0002-2135-2705"/>
        <person givenName="Eli" familyName="Chadwick" url="https://github.com/elichad" identifier="https://orcid.org/0000-0002-0035-6475"/>
        <person givenName="Patrick" familyName="Austin" url="https://github.com/patrick-austin" identifier="https://orcid.org/0000-0002-6279-7823"/>
        <organization url="https://muon-spectroscopy-computational-project.github.io/index.html" name="The Muon Spectroscopy Computational Project"/>
    </creator>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">matplotlib</requirement>
    </requirements>
    <required_files>
        <include type="literal" path="generate_plot.py"/>
    </required_files>
    <command detect_errors="exit_code"><![CDATA[
       python '${__tool_directory__}/generate_plot.py' inputs.json
    ]]></command>
    <configfiles>
        <inputs name="inputs" data_style="paths" filename="inputs.json"/>
    </configfiles>
    <inputs>
        <param type="text" name="title" label="Plot Title" value=""/>
        <param type="text" name="xlab" label="Label for x axis" value=""/>
        <param type="text" name="ylab" label="Label for y axis" value=""/>
        <param name="out_file_type" type="select" label="Output File Type" display="radio">
            <option value="pdf">PDF</option>
            <option value="png">PNG</option>
        </param>
        <repeat name="mu_out_series" title="Muspinsim File Series">
            <param type="data" name="mu_data" format="txt" label="Muspinsim Experiment Data (.dat)"/>
            <param type="text" name="mu_label" optional="true" label="Muspinsim Experiment Label" value="" help="Label to use for this series in the plot legend."/>
            <param type="select" name="colour" label="Line/Point Color">
                <option value="k">Black</option>
                <option value="r">Red</option>
                <option value="g">Green</option>
                <option value="b">Blue</option>
            </param>
            <conditional name="series_type">
                <param type="select" name="type" label="Series Type">
                    <option value="line">Line</option>
                    <option value="points">Points</option>
                </param>
                <when value="line">
                    <param type="select" name="linestyle" label="Line type">
                        <option value="solid">Solid</option>
                        <option value="dashed">Dashed</option>
                        <option value="dotted">Dotted</option>
                    </param>
                    <param type="float" name="linewidth" label="Line width" value="1.0"/>
                </when>
                <when value="points">
                    <param type="select" name="pointstyle" label="Point Type">
                        <option value="s">Square</option>
                        <option value="o">Circle</option>
                    </param>
                    <param type="float" name="pointscale" label="Point Scale" value="1.0"/>
                </when>
            </conditional>
        </repeat>
    </inputs>
    <outputs>
        <data format="pdf" name="out_file_pdf" from_work_dir="outfile.pdf" label="PDF plot on ${on_string}">
            <filter>(out_file_type == 'pdf')</filter>
        </data>
        <data format="png" name="out_file_png" from_work_dir="outfile.png" label="PNG plot on ${on_string}">
            <filter>(out_file_type == 'png')</filter>
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="title" value="Temperature Example"/>
            <param name="xlab" value="Time"/>
            <param name="ylab" value="Asymmetry"/>
            <param name="out_file_type" value="png"/>
            <param name="mu_data" value="high_T.dat" ftype="txt"/>
            <param name="mu_label" value="High T limit"/>
            <param name="type" value="points"/>
            <param name="pointstyle" value="s"/>
            <param name="colour" value="r"/>
            <param name="pointscale" value="2.0"/>
            <param name="mu_data" value="low_T.dat" ftype="txt"/>
            <param name="mu_label" value="T=1 K"/>
            <param name="type" value="line"/>
            <param name="linestyle" value="solid"/>
            <param name="colour" value="k"/>
            <param name="linewidth" value="1.0"/>
            <output name="out_file_png" ftype="png">
                <assert_contents>
                    <has_size value="52486" delta="20"/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <param name="title" value="Fitting Example"/>
            <param name="xlab" value="Time"/>
            <param name="ylab" value="Asymmetry"/>
            <param name="out_file_type" value="pdf"/>
            <param name="mu_data" value="experiment.dat" ftype="txt"/>
            <param name="mu_label" value="Data"/>
            <param name="type" value="points"/>
            <param name="pointstyle" value="o"/>
            <param name="pointscale" value="3.0"/>
            <param name="colour" value="b"/>
            <param name="mu_data" value="fitting.dat" ftype="txt"/>
            <param name="mu_label" value="Fitting"/>
            <param name="type" value="line"/>
            <param name="linestyle" value="solid"/>
            <param name="colour" value="b"/>
            <param name="linewidth" value="1.0"/>
            <output name="out_file_pdf" ftype="pdf">
                <assert_contents>
                    <has_size value="14785" delta="20"/>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
        This tool allows you to plot values generated from muspinsim using Matplotlib.


        You can plot them as points or as lines.


        You can overlay multiple plots on top of each other by providing more than one data file.
    ]]></help>
    <citations>
        <citation type="doi">@TOOL_CITATION@</citation>
        <citation type="doi">@MUSPINSIM_CONCEPT@</citation>
    </citations>
</tool>