view scanpy-run-fdg.xml @ 3:d929261bc28c draft

planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/tree/develop/tools/tertiary-analysis/scanpy commit 1d069e25584e436d7628694cb8853a15f1f85604
author ebi-gxa
date Wed, 20 Nov 2019 05:16:04 -0500
parents 96af0059b974
children 5fb11df8f217
line wrap: on
line source

<?xml version="1.0" encoding="utf-8"?>
<tool id="scanpy_run_fdg" name="Scanpy RunFDG" version="@TOOL_VERSION@+galaxy0">
  <description>visualise cell clusters using force-directed graph</description>
  <macros>
    <import>scanpy_macros2.xml</import>
  </macros>
  <expand macro="requirements"/>
  <command detect_errors="exit_code"><![CDATA[
ln -s '${input_obj_file}' input.h5 &&
PYTHONIOENCODING=utf-8 scanpy-cli embed fdg
    --use-graph '${use_graph}'
    --key-added '${key_added}'
#if $embeddings
    --export-embedding embeddings.csv
#end if
#if $settings.default == "false"
    --random-state ${settings.random_seed}
    --layout ${settings.layout}
    #if $settings.init_pos
        --init-pos '${settings.init_pos}'
    #end if
#end if
    @INPUT_OPTS@
    @OUTPUT_OPTS@

]]></command>

  <inputs>
    <expand macro="input_object_params"/>
    <expand macro="output_object_params"/>
    <param name="embeddings" type="boolean" checked="true" label="Output embeddings in csv format"/>
    <param name="use_graph" argument="--use-graph" value="neighbors" type="text"
           label="Name of the slot that holds the KNN graph"/>
    <param name="key_added" argument="--key-added" type="text" optional="true"
           label="Additional suffix to the name of the slot to save the embedding"/>

    <conditional name="settings">
      <param name="default" type="boolean" checked="true" label="Use programme defaults"/>
      <when value="true"/>
      <when value="false">
        <param name="init_pos" argument="--init-pos" type="text" label="Method to initialise embedding, any key for adata.obsm or choose from the preset methods">
          <option value="paga">paga</option>
        </param>
        <param name="layout" argument="--layout" type="select" label="Graph layout">
          <option value="fa" selected="true">fa</option>
          <option value="fr">fr</option>
          <option value="grid_fr">grid fr</option>
        </param>
        <param name="random_seed" argument="--random-state" type="integer" value="0" label="Seed for numpy random number generator"/>
      </when>
    </conditional>
  </inputs>

  <outputs>
    <data name="output_h5" format="h5" from_work_dir="output.h5" label="${tool.name} on ${on_string}: FDG object"/>
    <data name="output_embed" format="csv" from_work_dir="embeddings.csv" label="${tool.name} on ${on_string}: FDG embeddings">
      <filter>embeddings</filter>
    </data>
  </outputs>

  <tests>
    <test>
      <param name="input_obj_file" value="find_cluster.h5"/>
      <param name="input_format" value="anndata"/>
      <param name="output_format" value="anndata"/>
      <param name="default" value="false"/>
      <param name="embeddings" value="true"/>
      <param name="random_seed" value="0"/>
      <output name="output_h5" file="run_fdg.h5" ftype="h5" compare="sim_size"/>
      <output name="output_embed" file="run_fdg.embeddings.csv" ftype="csv" compare="sim_size">
        <assert_contents>
          <has_n_columns n="2" sep=","/>
        </assert_contents>
      </output>
    </test>
  </tests>

  <help><![CDATA[
================================================================================
Embed the neighborhood graph using Force-directed Graph (`scanpy.tl.draw_graph`)
================================================================================

For making FDG plots, please use `Scanpy PlotEmbed` with the output of this
tool and enter "draw_graph_{layout}" as the name of the embedding to plot.

It yields `X_draw_graph_{layout}`, FDG coordinates of data.

@HELP@

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