changeset 0:4e3bbaa0b70f draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_fetch_busco/ commit 32f1099f18b41bf1efd1a039daf732809c77269e
author iuc
date Tue, 22 Apr 2025 13:12:07 +0000
parents
children
files data_manager/busco_options.xml data_manager/extract.py data_manager_conf.xml test-data/busco_database.loc test-data/busco_database_options.loc tool-data/busco_database.loc.sample tool-data/busco_database_options.loc.sample tool_data_table_conf.xml.sample tool_data_table_conf.xml.test
diffstat 9 files changed, 198 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data_manager/busco_options.xml	Tue Apr 22 13:12:07 2025 +0000
@@ -0,0 +1,47 @@
+<tool id="busco_fetcher_options" name="Busco options" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" tool_type="manage_data" profile="23.1">
+    <description></description>
+        <macros>
+        <token name="@TOOL_VERSION@">5.8.0</token>
+        <token name="@VERSION_SUFFIX@">0</token>
+    </macros>
+    <requirements>
+        <requirement type="package" version="@TOOL_VERSION@">busco</requirement>
+    </requirements>
+    <command detect_errors="exit_code"><![CDATA[
+        #if $test:
+            busco --download_path test/ --download virus > /dev/null &&
+            #set db_path="./test"
+        #else
+            #set db_path=$cached_db.fields.path
+        #end if
+        python '$__tool_directory__/extract.py' '$db_path' '$cached_db' '$out_file'
+    ]]></command>
+    <inputs>
+        <param name="test" type="hidden"/>
+        <param name="cached_db" label="Cached database with lineage" type="select">
+            <options from_data_table="busco_database">
+                <validator message="No BUSCO database is available" type="no_options"/>
+            </options>
+        </param>
+    </inputs>
+    <outputs>
+        <data name="out_file" format="data_manager_json" label="BUSCO options data manager: JSON"/>
+    </outputs>
+    <tests>
+        <test expect_num_outputs="1">
+            <param name="test" value="true"/>
+            <param name="cached_db" value="test"/>
+            <output name="out_file">
+                <assert_contents>
+                    <has_text text="busco_database_options"/>
+                    <has_text text="Chordopoxvirinae"/>
+                    <has_text text="chordopoxvirinae_"/>
+                </assert_contents>
+            </output>
+        </test>
+    </tests>
+    <help>This tool determines the possible choices of BUSCO lineages in a given BUSCO DB.</help>
+    <citations>
+        <citation type="doi">10.1093/bioinformatics/btv351</citation>
+    </citations>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data_manager/extract.py	Tue Apr 22 13:12:07 2025 +0000
@@ -0,0 +1,23 @@
+import json
+import os
+import re
+import sys
+
+busco_db = os.path.join(sys.argv[1], "lineages")
+busco_db_value = sys.argv[2]
+dmjson = sys.argv[3]
+
+content = []
+for d in os.scandir(busco_db):
+    if not d.is_dir():
+        continue
+    if not os.path.exists(os.path.join(d, "dataset.cfg")):
+        continue
+    name = re.sub(r"_odb\d+", "", d.name)
+    name = name.replace("_", " ").capitalize()
+    content.append({'value': d.name, 'name': name, 'db_value': busco_db_value})
+
+with open(dmjson, "w") as fh:
+    json.dump({"data_tables": {"busco_database_options": content}}, fh)
+
+print(f'{len(content)} x busco_db\n')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data_manager_conf.xml	Tue Apr 22 13:12:07 2025 +0000
@@ -0,0 +1,12 @@
+<data_managers>
+    <data_manager tool_file="data_manager/busco_options.xml" id="busco_fetcher_options" version="5.4.6+galaxy0">
+        <data_table name="busco_database_options">
+            <output>
+                <column name="value" />
+                <column name="name" />
+                <column name="db_value"/>
+            </output>
+        </data_table>
+
+    </data_manager>
+</data_managers>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/busco_database.loc	Tue Apr 22 13:12:07 2025 +0000
@@ -0,0 +1,1 @@
+test	test name	test	test
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/busco_database_options.loc	Tue Apr 22 13:12:07 2025 +0000
@@ -0,0 +1,81 @@
+iridoviridae_odb10	Iridoviridae	test
+betabaculovirus_odb10	Betabaculovirus	test
+betaherpesvirinae_odb10	Betaherpesvirinae	test
+skunavirus_odb10	Skunavirus	test
+chordopoxvirinae_odb10	Chordopoxvirinae	test
+alphabaculovirus_odb10	Alphabaculovirus	test
+rudiviridae_odb10	Rudiviridae	test
+tevenvirinae_odb10	Tevenvirinae	test
+tunavirinae_odb10	Tunavirinae	test
+varicellovirus_odb10	Varicellovirus	test
+pahexavirus_odb10	Pahexavirus	test
+guernseyvirinae_odb10	Guernseyvirinae	test
+baculoviridae_odb10	Baculoviridae	test
+alphaherpesvirinae_odb10	Alphaherpesvirinae	test
+spounavirinae_odb10	Spounavirinae	test
+peduovirus_odb10	Peduovirus	test
+enquatrovirus_odb10	Enquatrovirus	test
+teseptimavirus_odb10	Teseptimavirus	test
+gammaherpesvirinae_odb10	Gammaherpesvirinae	test
+herpesviridae_odb10	Herpesviridae	test
+cheoctovirus_odb10	Cheoctovirus	test
+poxviridae_odb10	Poxviridae	test
+fromanvirus_odb10	Fromanvirus	test
+bclasvirinae_odb10	Bclasvirinae	test
+simplexvirus_odb10	Simplexvirus	test
+tequatrovirus_odb10	Tequatrovirus	test
+aviadenovirus_odb10	Aviadenovirus	test
+iridoviridae_odb10	Iridoviridae	test
+betabaculovirus_odb10	Betabaculovirus	test
+betaherpesvirinae_odb10	Betaherpesvirinae	test
+skunavirus_odb10	Skunavirus	test
+chordopoxvirinae_odb10	Chordopoxvirinae	test
+alphabaculovirus_odb10	Alphabaculovirus	test
+rudiviridae_odb10	Rudiviridae	test
+tevenvirinae_odb10	Tevenvirinae	test
+tunavirinae_odb10	Tunavirinae	test
+varicellovirus_odb10	Varicellovirus	test
+pahexavirus_odb10	Pahexavirus	test
+guernseyvirinae_odb10	Guernseyvirinae	test
+baculoviridae_odb10	Baculoviridae	test
+alphaherpesvirinae_odb10	Alphaherpesvirinae	test
+spounavirinae_odb10	Spounavirinae	test
+peduovirus_odb10	Peduovirus	test
+enquatrovirus_odb10	Enquatrovirus	test
+teseptimavirus_odb10	Teseptimavirus	test
+gammaherpesvirinae_odb10	Gammaherpesvirinae	test
+herpesviridae_odb10	Herpesviridae	test
+cheoctovirus_odb10	Cheoctovirus	test
+poxviridae_odb10	Poxviridae	test
+fromanvirus_odb10	Fromanvirus	test
+bclasvirinae_odb10	Bclasvirinae	test
+simplexvirus_odb10	Simplexvirus	test
+tequatrovirus_odb10	Tequatrovirus	test
+aviadenovirus_odb10	Aviadenovirus	test
+iridoviridae_odb10	Iridoviridae	test
+betabaculovirus_odb10	Betabaculovirus	test
+betaherpesvirinae_odb10	Betaherpesvirinae	test
+skunavirus_odb10	Skunavirus	test
+chordopoxvirinae_odb10	Chordopoxvirinae	test
+alphabaculovirus_odb10	Alphabaculovirus	test
+rudiviridae_odb10	Rudiviridae	test
+tevenvirinae_odb10	Tevenvirinae	test
+tunavirinae_odb10	Tunavirinae	test
+varicellovirus_odb10	Varicellovirus	test
+pahexavirus_odb10	Pahexavirus	test
+guernseyvirinae_odb10	Guernseyvirinae	test
+baculoviridae_odb10	Baculoviridae	test
+alphaherpesvirinae_odb10	Alphaherpesvirinae	test
+spounavirinae_odb10	Spounavirinae	test
+peduovirus_odb10	Peduovirus	test
+enquatrovirus_odb10	Enquatrovirus	test
+teseptimavirus_odb10	Teseptimavirus	test
+gammaherpesvirinae_odb10	Gammaherpesvirinae	test
+herpesviridae_odb10	Herpesviridae	test
+cheoctovirus_odb10	Cheoctovirus	test
+poxviridae_odb10	Poxviridae	test
+fromanvirus_odb10	Fromanvirus	test
+bclasvirinae_odb10	Bclasvirinae	test
+simplexvirus_odb10	Simplexvirus	test
+tequatrovirus_odb10	Tequatrovirus	test
+aviadenovirus_odb10	Aviadenovirus	test
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/busco_database.loc.sample	Tue Apr 22 13:12:07 2025 +0000
@@ -0,0 +1,8 @@
+#This is a sample file distributed with Galaxy that enables tools
+#to use a directory of busco files.  
+#file has this format (white space characters are TAB characters)
+# - value
+# - name
+# - version
+# - /path/to/data 
+#virus_lineage_1.0	 Virus_Lineage_1.0  5.4.6	/path/to/data
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/busco_database_options.loc.sample	Tue Apr 22 13:12:07 2025 +0000
@@ -0,0 +1,6 @@
+#This is a sample file distributed with Galaxy that enables tools
+#to use fill the select for the available BUSCO lineages
+#file has this format (white space characters are TAB characters)
+# - value: value used in the options
+# - name: name shown to the user in options
+# - db_value: the id/value of the busco db (in the busco_database data table)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_data_table_conf.xml.sample	Tue Apr 22 13:12:07 2025 +0000
@@ -0,0 +1,10 @@
+<tables>
+    <table name="busco_database" comment_char="#">
+        <columns>value, name, version, path</columns>
+        <file path="tool-data/busco_database.loc" />
+    </table>
+    <table name="busco_database_options" comment_char="#">
+        <columns>value, name, db_value</columns>
+        <file path="tool-data/busco_database_options.loc" />
+    </table>
+</tables>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_data_table_conf.xml.test	Tue Apr 22 13:12:07 2025 +0000
@@ -0,0 +1,10 @@
+<tables>
+    <table name="busco_database" comment_char="#">
+        <columns>value, name, version, path</columns>
+        <file path="${__HERE__}/test-data/busco_database.loc" />
+    </table>
+    <table name="busco_database_options" comment_char="#">
+        <columns>value, name, db_value</columns>
+        <file path="${__HERE__}/test-data/busco_database_options.loc" />
+    </table>
+</tables>