view export.xml @ 1:a9ab1b0a00dd draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/anndata/ commit 8ef5f7c6f8728608a3f05bb51e11b642b84a05f5"
author iuc
date Wed, 16 Oct 2019 06:27:07 -0400
parents fcb7370e827f
children 8623710d083c
line wrap: on
line source

<tool id="anndata_export" name="Export AnnData" version="@VERSION@+@GALAXY_VERSION@">
    <description>to different formats</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="version_command"/>
    <command detect_errors="exit_code"><![CDATA[
@CMD@
      ]]></command>
    <configfiles>
        <configfile name="script_file"><![CDATA[
@CMD_imports@

adata = ad.read('$input')
#if $output_format == 'loom'
adata.write_loom('anndata.loom')
#else if $output_format == 'tabular'
adata.write_csvs('.', sep="\t", skip_data = False)
#end if
]]></configfile>
    </configfiles>
    <inputs>
        <param name="input" type="data" format="h5ad" label="Annotated data matrix"/>
        <param name="output_format" type="select" label="Format to write the annotated data matrix">
            <option value="loom">loom</option>
            <option value="tabular">Tabular</option>
        </param>
    </inputs>
    <outputs>
        <data name="loom_output" format="loom" from_work_dir="anndata.loom" label="${tool.name} on ${on_string}: Annotated data matrix">
            <filter>output_format == 'loom'</filter>
        </data>
        <data name="tabular_x" format="tabular" from_work_dir="X.csv" label="${tool.name} on ${on_string}: Matrix table (X)">
            <filter>output_format == 'tabular'</filter>
        </data>
        <data name="tabular_obs" format="tabular" from_work_dir="obs.csv" label="${tool.name} on ${on_string}: Key-indexed one-dimensional observations annotation (obs)">
            <filter>output_format == 'tabular'</filter>
        </data>
        <data name="tabular_obsm" format="tabular" from_work_dir="obsm.csv" label="${tool.name} on ${on_string}: Key-indexed multi-dimensional observations annotation (obsm)">
            <filter>output_format == 'tabular'</filter>
        </data>
        <data name="tabular_var" format="tabular" from_work_dir="var.csv" label="${tool.name} on ${on_string}: Key-indexed one-dimensional variables annotation (var)">
            <filter>output_format == 'tabular'</filter>
        </data>
        <data name="tabular_varm" format="tabular" from_work_dir="varm.csv" label="${tool.name} on ${on_string}: Key-indexed multi-dimensional variables annotation (varm)">
            <filter>output_format == 'tabular'</filter>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="input" value="krumsiek11.h5ad"/>
            <param name="output_format" value="loom"/>
            <assert_stdout>
                <has_text_matching expression="adata.write_loom"/>
            </assert_stdout>
            <output name="loom_output" value="export.krumsiek11.loom" ftype="loom" compare="sim_size"/>
        </test>
        <test>
            <param name="input" value="krumsiek11.h5ad"/>
            <param name="output_format" value="tabular"/>
            <assert_stdout>
                <has_text_matching expression="adata.write_csvs"/>
            </assert_stdout>
            <output name="tabular_x" value="export.krumsiek11.X.tabular" ftype="tabular"/>
            <output name="tabular_obs" value="export.krumsiek11.obs.tabular" ftype="tabular"/>
            <output name="tabular_obsm" value="export.krumsiek11.obsm.tabular" ftype="tabular"/>
            <output name="tabular_var" value="export.krumsiek11.var.tabular" ftype="tabular"/>
            <output name="tabular_varm" value="export.krumsiek11.varm.tabular" ftype="tabular"/>
        </test>
    </tests>
    <help><![CDATA[
**What it does**

This tool exports a AnnData dataset to a Loom file 
(`write_loom method <https://anndata.readthedocs.io/en/latest/anndata.AnnData.write_loom.html>`__) 
or a Tabular file (`write_csvs method <https://anndata.readthedocs.io/en/latest/anndata.AnnData.write_csvs.html>`__)

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