view muspinsim_plot.xml @ 3:d7a0a31760b1 draft

planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim_plot commit 4f06b404d8b7fb83995f3052faa7e2ec7811f507
author muon-spectroscopy-computational-project
date Fri, 03 Feb 2023 15:39:12 +0000
parents b53cbb8ad124
children e15e8800c39e
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@">1</token>
        <!-- citation should be updated with every underlying tool version -->
        <!-- typical fields to update are version, month, year, and doi -->
        <token name="@TOOL_CITATION@">
            @article{Hunter:2007,
                author = {Hunter, J. D.},
                title = {Matplotlib: A 2D graphics environment},
                journal = {Computing in Science &amp; Engineering},
                volume = {9},
                number = {3},
                pages = {90--95},
                abstract = {Matplotlib is a 2D graphics package used for Python for
                      application development, interactive scripting, and publication-quality
                      image generation across user interfaces and operating systems.},
                      publisher = {IEEE COMPUTER SOC},
                doi = {10.1109/MCSE.2007.55},
                year = {2007}
            }
        </token>
    </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"/>
        <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">
            <filter>(out_file_type == 'pdf')</filter>
        </data>
        <data format="png" name="out_file_png" from_work_dir="outfile.png">
            <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="bibtex">
            @TOOL_CITATION@
        </citation>
        <citation type="bibtex">
            @software{muspinsim,
                author = {Sturniolo, Simone and Liborio, Leandro and Owen, Josh and Mudaraddi, Anish and {Muon Spectroscopy Computational Project}},
                license = {MIT},
                title = {{muspinsim}},
                url = {https://github.com/muon-spectroscopy-computational-project/muspinsim},
                version = {v1.1.0},
                month = {5},
                year = {2022},
                doi = {10.5281/zenodo.6563074}
            }
        </citation>
    </citations>
</tool>