view scanpy-filter-cells.xml @ 6:9024cf7a9a13 draft

planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/tree/develop/tools/tertiary-analysis/scanpy commit 0a162684a5859a53eefb14af11ba8ec64d42b213-dirty
author ebi-gxa
date Wed, 20 Nov 2019 06:36:04 -0500
parents 9b2072ee4bdd
children 9c65f1de489b
line wrap: on
line source

<?xml version="1.0" encoding="utf-8"?>
<tool id="scanpy_filter_cells" name="Scanpy FilterCells" version="@TOOL_VERSION@+galaxy3">
  <description>based on counts and numbers of genes expressed</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-filter-cells
#if $gene_name
    --gene-name '${gene_name}'
#end if
#if $parameters
    #set pars = ' '.join(["--param 'c:{name}' {min} {max}".format(**$p) for $p in $parameters])
    ${pars}
#end if
#if $categories
    #set cats = ' '.join(["--category 'c:{name}' '{negate}{values}'".format(**$c) for $c in $categories])
    ${cats}
#end if
#if $subsets
    #set subs = ' '.join(["--subset 'c:{name}' '{subset}'".format(**$s) for $s in $subsets])
    ${subs}
#end if
    @INPUT_OPTS@
    @OUTPUT_OPTS@
    @EXPORT_MTX_OPTS@
    ]]></command>

  <inputs>
    <expand macro="input_object_params"/>
    <expand macro="output_object_params"/>

    <param name="gene_name" type="text" optional="true" label="Name of the column in `anndata.var` that contains gene name"
           help="Used for flagging mitochondria genes (starting with 'MT-'). Leave empty if gene table already has a boolean column called 'mito' that flags MT genes"/>

    <repeat name="parameters" title="Parameters used to filter cells" min="1">
      <param name="name" type="text" value="n_genes" label="Name of parameter to filter on" help="for example n_genes or n_counts">
        <option value="n_genes">n_genes</option>
        <option value="n_counts">n_counts</option>
        <option value="pct_counts_mito">pct_counts_mito (only usable if MT genes are flagged)</option>
      </param>
      <param name="min" type="float" value="0" min="0" label="Min value"/>
      <param name="max" type="float" value="1e9" label="Max value"/>
    </repeat>

    <repeat name="categories" title="Categories used to filter cells" min="0">
      <param name="name" type="text" value="" label="Name of the categorical variable to filter on"/>
      <param name="values" type="text" value="" label="Comma-separated list of categories"/>
      <param name="negate" type="boolean" truevalue="!" falsevalue="" checked="false" label="Apply as negative filter" help="If enabled, specified categories will be removed rather than retained."/>
    </repeat>

    <repeat name="subsets" title="Subsets used to filter cells" min="0">
      <param name="name" type="text" value="" label="Name of the categorical variable to filter on"/>
      <param name="subset" type="data" format="tabular" label="List of values to keep" help="A one-column headerless text file is required"/>
    </repeat>
    <expand macro="export_mtx_params"/>
  </inputs>

  <outputs>
    <data name="output_h5" format="h5" from_work_dir="output.h5" label="${tool.name} on ${on_string}: Filtered cells"/>
    <expand macro="export_mtx_outputs"/>
  </outputs>

  <tests>
    <test>
      <param name="input_obj_file" value="read_10x.h5"/>
      <param name="input_format" value="anndata"/>
      <param name="output_format" value="anndata"/>
      <repeat name="parameters">
        <param name="name" value="n_genes"/>
        <param name="min" value="200"/>
        <param name="max" value="2500"/>
      </repeat>
      <repeat name="parameters">
        <param name="name" value="n_counts"/>
        <param name="min" value="0"/>
        <param name="max" value="1e9"/>
      </repeat>
      <output name="output_h5" file="output.h5" ftype="h5" compare="sim_size"/>
    </test>
  </tests>

  <help><![CDATA[
===================================================================
Filter cells based on various QC metrics (`scanpy.pp.filter_cells`)
===================================================================

For instance, only keep cells with at least `min_counts` and at most
`max_counts` UMI and/or at least `min_genes` expressed genes and/or at most
`max_mito_percent` mitocondria expression. This is to filter measurement
outliers, i.e., "unreliable" observations.

@HELP@

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