view seurat_find_neighbours.xml @ 3:ab622ffd7c7f draft

"planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit a1ad1ddd9b8e4db5bb82c3accae8311e0e488b19"
author ebi-gxa
date Fri, 27 Nov 2020 13:48:19 +0000
parents bba8b14264c2
children 99d628557c47
line wrap: on
line source

<tool id="seurat_find_neighbours" name="Seurat FindNeighbours" version="@SEURAT_VERSION@+galaxy0">
    <description>constructs a Shared Nearest Neighbor (SNN) Graph</description>
    <macros>
        <import>seurat_macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <expand macro="version" />
    <command detect_errors="exit_code"><![CDATA[
seurat-find-neighbours.R
@INPUT_OBJECT@
$distance_matrix
#if $k_param
  --k-param  '$k_param'
#end if
$compute_snn
#if $prune_snn
  --prune-snn  '$prune_snn'
#end if
#if $nn_method
  --nn-method  '$nn_method'
#end if
#if $annoy_metric
  --annoy-metric  '$annoy_metric'
#end if
#if $graph_name
  --graph-name  '$graph_name'
#end if
#if $nn_eps and $nn_method == "rann"
  --nn-eps '$nn_eps'
#end if
$force_recalc
#if $features_file
  --features '$features_file'
#else if $features
  --features '$features'
#end if
#if $reduction
  --reduction  '$reduction'
#end if
#if $dims
  --dims  '$dims'
#end if
#if $assay
  --assay  '$assay'
#end if
#if $do_plot
  $do_plot
#end if
@OUTPUT_OBJECT@
]]></command>

    <inputs>
        <expand macro="input_object_params"/>
        <expand macro="output_object_params"/>
        <param label="Features" optional="true" name="features" argument="--features" type="text" help="Comma-separated list of genes to use for building SNN."/>
        <param label="Features file" optional="true" name="features_file" argument="--features" type="data" format="txt,tabular" help="Text file with one gene per line to use for building SNN. Overrides Features."/>
        <param label="Plot SNN on tSNE" optional="true" name="do_plot" argument="--do-plot" type="boolean" truevalue="--do-plot" checked="false" help="Plot SNN graph on tSNE coordinates"/>
        <param label="Reduction" optional="true" name="reduction" argument="--reduction" type="text" help="Reduction to use as input for building the SNN"/>
        <param label="Dimensions" optional="true" name="dims" argument="--dims" type="text" help="Dimensions of reduction to use as input. A comma-separated list of the dimensions to use in construction of the SNN graph (e.g. To use the first 5 PCs, pass 1,2,3,4,5)."/>
        <param label="Assay" optional="true" name="assay" argument="--assay" type="text" help="Assay to use in construction of SNN"/>
        <param label="Distance matrix" optional="true" name="distance_matrix" argument="--distance-matrix" type="boolean" truevalue="--distance-matrix" falsevalue="" checked="false" help="Boolean value of whether the provided matrix is a distance matrix; note, for objects of class dist, this parameter will be set automatically."/>
        <param label="k" optional="true" name="k_param" argument="--k-param" type="integer" help="Defines k for the k-nearest neighbor algorithm"/>
        <param label="Compute SNN" optional="true" name="compute_snn" argument="--compute-snn" type="boolean" truevalue="--compute-snn" falsevalue="" checked="false" help="Also compute the shared nearest neighbor graph"/>
        <param label="Prune SNN" optional="true" name="prune_snn" argument="--prune-snn" type="float" help="Sets the cutoff for acceptable Jaccard index when computing the neighborhood overlap for the SNN construction. Any edges with values less than or equal to this will be set to 0 and removed from the SNN graph. Essentially sets the strigency of pruning (0 --- no pruning, 1 --- prune everything)."/>
        <param label="NN method" optional="true" name="nn_method" argument="--nn-method" type="select" help="Method for nearest neighbor finding. Options include: rann (default), annoy">
          <option value="rann" selected="true">rann</option>
          <option value="annoy">annoy</option>
        </param>
        <param label="Annoy metric" optional="true" name="annoy_metric" argument="--annoy-metric" type="select" help="Distance metric for annoy. Options include: euclidean (default), cosine, manhattan, and hamming">
          <option value="euclidean" selected="true">Euclidean</option>
          <option value="cosine">Cosine</option>
          <option value="manhattan">Manhattan</option>
          <option value="hamming">Hamming</option>
        </param>
        <param label="Graph name" optional="true" name="graph_name" argument="--graph-name" type="text" help="Name of graph to use for the clustering algorithm."/>
        <param label="NN Error bound" optional="true" name="nn_eps" argument="--nn-eps" type="float" help="Error bound when performing nearest neighbor seach using RANN; default of 0.0 implies exact nearest neighbor search"/>
        <param label="Force recalc" optional="true" name="force_recalc" argument="--force-recalc" type="boolean" truevalue="--force-recalc" falsevalue="" checked="false" help="Force recalculation of SNN"/>
    </inputs>

    <outputs>
        <expand macro="output_files"/>
        <data name="snn_on_tsne" format="pdf" from_work_dir="snn_on_tsne.pdf" label="${tool.name} on ${on_string}: SNN on tSNE Plot">
          <filter>do_plot</filter>
        </data>
    </outputs>

    <tests>
        <test>
            <param name="rds_seurat_file" ftype="rdata" value="pca_seurat.rds"/>
            <param name="compute_snn" value="True" />
            <param name="reduction" value="pca" />
            <output name="rds_seurat_file" ftype="rdata" value="neighbours_seurat.rds" compare="sim_size" delta="10000000" />
        </test>
    </tests>
    <help><![CDATA[
.. class:: infomark

**What it does**

Constructs a Shared Nearest Neighbor (SNN) Graph for a given dataset.
We first determine the k-nearest neighbors of each cell. We use this knn graph
to construct the SNN graph by calculating the neighborhood overlap (Jaccard index)
between every cell and its k.param nearest neighbors.

@SEURAT_INTRO@

-----

**Inputs**

    * Seurat RDS object. Probably the one produced by Seurat create object.
    * Subset names. A list of attributes to subset on, colon separated (:).
    * Low thresholds. A minimum value for each of the attributes set in subset names, again, colon separated (:). Optional.
    * High thresholds. A maximum value for each of the attributes set in subset names, again, colon separated (:). Optional.
    * Cells to use. A list of cell names/idenfifiers to filter positively by.

-----

**Outputs**

    * Seurat RDS object filtered according to the inputs.

.. _Seurat: https://www.nature.com/articles/nbt.4096
.. _Satija Lab: https://satijalab.org/seurat/

@VERSION_HISTORY@

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