Skip to content

Commit

Permalink
Add mg-toolkit original_metadata (#6142)
Browse files Browse the repository at this point in the history
* add mg-toolkit original_metadata

* add citation

* rename metadata.xml --> original_metadata.xml

* add license

* rename repo

* minor adjustments & input validator

* accession --> accessions

* Update tools/mg_toolkit/original_metadata.xml

* Apply suggestions from code review

* update command

* Update tools/mg_toolkit/original_metadata.xml

---------

Co-authored-by: Björn Grüning <[email protected]>
  • Loading branch information
RZ9082 and bgruening authored Jul 12, 2024
1 parent 25200b2 commit b21f516
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/mg_toolkit/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: mg_toolkit
owner: iuc
description: Metagenomics toolkit enables scientists to download all of the sample metadata for a given study or sequence to a single csv file.
homepage_url: https://github.com/EBI-Metagenomics/emg-toolkit
long_description: |
Metagenomics toolkit enables scientists to download all of the sample metadata for a given study or sequence to a single csv file.
remote_repository_url: https://github.com/galaxyproject/tools-iuc/tree/main/tools/mg-toolkit
categories:
- Metagenomics
32 changes: 32 additions & 0 deletions tools/mg_toolkit/macros.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<macros>
<token name="@TOOL_VERSION@">0.10.4</token>
<token name="@VERSION_SUFFIX@">0</token>
<xml name="requirements">
<requirements>
<requirement type="package" version="@TOOL_VERSION@">mg-toolkit</requirement>
</requirements>
</xml>
<xml name="biotools">
<xrefs>
<xref type="bio.tools">mg-toolkit</xref>
</xrefs>
</xml>
<xml name="creators">
<creator>
<person givenName="Rand" familyName="Zoabi" url="https://github.com/RZ9082" />
</creator>
</xml>
<xml name="citations">
<citations>
<citation type="bibtex">
@misc{emg_toolkit,
author = {EBI Metagenomics},
title = {EMG Toolkit},
year = {2024},
howpublished = {\url{https://github.com/EBI-metagenomics/emg-toolkit}},
note = {Accessed: 2024-07-11}
}
</citation>
</citations>
</xml>
</macros>
69 changes: 69 additions & 0 deletions tools/mg_toolkit/original_metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<tool id="mg_toolkit_original_metadata" name="Metagenomics toolkit Original Metadata" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
<description>Download original metadata for a study</description>
<macros>
<import>macros.xml</import>
</macros>
<expand macro="creators" />
<expand macro="biotools" />
<expand macro="requirements" />
<command><![CDATA[
mkdir output_metadata &&
mg-toolkit original_metadata -a ${accessions} &&
mv *.csv output_metadata
]]></command>

<inputs>
<param name="accessions" type="text" label="Accessions" help="Study/project accessions (e.g., ERP001736 SRP000319)" optional="false">
<validator type="regex" message="Accessions separated with white spaces">^([A-Za-z]{3,4}\d+)(\s[A-Za-z]{3,4}\d+)*$</validator>
</param>
</inputs>
<outputs>
<collection name="output_collection" type="list" label="Original metadata">
<discover_datasets pattern="(?P&lt;designation&gt;.+).csv" directory="output_metadata" format="csv"/>
</collection>
</outputs>
<tests>
<test>
<param name="accessions" value="ERP001736 SRP000319" />
<output_collection name="output_collection" type="list">
<element name="ERP001736">
<assert_contents>
<has_n_lines n="250" />
<has_size size="185577" />
</assert_contents>
</element>
<element name="SRP000319">
<assert_contents>
<has_n_lines n="30" />
<has_size size="2855" />
</assert_contents>
</element>
</output_collection>
</test>
<test>
<param name="accessions" value="ERP001736" />
<output_collection name="output_collection" type="list">
<element name="ERP001736">
<assert_contents>
<has_n_lines n="250" />
<has_size size="185577" />
</assert_contents>
</element>
</output_collection>
</test>
</tests>
<help>
<![CDATA[
The mg-toolkit original-metadata tool is part of the EMG Toolkit provided by EBI Metagenomics.
This tool allows users to retrieve the original metadata associated with metagenomic studies and analyses.
It facilitates the extraction of detailed contextual information submitted by researchers,
aiding in the interpretation and further analysis of metagenomic data.
License
-------
* `Apache-2.0 license <https://raw.githubusercontent.com/EBI-Metagenomics/emg-toolkit/master/LICENSE>`_
]]>
</help>
<expand macro="citations" />
</tool>

0 comments on commit b21f516

Please sign in to comment.