view scanpy-plot-trajectory.xml @ 26:cb1992d1804b draft default tip

planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/tree/develop/tools/tertiary-analysis/scanpy commit ee197a80b2d591c393e1662854bc119b2ecab11e-dirty
author ebi-gxa
date Tue, 27 Feb 2024 16:43:29 +0000
parents 9d746af31fe8
children
line wrap: on
line source

<?xml version="1.0" encoding="utf-8"?>
<tool id="scanpy_plot_trajectory" name="Scanpy PlotTrajectory" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
  <description>visualise cell trajectories</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 plot paga
#if $use_key
    --use-key '${use_key}'
#end if
    --layout ${layout}
    --legend-loc '${legend_loc}'
#if $basis
    --basis ${basis}
#end if
#if $settings.default == "false"
    --threshold ${settings.threshold}
    #if $settings.root
        --root ${settings.root}
    #end if
        ${settings.single_component}
    #if $settings.solid_edges
        --solid-edges ${settings.solid_edges}
    #end if
    #if $settings.color
        --color '${settings.color}'
    #end if
    #if $settings.node_size
        --node-size-scale ${settings.node_size}
    #end if
    #if $settings.node_font
        --fontsize ${settings.node_font}
    #end if
    #if $settings.edge_width
        --edge-width-scale ${settings.edge_width}
    #end if
#end if
    #if str($output_format).startswith('anndata')
        --show-obj stdout --output-format anndata --output-obj output.h5
    #else
        --show-obj stdout --output-format loom --output-obj output.h5
    #end if
    @INPUT_OPTS@
    @PLOT_OPTS@
]]></command>

  <inputs>
    <expand macro="input_object_params"/>
    <expand macro="output_object_params"/>
    <param name="use_key" argument="--use-key" type="text" value="paga"
           label="The key in `.uns` that contains trajectory information"/>
    <param name="layout" argument="--layout" type="select" label="Layout functions">
      <option value="fa">ForceAtlas2</option>
      <option value="fr" selected="true">Fruchterman-Reingold</option>
      <option value="rt">Reingold-Tilford</option>
    </param>
    <param name="legend_loc" argument="--legend-loc" type="select" label="Location of legend">
      <option value="right margin" selected="true">Right margin</option>
      <option value="on data">On data</option>
    </param>
    <param name="basis" argument="--basis" type="text" optional="true" label="Name of the embedding to plot"
           help="Must be a key of `.obsm` without the prefix 'X_', e.g. 'umap'."/>
    <expand macro="output_plot_params"/>
    <conditional name="settings">
      <param name="default" type="boolean" checked="true" label="Use programme defaults"/>
      <when value="true"/>
      <when value="false">
        <param name="threshold" argument="--threshold" type="float" min="0" value="0.01"
               label="Do not draw edges with weights below this threshold"
               help="Set to 0 to include all edges."/>
        <param name="root" argument="--root" type="integer" min="0" value="0"
               label="The index of the root node when choosing a tree layout"/>
        <param name="single_component" argument="--single-component" type="boolean" truevalue="--single-component" falsevalue="" checked="false"
               label="Restrict to the largest connected component"/>
        <param name="solid_edges" argument="--solid-edges" type="select" label="Edges to be drawn in solid black">
          <option value="connectivities" selected="true">connectivities</option>
          <option value="connectivities_tree">connectivities_tree</option>
        </param>
        <param name="color" argument="--color" type="text" label="Name of cell annotation or gene that is used to color the nodes"/>
        <param name="node_size" argument="--node-size-scale" type="float" value="1.0"
               label="Increase or decrease the size of the nodes"/>
        <param name="node_font" argument="--fontsize" type="integer" min="1" optional="true"
               label="Font size for the node labels"/>
        <param name="edge_width" argument="--edge-width-scale" type="float" value="1.0"
               label="Increase or decrease the width of the edges"/>
      </when>
    </conditional>
  </inputs>

  <outputs>
    <expand macro="output_data_obj" description="Plotted PAGA"/>
    <data name="output_png" format="png" from_work_dir="output.png" label="${tool.name} on ${on_string}: trajectory plot"/>
  </outputs>

  <tests>
    <test>
      <param name="input_obj_file" value="paga.h5"/>
      <param name="input_format" value="anndata"/>
      <param name="output_format" value="anndata"/>
      <output name="output_h5" ftype="h5">
        <assert_contents>
          <has_h5_keys keys="uns/louvain_colors"/>
        </assert_contents>
      </output>
      <output name="output_png" file="paga_compare.png" ftype="png" compare="sim_size" delta_frac="0.1"/>
    </test>
  </tests>

  <help><![CDATA[
===============================================================
Plot PAGA-inferred trajectories (`scanpy.pl.paga/paga_compare`)
===============================================================

Depending on the selected options, it yields a plot of a graph representing
inferred trajectory, or a trajectory graph side-by-side with a scatter plot of
cells embedded to space of reduced dimensionality in png format.

It requires running PAGA, first.

@HELP@

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