changeset 0:4fff8ad1c76d draft

planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 0463f230d18201c740851d72e31a5024f391207f
author ebi-gxa
date Mon, 25 Nov 2019 06:07:31 -0500
parents
children bba8b14264c2
files README seurat_find_neighbours.xml seurat_macros.xml
diffstat 3 files changed, 255 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README	Mon Nov 25 06:07:31 2019 -0500
@@ -0,0 +1,1 @@
+Seurat tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/seurat_find_neighbours.xml	Mon Nov 25 06:07:31 2019 -0500
@@ -0,0 +1,128 @@
+<tool id="seurat_find_neighbours" name="Seurat FindNeighbours" version="@SEURAT_VERSION@_@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="input" ftype="rdata" value="seurat.rds"/>
+            <output name="rds_seurat_file" ftype="rdata" value="out_filter.rds" compare="sim_size"/>
+        </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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/seurat_macros.xml	Mon Nov 25 06:07:31 2019 -0500
@@ -0,0 +1,126 @@
+<?xml version="1.0"?>
+<macros>
+    <token name="@VERSION@">0.0.6</token>
+    <token name="@SEURAT_VERSION@">3.1.1</token>
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="@VERSION@">seurat-scripts</requirement>
+        </requirements>
+    </xml>
+    <xml name="version">
+    	<version_command><![CDATA[
+echo $(R --version | grep version | grep -v GNU)", seurat version" $(R --vanilla --slave -e "library(seurat); cat(sessionInfo()\$otherPkgs\$seurat\$Version)" 2> /dev/null | grep -v -i "WARNING: ")
+    ]]></version_command>
+    </xml>
+
+   <xml name="input_object_params">
+     <conditional name="input" label="Input format">
+       <param type="select" name="format" label="Choose the format of the input" help="RData, Loom or AnnData">
+         <option value="rds_seurat" selected="true">RDS with a Seurat object</option>
+         <option value="loom">Loom</option>
+         <option value="anndata">AnnData</option>
+         <option value="rds_sce">RDS with a Single Cell Experiment object</option>
+       </param>
+       <when value="anndata">
+         <param type="data" name="anndata_file" label="AnnData file" help="The AnnData format provided by Scanpy" format="h5,h5ad"/>
+       </when>
+       <when value="loom">
+         <param type="data" name="loom_file" label="Loom file" help="Input as Loom v? file" format="h5,h5loom"/>
+       </when>
+       <when value="rds_seurat">
+         <param type="data" name="rds_seurat_file" label="RDS file" help="Input as RDS file with Seurat 3 object" format="rdata"/>
+       </when>
+       <when value="rds_sce">
+         <param type="data" name="rds_sce_file" label="RDS file" help="Input as RDS file with Single Cell Experiment object" format="rdata"/>
+       </when>
+     </conditional>
+   </xml>
+
+   <token name="@INPUT_OBJECT@">
+    #if $input.format == "anndata"
+        --input-object-file '$input.anndata_file' --input-format anndata
+    #else if $input.format == "loom"
+        --input-object-file '$input.loom_file' --input-format loom
+    #else if $input.format == "rds_seurat"
+        --input-object-file '$input.rds_seurat_file' --input-format seurat
+    #else if $input.format == "rds_sce"
+        --input-object-file '$input.rds_sce_file' --input-format singlecellexperiment
+    #end if
+   </token>
+
+   <xml name="output_object_params">
+     <param type="select" name="format" label="Choose the format of the output" help="Seurat, Single Cell Experiment or Loom">
+       <option value="rds_seurat" selected="true">RDS with a Seurat object</option>
+       <option value="loom">Loom</option>
+       <option value="rds_sce">RDS with a Single Cell Experiment object</option>
+     </param>
+   </xml>
+
+   <xml name="output_files">
+    <data name="loom_file" from_work_dir="seurat_obj.loom" format="h5" label="${tool.name} on ${on_string}: Seurat Loom">
+      <filter>format == 'loom'</filter>
+    </data>
+    <data name="rds_seurat_file" format="rdata" label="${tool.name} on ${on_string}: Seurat RDS">
+      <filter>format == 'rds_seurat'</filter>
+    </data>
+    <data name="rds_sce_file" format="rdata" label="${tool.name} on ${on_string}: Seurat Single Cell Experiment RDS">
+      <filter>format == 'rds_sce'</filter>
+    </data>
+   </xml>
+
+   <token name="@OUTPUT_OBJECT@">
+    #if $format == "anndata"
+        --output-object-file '$anndata_file' --output-format anndata
+    #else if $format == "loom"
+        --output-object-file seurat_obj.loom --output-format loom
+    #else if $format == "rds_seurat"
+        --output-object-file '$rds_seurat_file' --output-format seurat
+    #else if $format == "rds_sce"
+        --output-object-file '$rds_sce_file' --output-format singlecellexperiment
+    #end if
+   </token>
+
+    <xml name="genes-use-input">
+      <param name="genes_use" argument="--genes-use" optional="true" type="data" format="tsv,txt,tabular" label="Genes to use" help="A file with gene names to use in construction of SNN graph if building directly based on expression data rather than a dimensionally reduced representation (i.e. PCs)."/>
+    </xml>
+    <xml name="dims-use-input">
+      <param name="dims_use" argument="--dims-use" min="1" optional="true" type="integer" label="PCA Dimensions to use" help="Number of PCs (dimensions) to use in construction of the SNN graph."/>
+    </xml>
+
+    <token name="@SEURAT_INTRO@"><![CDATA[
+Seurat_ is a toolkit for quality control, analysis, and exploration of single cell RNA sequencing data.
+It is developed and maintained by the `Satija Lab`_ at NYGC. Seurat aims to enable users to identify and
+interpret sources of heterogeneity from single cell transcriptomic measurements, and to integrate diverse
+types of single cell data.
+      ]]></token>
+
+    <token name="@VERSION_HISTORY@"><![CDATA[
+**Version history**
+
+3.1.1_0.0.6+galaxy0: Moved to Seurat 3.
+
+  Find clusters: removed dims-use, k-param, prune-snn.
+
+2.3.1+galaxy0: Improved documentation and further exposition of all script's options. Pablo Moreno, Jonathan Manning and Ni Huang, Expression Atlas team https://www.ebi.ac.uk/gxa/home  at
+EMBL-EBI https://www.ebi.ac.uk/. Parts obtained from wrappers from Christophe Antoniewski(https://github.com/drosofff) and Lea Bellenger(https://github.com/bellenger-l).
+
+0.0.1: Initial contribution. Maria Doyle, https://github.com/mblue9.
+      ]]></token>
+
+
+    <xml name="citations">
+        <citations>
+            <citation type="doi">10.1038/nbt.4096</citation>
+            <citation type="bibtex">
+              @misc{r-seurat-scripts.git,
+              author = {Jonathan Manning, Pablo Moreno, EBI Gene Expression Team},
+              year = {2018},
+              title = {Seurat-scripts: command line interface for Seurat},
+              publisher = {GitHub},
+              journal = {GitHub repository},
+              url = {https://github.com/ebi-gene-expression-group/r-seurat-scripts.git},
+            }
+            </citation>
+        </citations>
+    </xml>
+</macros>