Mercurial > repos > ebi-gxa > scanpy_filter_cells
diff scanpy-filter-cells.xml @ 1:4c806f3f094c draft
"planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/tree/develop/tools/tertiary-analysis/scanpy commit ba0c88ab1b077a0b1c60c8d3c529e72ca6946226"
| author | ebi-gxa |
|---|---|
| date | Thu, 12 Mar 2020 09:07:07 +0000 |
| parents | cad451be0a2a |
| children |
line wrap: on
line diff
--- a/scanpy-filter-cells.xml Wed Mar 13 11:51:56 2019 -0400 +++ b/scanpy-filter-cells.xml Thu Mar 12 09:07:07 2020 +0000 @@ -1,46 +1,74 @@ <?xml version="1.0" encoding="utf-8"?> -<tool id="scanpy_filter_cells" name="Scanpy FilterCells" version="@TOOL_VERSION@+galaxy0"> +<tool id="scanpy_filter_cells" name="Scanpy FilterCells" version="@TOOL_VERSION@+galaxy10" profile="@PROFILE@" > <description>based on counts and numbers of genes expressed</description> <macros> - <import>scanpy_macros.xml</import> + <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.py - -i input.h5 - -f '${input_format}' - -o output.h5 - -F '${output_format}' - #if $parameters - #set pars = ','.join([str($p['name']) for $p in $parameters]) - -p '${pars}' - #set mins = ','.join([str($p['min']) for $p in $parameters]) - -l '${mins}' - #set maxs = ','.join([str($p['max']) for $p in $parameters]) - -j '${maxs}' +PYTHONIOENCODING=utf-8 scanpy-filter-cells +#if $gene_name + --gene-name '${gene_name}' +#end if +#if $parameters +#for $p in $parameters + #set $min = $p.min + #set $max = $p.max + #if $p.name.startswith('pct_') + #set $min = float($min) / 100 + #set $max = float($max) / 100 #end if - #if $subset - -s '${subset}' - #end if + --param 'c:$p.name' $min $max +#end for +#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"/> - <repeat name="parameters" title="Parameters used to filter cells" min="1"> + + <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 to select cells to keep" 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 or has been pre-calculated)</option> </param> - <param name="min" type="float" value="0" min="0" label="Min value"/> - <param name="max" type="float" value="1e9" label="Max value"/> + <param name="min" type="float" value="0" min="0" label="Min value" help="Cells with value below min will be discarded."/> + <param name="max" type="float" value="1e9" label="Max value" help="Cells with value above max will be discarded."/> </repeat> - <param name="subset" argument="--subset-list" type="data" format="tsv" optional="true" label="List of barcodes"/> + + <repeat name="categories" title="Categories to select cells 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" help="Cells with these values in this categorical variable will be kept."/> + <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 to select cells 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"/> + </repeat> + <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"/> </inputs> <outputs> - <data name="output_h5" format="h5" from_work_dir="output.h5" label="${tool.name} on ${on_string}: Filtered cells"/> + <expand macro="output_data_obj" description="Filtered cells"/> + <expand macro="export_mtx_outputs"/> </outputs> <tests> @@ -58,18 +86,19 @@ <param name="min" value="0"/> <param name="max" value="1e9"/> </repeat> - <output name="output_h5" file="filter_cells.h5" ftype="h5" compare="sim_size"/> + <output name="output_h5" file="output.h5" ftype="h5" compare="sim_size"/> </test> </tests> <help><