changeset 0:f1605d46cb42 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiimme_extract_viz commit 19abce82000b612039fa835391a6fb9328368d73
author iuc
date Mon, 13 May 2024 09:25:59 +0000
parents
children
files qiime_extract_viz.xml test-data/demux-summ.qzv test-data/qiime2.qzv
diffstat 3 files changed, 78 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qiime_extract_viz.xml	Mon May 13 09:25:59 2024 +0000
@@ -0,0 +1,78 @@
+<tool id="qiime_extract_viz" name="QIIME vizualisation extractor" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.01" license="MIT">
+    <description></description>
+    <macros>
+        <token name="@TOOL_VERSION@">0.1.0</token>
+        <token name="@VERSION_SUFFIX@">0</token>
+    </macros>
+    <edam_topics>
+        <edam_topic>topic_3174</edam_topic><!-- metagenomics -->
+    </edam_topics>
+    <edam_operations>
+        <edam_operation>operation_2422</edam_operation> <!-- Data retrieval -->
+    </edam_operations>
+    <requirements>
+        <requirement type="package" version="6.0">unzip</requirement>
+    </requirements>
+    <command detect_errors="exit_code"><![CDATA[
+        unzip '$infile' "*/data/*" &&
+        mkdir -p '${viz.extra_files_path}' &&
+        mv '$infile.metadata.uuid'/data/* '${viz.extra_files_path}' &&
+
+        ## the html file use <script src="./data.jsonp" charset="utf-8"></script> 
+        ## Galaxy sets application/octet-stream as mime type for which browsers
+        ## refuse to include the file. Therefore we replace the extensions by js
+        ## for which Galaxy sets the appropriate mime type
+        for nonjs in \$(cat '${viz.extra_files_path}'/*.html | grep '<script src="' | sed 's/^\s*<script src="//; s/".*//' | grep -v "\.js\$"); do
+            js=\$(echo "\$nonjs" | sed 's/\.[^.]\+$//').js &&
+            mv '${viz.extra_files_path}'"/\$nonjs" '${viz.extra_files_path}'"/\$js" &&
+            sed -i -e "s@\"\${nonjs}\"@\"\${js}\"@" '${viz.extra_files_path}'/*.html;
+        done &&
+
+        mv '${viz.extra_files_path}'/index.html '$viz'
+    ]]></command>
+    <inputs>
+        <param name="infile" type="data" format="qzv" label="QIIME visualization artifact" />
+    </inputs>
+    <outputs>
+        <data name="viz" format="html"/>
+    </outputs>
+    <tests>
+        <!--  the first test use the test data from the galaxy datatypes module
+        where the html file just contains 43 -->
+        <test>
+            <param name="infile" value="qiime2.qzv" ftype="qzv"/>
+            <output name="viz">
+                <assert_contents>
+                    <has_text text="43"/>
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="infile" value="demux-summ.qzv" ftype="qzv"/>
+            <output name="viz">
+                <assert_contents>
+                    <has_text text="html"/>
+                </assert_contents>
+            </output>
+        </test>
+    </tests>
+    <help><![CDATA[
+
+.. class:: infomark
+
+**What it does**
+
+The tool extracts visualisation from QIIME visualisation artifact datasets (qzv).
+
+QIIME visualisation artifact files are zip files that contain visualisations of the data
+which is extracted by this tool.
+
+Note that Galaxy contains a Display application that uses
+https://view.qiime2.org/ to show this data. For non-public Galaxy instances this
+does not work. 
+
+    ]]></help>
+    <citations>
+        <citation type="doi">10.1038/s41587-019-0209-9</citation>
+    </citations>
+</tool>
\ No newline at end of file
Binary file test-data/demux-summ.qzv has changed
Binary file test-data/qiime2.qzv has changed