view scanpy-filter-genes.xml @ 19:a1698b43abeb draft

"planemo upload for repository commit b03a24b2e459a00c79221b160d9187902a4098d0-dirty"
author ebi-gxa
date Wed, 25 Nov 2020 16:16:30 +0000
parents fc5b3e76131b
children d82d999fa716
line wrap: on
line source

<?xml version="1.0" encoding="utf-8"?>
<tool id="scanpy_filter_genes" name="Scanpy FilterGenes" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
  <description>based on counts and numbers of cells expressed</description>
  <expand macro="requirements"/>
  <command detect_errors="exit_code"><![CDATA[
ln -s '${input_obj_file}' input.h5 &&
PYTHONIOENCODING=utf-8 scanpy-filter-genes
#if $parameters
#for $p in $parameters
    #set $min = $p.min
    #set $max = $p.max
    #if $'pct_')
      #set $min = float($min) / 100
      #set $max = float($max) / 100
    #end if
    --param 'g:$' $min $max
#end for
#end if
#if $categories
    #set cats = ' '.join(["--category 'g:{name}' '{negate}{values}'".format(**$c) for $c in $categories])
#end if
#if $subsets
    #set subs = ' '.join(["--subset 'g:{name}' '{subset}'".format(**$s) for $s in $subsets])
#end if

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

    <repeat name="parameters" title="Parameters to select genes to keep" min="1">
      <param name="name" type="text" value="n_cells" label="Name of parameter to filter on" help="for example n_genes or n_counts">
        <option value="n_cells">n_cells</option>
        <option value="n_counts">n_counts</option>
      <param name="min" type="float" min="0" value="0" label="Min value" help="Genes with value below min will be discarded."/>
      <param name="max" type="float" min="0" value="1e9" label="Max value" help="Genes with value above max will be discarded."/>

    <repeat name="categories" title="Categories to select genes to keep (unless negate is checked)" 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 name="subsets" title="Subsets to select genes to keep" 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"/>
    <param name="force_recalc" label="Force recalculation of QC vars" type="boolean" truevalue="--force-recalc" falsevalue="" help="If set, it will recalculate pcts and other existing QC vars, overwriting existing ones."/>
    <expand macro="export_mtx_params"/>

    <expand macro="output_data_obj" description="Filtered cells"/>
    <expand macro="export_mtx_outputs"/>

      <param name="input_obj_file" value="filter_cells.h5"/>
      <param name="input_format" value="anndata"/>
      <param name="output_format" value="anndata"/>
      <repeat name="parameters">
        <param name="name" value="n_cells"/>
        <param name="min" value="20"/>
        <param name="max" value="1e9"/>
      <repeat name="parameters">
        <param name="name" value="n_counts"/>
        <param name="min" value="0"/>
        <param name="max" value="1e9"/>
      <output name="output_h5" file="filter_genes.h5" ftype="h5" compare="sim_size"/>

Filter genes based on arbitrary attributes (`scanpy.pp.filter_genes`)

Keep genes that have at least `min_counts` counts or are expressed in at
least `min_cells` cells or have at most `max_counts` counts or are expressed
in at most `max_cells` cells. Other gene attributes can be used for filtering
too if available.


  <expand macro="citations"/>