Skip to content

Commit

Permalink
Merge pull request #4834 from bernt-matthias/topic/qiime-qzv-vis
Browse files Browse the repository at this point in the history
add qiime qzv visualisation extractor
  • Loading branch information
shiltemann authored May 13, 2024
2 parents 2564b0c + 05670a3 commit 19abce8
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tools/qiime_extract_viz/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: qiime_extract_viz
owner: iuc
description: Extract vizualization from QIIME artifacts
long_description: |
extracts visualisation from QIIME visualisation artifact datasets (qzv)
remote_repository_url: https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiimme_extract_viz
homepage_url: http://www.qiime.org
type: unrestricted
categories:
- Metagenomics
78 changes: 78 additions & 0 deletions tools/qiime_extract_viz/qiime_extract_viz.xml
Original file line number Diff line number Diff line change
@@ -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>
Binary file added tools/qiime_extract_viz/test-data/demux-summ.qzv
Binary file not shown.
Binary file added tools/qiime_extract_viz/test-data/qiime2.qzv
Binary file not shown.

0 comments on commit 19abce8

Please sign in to comment.