Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add qiime qzv visualisation extractor #4834

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" />
bernt-matthias marked this conversation as resolved.
Show resolved Hide resolved
</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.