Skip to content

Commit

Permalink
Merge pull request Helmholtz-UFZ#30 from Helmholtz-UFZ/virsorter
Browse files Browse the repository at this point in the history
Add virsorter
  • Loading branch information
bernt-matthias authored Jun 23, 2024
2 parents 0d3034a + 1818676 commit fdde667
Show file tree
Hide file tree
Showing 13 changed files with 383 additions and 0 deletions.
10 changes: 10 additions & 0 deletions data_managers/data_manager_virsorter/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
categories:
- Data Managers
- Metagenomics
description: Data managers for virsorter reference data
homepage_url: https://github.com/jiarong/VirSorter2
long_description: Data managers for virsorter reference data
name: virsorter_build_database
owner: ufz
remote_repository_url: https://github.com/Helmholtz-UFZ/ufz-galaxy-tools/blob/main/data_managers/data_manager_virsorter
type: unrestricted
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0"?>
<tool id="virsorter_build_database" name="virsorter" tool_type="manage_data" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
<description>database builder</description>
<macros>
<token name="@TOOL_VERSION@">2.2.4</token> <!-- when updating make sure to double check the db version -->
<token name="@VERSION_SUFFIX@">0</token>
<token name="@PROFILE@">22.01</token>
<!-- zenodo ID and therebut the version of the reference data is hardcoded in the current version virsorter:
https://github.com/jiarong/VirSorter2/blob/c0dcac53f3373244bf1bd552a7c2104d53802df7/virsorter/rules/setup.smk#L13
check and update the DB version when updating the VS version
might also change/improve in the future https://github.com/jiarong/VirSorter2/issues/205#issuecomment-2184184977
-->
<token name="@VIRSORTER_DB_VERSION@">0.4</token>
</macros>
<requirements>
<requirement type="package" version="@TOOL_VERSION@">virsorter</requirement>
<requirement type="package" version="1.21.4">wget</requirement>
<requirement type="package" version="2.7.0">pulp</requirement> <!-- needs to be pinned, because the old-ish snakemake used in vs2 struggles with https://github.com/snakemake/snakemake/issues/2607 -->
</requirements>
<command detect_errors="exit_code"><![CDATA[
virsorter setup -d db -j \${GALAXY_SLOTS:-1} --skip-deps-install &&
cp '$dmjson' '$out_file'
]]></command>
<configfiles>
<configfile name="dmjson"><![CDATA[
{
"data_tables":{
"virsorter":[
{
"path":"db",
"name":"Version @VIRSORTER_DB_VERSION@",
"virsorter_version":"@TOOL_VERSION@",
"value":"@VIRSORTER_DB_VERSION@"
}
]
}
}]]>
</configfile>
</configfiles>
<inputs/>
<outputs>
<data name="out_file" format="data_manager_json" />
</outputs>
<tests>
<test expect_num_outputs="1">
<output name="out_file">
<assert_contents>
<has_text text='"value":"@VIRSORTER_DB_VERSION@"'/>
<has_text text='"name":"Version @VIRSORTER_DB_VERSION@"'/>
</assert_contents>
</output>
</test>
</tests>
<help><![CDATA[
Download and extract virsorter database version @VIRSORTER_DB_VERSION@ from zenodo (https://zenodo.org/records/10594875)
]]></help>
<citations>
<citation type="doi">10.1186/s40168-020-00990-y</citation>
</citations>
</tool>
19 changes: 19 additions & 0 deletions data_managers/data_manager_virsorter/data_manager_conf.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<data_managers>
<data_manager tool_file="data_manager/virsorter_datamanager.xml" id="virsorter_build_database">
<data_table name="virsorter">
<output>
<column name="value"/>
<column name="name"/>
<column name="virsorter_version"/>
<column name="path" output_ref="out_file">
<move type="directory">
<source>${path}</source>
<target base="${GALAXY_DATA_MANAGER_DATA_PATH}">virsorter/${path}</target>
</move>
<value_translation>${GALAXY_DATA_MANAGER_DATA_PATH}/virsorter/${path}</value_translation>
<value_translation type="function">abspath</value_translation>
</column>
</output>
</data_table>
</data_manager>
</data_managers>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Format:
# value name virsorter_version path
# value must be the version of the database, e.g. 0.4, needs to be a number
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<tables>
<!-- virsorter reference data -->
<table name="virsorter" comment_char="#">
<!-- value should be the version (https://zenodo.org/records/4297575) -->
<columns>value, name, virsorter_version, path</columns>
<file path="tool-data/virsorter.loc" />
</table>
</tables>
18 changes: 18 additions & 0 deletions tools/virsorter/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
categories:
- Metagenomics
description: VirSorter2 applies a multi-classifier, expert-guided approach to detect diverse DNA and RNA virus genomes.
long_description: |
VirSorter2 applies a multi-classifier, expert-guided approach to detect diverse DNA and RNA virus genomes.
name: virsorter
owner: ufz
homepage_url: https://github.com/jiarong/VirSorter2/
remote_repository_url: https://github.com/Helmholtz-UFZ/ufz-galaxy-tools/blob/main/tools/virsorter
type: unrestricted
auto_tool_repositories:
name_template: "{{ tool_id }}"
description_template: "Wrapper for virsorter function: {{ tool_name }}."
suite:
name: "suite_virsorter"
description: "A suite of tools that brings the virsorter project into Galaxy."
long_description: |
VirSorter2 applies a multi-classifier, expert-guided approach to detect diverse DNA and RNA virus genomes.
4 changes: 4 additions & 0 deletions tools/virsorter/test-data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

cd test-data/
wget -O - https://osf.io/v46sc/download | tar -xvz
6 changes: 6 additions & 0 deletions tools/virsorter/test-data/8seq.fa

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions tools/virsorter/test-data/virsorter.loc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# value name path
# value must be the version of the database, e.g. 0.4, needs to be a number
0.4 virsorter 0.4 2.2.4 ${__HERE__}/db/
3 changes: 3 additions & 0 deletions tools/virsorter/tool-data/virsorter.loc.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Your virsorter.loc file should include an entry per line
# value should be db version, i.e. a number
#value name virsorter_version path
10 changes: 10 additions & 0 deletions tools/virsorter/tool_data_table_conf.xml.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<tables>
<!-- Locations of indexes for virsorter, since reference data seems not to be versioned we use the download date as version -->
<table name="virsorter" comment_char="#">
<columns>value, name, virsorter_version, path</columns>
<file path="tool-data/virsorter.loc" />
</table>
</tables>


6 changes: 6 additions & 0 deletions tools/virsorter/tool_data_table_conf.xml.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<tables>
<table name="virsorter" comment_char="#">
<columns>value, name, virsorter_version, path</columns>
<file path="${__HERE__}/test-data/virsorter.loc" />
</table>
</tables>
Loading

0 comments on commit fdde667

Please sign in to comment.