view scanpy-plot-embedding.xml @ 25:bfb4d298d75f draft

planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/tree/develop/tools/tertiary-analysis/scanpy commit 162313dc6ba68efc5003b1bd9b71a40aec87d826-dirty
author ebi-gxa
date Fri, 13 Oct 2023 14:08:31 +0000
parents 35f6611fb8c3
children 7d5c97823f8b
line wrap: on
line source

<?xml version="1.0" encoding="utf-8"?>
<tool id="scanpy_plot_embed" name="Scanpy PlotEmbed" version="@TOOL_VERSION@+galaxy93" profile="@PROFILE@">
  <description>visualise cell embeddings</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 embed
@INPUT_OPTS@
#if $color_by
    --color '${color_by}'
#end if
${use_raw}
    --legend-loc '${legend_loc}'
    --legend-fontsize '${legend_fontsize}'
#if $basis
    --basis '${basis}'
#end if
#if $groups
    --groups $groups
#end if
#if $neighbors_key
    --neighbors-key '${neighbors_key}'
#end if    
#if $layer
    --layer '${layer}'
#end if
#if $point_size
    --size ${point_size}
#end if
#if $gene_symbols_field
    --gene-symbols ${gene_symbols_field}
    #end if
${edges} --edges-width ${edges_width}
#if $edges_color
    --edges-color ${edges_color}
#end if
#if $components
    --components ${components}
#end if
--projection $projection
$sort_order
@PLOT_OPTS@
]]></command>

  <inputs>
    <expand macro="input_object_params"/>
    <param name="basis" argument="--basis" type="text" value='umap' label="name of the embedding to plot"/>
    <param name="color_by" argument="--color" type="text" label="color by attributes, comma separated texts">
      <sanitizer>
        <valid initial="string.printable"/>
      </sanitizer>
    </param>
    <param name="groups" argument="--groups" type="text" value="" label="Key for categorical in `.obs`" help="You can pass your predefined groups by choosing any categorical annotation of observations."/>
    <param name="gene_symbols_field" argument="--gene-symbols" type="text" optional="true" label="Field for gene symbols" help="The field used in the AnnData object to store gene symbols, leave blank for the default (index), else a common value is 'gene_symbols'"/>
    <param name="use_raw" argument="--use-raw" type="boolean" checked="true" truevalue="--use-raw" falsevalue="--no-raw" label="Use raw attributes" help="Using this option means that scanpy will expect to find the raw data object. The job will fail if the raw data object is not present within the supplied AnnData file."/>
    <param name="layer" argument="--layer" value="" type="text"
        label="Name of the AnnData object layer to plot" help="By default adata.raw.X is plotted. If use_raw=False is set, then adata.X is plotted. If layer is set to a valid layer name, then the layer is plotted. layer takes precedence over use_raw." />
    <param name="neighbors_key" argument="--neighbors-key" value="" type="text"
        label="Where to look for neighbors connectivities." help="If not specified, this looks in .obsp[‘connectivities’] for connectivities (default storage place for pp.neighbors). If specified, this looks .obsp[.uns[neighbors_key][‘connectivities_key’]] for connectivities."/>
    <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="legend_fontsize" argument="--legend-fontsize" type="integer" value="15" label="Legend font size"/>
    <param name="point_size" argument="--size" type="integer" optional="true" label="Point size"
           help="Automatically determined if not specified."/>
    <param name="edges" argument="--edges" type="boolean" checked="False" truevalue="--edges" falsevalue="" label="Show edges?"/>
    <param name="edges_width" argument="--edges-width" type="float" value="0.1" label="Width of edges"/>
    <param name="edges_color" argument="--edges-color" type="text" value="" label="Color of edges"/>
    <param name="sort_order" argument="--no-sort-order" type="boolean" checked="False" truevalue="" falsevalue="--no-sort-order" label="Plot in order?" help="For continuous annotations used as 'color parameter, plot data points with higher values on top of others."/>
    <param name="components" argument="--components" type="text" value="" label="Components to plot" help="Comma-separated list, e.g. '1,2', '2,3'. To plot all available components use 'all'."/>
    <param name="projection" argument="--projection" type="select" label="Plot projection">
      <option value="2d" selected="true">2D</option>
      <option value="3d">3D</option>
    </param>
    <expand macro="output_plot_params"/>
  </inputs>

  <outputs>
    <data name="output_png" format="png" from_work_dir="output.png" label="${tool.name} on ${on_string}: ${basis} embedding plot"/>
  </outputs>

  <tests>
    <test>
      <param name="input_obj_file" value="find_cluster.h5"/>
      <param name="input_format" value="anndata"/>
      <param name="basis" value="X_pca"/>
      <param name="color_by" value="louvain"/>
      <param name="use_raw" value="false"/>
      <output name="output_png" file="plot_embed.png" ftype="png" compare="sim_size"/>
    </test>
  </tests>

  <help><![CDATA[
=============================================================
Plot embeddings of a given method of dimensionality reduction
=============================================================

It yields a scatter plot in png format, wherein cells are placed in space of
reduced dimensionality and coloured by attribute of choice.

Requires calculating the specified embeddings first. For example, to make
UMAP/TSNE plots, run `Scanpy RunUMAP`/`Scanpy RunTSNE` first, then enter
"umap"/"tsne" as the name of the embedding to plot here.

@HELP@

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