view scanpy-find-variable-genes.xml @ 0:305d0cbe0ffd draft

planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/tree/develop/tools/tertiary-analysis/scanpy commit 9bf9a6e46a330890be932f60d1d996dd166426c4
author ebi-gxa
date Wed, 03 Apr 2019 11:12:05 -0400
parents
children b089f4a55e6b
line wrap: on
line source

<?xml version="1.0" encoding="utf-8"?>
<tool id="scanpy_find_variable_genes" name="Scanpy FindVariableGenes" version="@TOOL_VERSION@+galaxy0">
  <description>based on normalised dispersion of expression</description>
  <macros>
    <import>scanpy_macros.xml</import>
  </macros>
  <expand macro="requirements"/>
  <command detect_errors="exit_code"><![CDATA[
ln -s '${input_obj_file}' input.h5 &&
PYTHONIOENCODING=utf-8 scanpy-find-variable-genes.py -i input.h5
    -f '${input_format}'
    -o output.h5
    -F '${output_format}'
    --flavor '${flavor}'
    -b '${n_bin}'
    #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}'
    #end if
    #if $n_top_gene
        -n '${n_top_gene}'
    #end if
]]></command>

  <inputs>
    <expand macro="input_object_params"/>
    <expand macro="output_object_params"/>
    <param name="flavor" argument="--flavor" type="select" value="seurat" label="Flavor of computing normalised dispersion">
      <option value="seurat">Seurat</option>
      <option value="cell_ranger">Cell-ranger</option>
    </param>
    <repeat name="parameters" min="1" title="Parameters used to find variable genes">
      <param name="name" type="select" label="Name of parameter to filter on">
        <option value="mean">Mean of expression</option>
        <option value="disp">Dispersion of expression</option>
      </param>
      <param name="min" type="float" value="0" label="Min value"/>
      <param name="max" type="float" value="1e9" label="Max value"/>
    </repeat>
    <param name="n_bin" argument="--n-bins" type="integer" value="20" label="Number of bins for binning the mean expression"/>
    <param name="n_top_gene" argument="--n-top-genes" type="integer" optional="true" label="Number of top variable genes to keep"/>
  </inputs>

  <outputs>
    <data name="output_h5" format="h5" from_work_dir="output.h5" label="${tool.name} on ${on_string}: Variable genes"/>
  </outputs>

  <tests>
    <test>
      <param name="input_obj_file" value="normalise_data.h5"/>
      <param name="input_format" value="anndata"/>
      <param name="output_format" value="anndata"/>
      <param name="flavor" value="seurat"/>
      <param name="n_bin" value="20"/>
      <repeat name="parameters">
        <param name="name" value="mean"/>
        <param name="min" value="0.0125"/>
        <param name="max" value="3"/>
      </repeat>
      <repeat name="parameters">
        <param name="name" value="disp"/>
        <param name="min" value="0.5"/>
        <param name="max" value="1e9"/>
      </repeat>
      <output name="output_h5" file="find_variable_genes.h5" ftype="h5" compare="sim_size"/>
    </test>
  </tests>

  <help><![CDATA[
============================================================
Extract highly variable genes (`pp.filter_genes_dispersion`)
============================================================

Depending on `flavor`, this reproduces the R-implementations of Seurat and Cell Ranger.

The normalized dispersion is obtained by scaling with the mean and standard
deviation of the dispersions for genes falling into a given bin for mean
expression of genes. This means that for each bin of mean expression, highly
variable genes are selected.

@HELP@

@VERSION_HISTORY@
]]></help>
  <expand macro="citations">
    <citation type="doi">10.1038/nbt.3192</citation>
    <citation type="doi">10.1038/ncomms14049</citation>
  </expand>
</tool>