changeset 3:ad5179780e25 draft

"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 2ba483354c14ddfd0f7aa57c2ad1c9944e9c4bba"
author ebi-gxa
date Fri, 29 May 2020 07:09:58 -0400
parents 679dfd1dd63b
children 8da642e17794
files cell-browser.xml redirect.html
diffstat 2 files changed, 40 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/cell-browser.xml	Tue Aug 13 05:33:26 2019 -0400
+++ b/cell-browser.xml	Fri May 29 07:09:58 2020 -0400
@@ -1,4 +1,4 @@
-<tool id="ucsc_cell_browser" name="UCSC Cell Browser" version="0.5.43+galaxy0">
+<tool id="ucsc_cell_browser" name="UCSC Cell Browser" version="0.5.43+galaxy1" profile="18.01">
   <description>displays single-cell clusterized data in an interactive web application.</description>
   <requirements>
     <requirement type="package" version="0.5.43">ucsc-cell-browser</requirement>
@@ -9,26 +9,41 @@
 <command><![CDATA[
 #if $input_type.expression_source == "native-cell-browser":
 
-   echo "coords = [ {'file':'$tsneCoordinates', 'shortLabel':'t-SNE on WGCNA'} ]" > ./cellbrowser.conf;
+   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";
-   mv "$html_file.extra_files_path"/index.html "$html_file";
+
+   ## "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";
-   mv "$html_file.extra_files_path"/index.html "$html_file";
+
+   ## 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 -o outdir -n sample --htmlDir "$html_file.extra_files_path";
-   mv "$html_file.extra_files_path"/index.html "$html_file";
+   cbImportScanpy -i scanpy_ann_data.h5ad
+
+   #if $input_type.marker_field:
+     --markerField '${input_type.marker_field}'
+   #end if
+
+     -o outdir -n sample --htmlDir '$html_file.extra_files_path';
+   cp '$__tool_directory__/redirect.html' '$html_file';
 
 #end if
 ]]></command>
@@ -48,12 +63,13 @@
       <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" label="Input object in AnnData hdf5 format" help="Scanpy serialized output is by default produced as an AnnData hdf5 file."/>
+      <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."/>
     </when>
   </conditional>
 </inputs>
 <outputs>
-    <data format="html" name="html_file" label="Interactive UCSC Cell Browser"/>
+    <data format="html" name="html_file" label="${tool.name} on ${on_string}: Interactive Viewer"/>
 </outputs>
 
 <tests>
@@ -116,5 +132,6 @@
   url = {https://github.com/maximilianh/cellBrowser},
  }
  </citation>
+ <citation type="doi">10.1101/2020.04.08.032698</citation>
 </citations>
 </tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/redirect.html	Fri May 29 07:09:58 2020 -0400
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML>
+<html lang="en-US">
+    <head>
+        <meta charset="UTF-8">
+        <meta http-equiv="refresh" content="0; url=index.html?ds=sample">
+        <script type="text/javascript">
+            window.location.href = "index.html?ds=sample"
+        </script>
+        <title>Page Redirection</title>
+    </head>
+    <body>
+        <!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
+        If you are not redirected automatically, follow this <a href='index.html?ds=sample'>link to example</a>.
+    </body>
+</html>