view cell-browser.xml @ 2:cc47d8df79eb draft default tip

"planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/tree/develop/tools/tertiary-analysis/ucsc-cell-browser/.shed.yml commit f12604f7ae850f2269a924f95a442c668948a61a"
author ebi-gxa
date Thu, 11 Jun 2020 20:58:35 +0000
parents 92a98e92907f
children
line wrap: on
line source

<tool id="ucsc_cell_browser" name="UCSC Cell Browser" version="0.7.10+galaxy0" profile="18.01">
  <description>displays single-cell clusterized data in an interactive web application.</description>
  <requirements>
    <requirement type="package" version="0.7.10">ucsc-cell-browser</requirement>
  </requirements>
<stdio>
<exit_code range="1:" />
</stdio>
<command><![CDATA[
#if $input_type.expression_source == "native-cell-browser":

   echo "coords = [ {'file':'$tsneCoordinates', 'shortLabel':'t-SNE'} ]" > ./cellbrowser.conf;
   echo "meta = '$cellMetadata'" >> ./cellbrowser.conf;
   echo "name = 'sample'" >> ./cellbrowser.conf;
   echo "exprMatrix = '$expressionMatrix'" >> ./cellbrowser.conf;
   echo "geneIdType = 'symbol'" >> ./cellbrowser.conf;

   cbBuild -i cellbrowser.conf -o "$html_file.extra_files_path";

   ## "sample" is used as name, so no change needed.
   cp '$__tool_directory__/redirect.html' '$html_file';

#else if $input_type.expression_source == "cell-browser-tar":

   tar -xf '$tarred_sources';
   cbBuild -i cellbrowser.conf -o "$html_file.extra_files_path";

   ## we need to adapt redirect to use the study name used in cellbrowser.conf
   study=\$(grep '^name=' cellbrowser.conf | awk -F'=' '{ print $2 }' | sed s/\"//g ) &&
   echo "Study to replace: "\$study &&
   sed "s/ds=sample/ds=\$study/" '$__tool_directory__/redirect.html' > '$html_file';

#else if $input_type.expression_source == "scanpy":

   ## We could add a condition here were, if cluster_field is provided
   ## then we rename it inside with an AnnData relying script to read 'louvain' to please UCSC CellBrowser

   ln -s '$input_anndata_file' scanpy_ann_data.h5ad;
   cbImportScanpy -i scanpy_ann_data.h5ad

   #if $input_type.marker_field:
     --markerField '${input_type.marker_field}'
   #end if

   #if $input_type.cluster_field:
     --clusterField '${input_type.cluster_field}'
   #end if


     -o outdir -n sample --htmlDir '$html_file.extra_files_path';
   cp '$__tool_directory__/redirect.html' '$html_file';

#end if
]]></command>
<inputs>
  <conditional name="input_type">
    <param type="select" name="expression_source" label="Choose the format of the expression data" help="Use compressed txt, Scanpy or Seurat objects">
      <option value="native-cell-browser" selected="true">CellBrowser tar.gz expression matrix</option>
      <option value="scanpy">Scanpy AnnData HDF5 serialized object</option>
      <option value="cell-browser-tar">Tar file with CellBrowser files to execute cbBuild</option>
    </param>
    <when value="native-cell-browser">
      <param type="data" name="expressionMatrix" label="Expression matrix" help="Tabular expression matrix (see https://github.com/maximilianh/cellBrowser/tree/master/sampleData)" format="tabular"/>
      <param type="data" name="cellMetadata" label="Cell metadata" help="Tabular file with metadata fields (columns) for each cell (rows)." format="tabular"/>
      <param type="data" name="tsneCoordinates" label="tSNE coordinates" help="Tabular file with tSNE coordinates for each cell." format="tabular"/>
    </when>
    <when value="cell-browser-tar">
      <param name="tarred_sources" type="data" format="tar" label="CellBrowser source files tarred" help="Tar containing CellBrowser config, tsne, umap and other source files for running cbBuild"/>
    </when>
    <when value="scanpy">
      <param name="input_anndata_file" type="data" format="h5,h5ad" label="Input object in AnnData hdf5 format" help="Scanpy serialized output is by default produced as an AnnData hdf5 file."/>
      <param name="marker_field" argument="--markerField" type="text" value="rank_genes_groups" label="Marker genes field" help="Scanpy marker genes field to use, optional, if not set 'rank_genes_groups' will be used."/>
      <param name="cluster_field" argument="--clusterField" type="text" label="Cluster field" help="Scanpy cluster field to use. Optional, if not set 'louvain' will be used. If the AnnData object doesn't not have 'louvain' among its clustering fields, then this NEEDS to be set or UCSC CellBrowser will fail."/>
    </when>
  </conditional>
</inputs>
<outputs>
    <data format="html" name="html_file" label="${tool.name} on ${on_string}: Interactive Viewer"/>
</outputs>

<tests>
  <test>
    <param name="input_anndata_file" ftype="data" value="anndata.h5"/>
    <output name="html_file" ftype="data" value="cellbrowser.html" compare="sim_size"/>
  </test>
</tests>

<help><![CDATA[
UCSC Single Cell Browser
========================

Funded by the California Institute of Regenerative Medicine and the Chan-Zuckerberg
Initiative https://www.chanzuckerberg.com/.

The UCSC Cell Browser is a viewer for single cell data. You can click on and hover
over cells to get meta information, search for genes to color on and click clusters
to show cluster-specific marker genes, which in turn are clickable again.

For a demo of the browser, see http://cells.ucsc.edu

Usage
-----

After choosing the inputs and executing the tool, once the history item becomes
green, press the View data (eye icon) button, which will open the generated UCSC Cell Browser
interactive site. Press the white on blue "Open Dataset" button.

Troubleshooting
---------------

Depending on the window size when pressing the "View data" button, you might see a black canvas and a diminished panel to the upper left
with the text "Choose cell...". If that is the case, close that panel (click on the cross)
and then choose File -> Open Dataset... and then press the Open Dataset white button.

Version history
---------------

0.4.3+galaxy0: Initial contribution. Pablo Moreno, Expression Atlas team https://www.ebi.ac.uk/gxa/home  at
EMBL-EBI https://www.ebi.ac.uk/.

0.4.38+galaxy0: Supports Seurat (through a converter) and Scanpy input. Pablo Moreno, Expression Atlas team https://www.ebi.ac.uk/gxa/home  at
EMBL-EBI https://www.ebi.ac.uk/.

0.5.21+galaxy0: Update UCSC CellBrowser version to 0.5.21. Pablo Moreno, Expression Atlas team https://www.ebi.ac.uk/gxa/home  at
EMBL-EBI https://www.ebi.ac.uk/.

0.5.38+galaxy0: Update UCSC CellBrowser version to 0.5.43. Fixes bugs and improves usage of gene symbols in AnnData objects. Pablo Moreno, Expression Atlas team https://www.ebi.ac.uk/gxa/home  at
EMBL-EBI https://www.ebi.ac.uk/.
]]></help>
<citations>
 <citation type="bibtex">
  @misc{ucsc-cell-browser-gitrepo,
  author = {Maximilian Haeussler and collaborators},
  year = {2018},
  title = {UCSC Single Cell Browser: Python pipeline and Javascript scatter plot library for single-cell datasets},
  publisher = {GitHub},
  journal = {GitHub repository},
  url = {https://github.com/maximilianh/cellBrowser},
 }
 </citation>
 <citation type="doi">10.1101/2020.04.08.032698</citation>
</citations>
</tool>