view scanpy-run-fdg.xml @ 16:a6190ae4fe16 draft

"planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/tree/develop/tools/tertiary-analysis/scanpy commit 045c1232e9d8cdc7bc084e089900e9bd17fc47e1-dirty"
author ebi-gxa
date Tue, 23 Mar 2021 16:32:40 +0000
parents dd27b39c5c12
children 14866357fbec
line wrap: on
line source

<?xml version="1.0" encoding="utf-8"?>
<tool id="scanpy_run_fdg" name="Scanpy RunFDG" version="@TOOL_VERSION@+galaxy1" profile="@PROFILE@">
  <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
    --key-added-ext '${key_added_ext}'
#if $embeddings
    --export-embedding embeddings.tsv
#end if
#if $settings.default == "false"
    #if $settings.neighbors_key
    --neighbors-key '${settings.neighbors_key}'
    #end if
    #if $settings.obsp
    --obsp '${settings.obsp}'
    #end if
    --random-state ${settings.random_seed}
    --layout ${settings.layout}
    #if $settings.init_pos
        --init-pos '${settings.init_pos}'
    #end if
    #if $settings.root
        --root '${settings.root}'
    #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 tsv format"/>
    <param name="key_added_ext" argument="--key-added-ext" 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="neighbors_key" argument="--neighbors-key" value="neighbors" type="text"
               label="Name of the slot that holds the KNN graph"/>
        <param name="obsp" type="boolean" checked="false" label="Use .obsp[obsp] as adjacency" help="You can’t specify both obsp and neighbors-key at the same time."/>
        <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"/>
        <param name="layout" argument="--layout" type="select" label="Graph layout">
          <option value="fa">fa</option>
          <option value="fr" selected="true">fr</option>
          <option value="grid_fr">grid fr</option>
          <option value="kk">kk</option>
          <option value="lgl">lgl</option>
          <option value="drl">drl</option>
          <option value="rt">rt</option>
          <option value="rt_circular">rt_circular</option>
        </param>
        <param name="root" argument="--root" type="integer" optional="true" label="Root for tree layouts"/>
        <param name="random_seed" argument="--random-state" type="integer" value="0" label="Seed for numpy random number generator"/>
      </when>
    </conditional>
  </inputs>

  <outputs>
    <expand macro="output_data_obj" description="FDG object"/>
    <data name="output_embed" format="tabular" from_work_dir="embeddings.tsv" 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.tsv" ftype="tabular" compare="sim_size">
        <assert_contents>
          <has_n_columns n="3"/>
        </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>