# HG changeset patch
# User iuc
# Date 1741386809 0
# Node ID 5459ec34767a384439c2f1f146c53473ace23e69
# Parent  1c81a82b5b8e1e04b71b24e694e0e3077f16d147
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/data_managers/data_manager_funannotate commit 8341270dd36185ebf59d15282bc79f1215e936a4
diff -r 1c81a82b5b8e -r 5459ec34767a data_manager/extract.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data_manager/extract.py	Fri Mar 07 22:33:29 2025 +0000
@@ -0,0 +1,49 @@
+import json
+import os
+import sys
+
+fun_db = sys.argv[1]
+fun_db_value = sys.argv[2]
+dmjson = sys.argv[3]
+
+content = []
+# get options for parameter --busco_db
+# which are just the subfolders of the db dir (minus outgroups/ and trained_species/)
+# https://github.com/nextgenusfs/funannotate/blob/8cc40728fee61566fdf736c1f2292e14cc117660/funannotate/predict.py#L319
+for d in os.scandir(fun_db):
+    if not d.is_dir():
+        continue
+    if d.name in ['outgroups', 'trained_species']:
+        continue
+    if not os.path.exists(os.path.join(d, "dataset.cfg")):
+        continue
+    name = d.name.replace("_", " ").capitalize()
+    content.append({'value': d.name, 'name': name, 'select': 'busco_db', 'db_value': fun_db_value})
+
+# --busco_seed_species
+# trained_species
+for d in os.scandir(os.path.join(fun_db, "trained_species")):
+    if not d.is_dir():
+        continue
+    if not os.path.exists(os.path.join(d, "info.json")):
+        continue
+    name = d.name.replace("_", " ").capitalize()
+    content.append({'value': d.name, 'name': name, 'select': 'trained_species', 'db_value': fun_db_value})
+
+# --busco_seed_species
+# outgroups
+for f in os.scandir(os.path.join(fun_db, "outgroups")):
+    if f.is_dir():
+        continue
+    if not f.name.endswith("_buscos.fa"):
+        continue
+    value = f.name[:-10]
+    name = ' - '.join([x.replace("_", " ").capitalize() for x in value.split('.')])
+    content.append({'value': value, 'name': name, 'select': 'outgroup', 'db_value': fun_db_value})
+
+with open(dmjson, "w") as fh:
+    json.dump({"data_tables": {"funannotate_options": content}}, fh)
+
+print(f'{len([c for c in content if c["select"]=="busco_db"])} x busco_db\n')
+print(f'{len([c for c in content if c["select"]=="trained_species"])} x trained_species\n')
+print(f'{len([c for c in content if c["select"]=="outgroup"])} x outgroup\n')
diff -r 1c81a82b5b8e -r 5459ec34767a data_manager/funannotate.xml
--- a/data_manager/funannotate.xml	Fri Mar 07 22:33:21 2025 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-
-    
-        1.8.15
-        0
-    
-    
-        funannotate
-    
-    funannotate check --show-versions
-     \$HOME/.wgetrc &&
-        #end if
-
-        funannotate setup
-            -d '$output_file.extra_files_path'
-        #if $partial_data
-            -i merops -b eukaryota
-        #else
-            -b all
-        #end if
-            $wget
-        &&
-        cp '$dmjson' '$output_file'
-    ]]>
-    
-        
-    
-    
-        
-        
-    
-    
-        
-    
-    
-        
-            
-            
-        
-        
-            
-            
-            
-        
-    
-    
-    
-        10.5281/zenodo.4054262
-    
-
diff -r 1c81a82b5b8e -r 5459ec34767a data_manager/funannotate_options.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data_manager/funannotate_options.xml	Fri Mar 07 22:33:29 2025 +0000
@@ -0,0 +1,61 @@
+
+    
+        1.8.15
+        0
+    
+    
+        funannotate
+    
+    funannotate check --show-versions
+     /dev/null &&
+            #set db_path="./test"
+        #else
+            #set db_path=$database.fields.path
+        #end if
+        python '$__tool_directory__/extract.py' '$db_path' '$database' '$output_file'
+    ]]>
+    
+        
+        
+            
+                
+                
+                
+                
+                
+            
+        
+    
+    
+        
+    
+    
+        
+            
+            
+            
+            
+                
+                
+                
+            
+        
+    
+    
+    
+        10.5281/zenodo.4054262
+    
+
diff -r 1c81a82b5b8e -r 5459ec34767a data_manager_conf.xml
--- a/data_manager_conf.xml	Fri Mar 07 22:33:21 2025 +0000
+++ b/data_manager_conf.xml	Fri Mar 07 22:33:29 2025 +0000
@@ -1,18 +1,12 @@
 
 
-    
-        
+    
+        
             
         
     
diff -r 1c81a82b5b8e -r 5459ec34767a test-data/funannotate.loc
--- a/test-data/funannotate.loc	Fri Mar 07 22:33:21 2025 +0000
+++ b/test-data/funannotate.loc	Fri Mar 07 22:33:29 2025 +0000
@@ -7,10 +7,4 @@
 # for example
 # 2021-07-20-120000	Funannotate database 2021-07-20-120000	1.0	/tmp/database/funannotate/2021-07-20-120000
 # 2021-05-27-120000	Funannotate database 2021-05-27-120000	3.0	/tmp/database/funannotate/2021-05-27-120000
-2025-02-17-000000	Funannotate database 2025-02-17-000000		/tmp/tmpm1ezjinx/galaxy-dev/tool-data/funannotate/2025-02-17-000000
-2025-02-17-210445	Funannotate database 2025-02-17-210445		/tmp/tmpg0tuguj6/galaxy-dev/tool-data/funannotate/2025-02-17-210445
-2025-02-17-210504	Funannotate database 2025-02-17-210504		/tmp/tmpg0tuguj6/galaxy-dev/tool-data/funannotate/2025-02-17-210504
-2025-02-17-210714	Funannotate database 2025-02-17-210714	1.0	/tmp/tmpdtjxf3c7/galaxy-dev/tool-data/funannotate/2025-02-17-210714
-2025-02-17-210732	Funannotate database 2025-02-17-210732	1.0	/tmp/tmpdtjxf3c7/galaxy-dev/tool-data/funannotate/2025-02-17-210732
-2025-02-17-211010	Funannotate database 2025-02-17-211010	1.0	/tmp/tmp07fm9fgh/galaxy-dev/tool-data/funannotate/2025-02-17-211010
-2025-02-17-211028	Funannotate database 2025-02-17-211028	1.0	/tmp/tmp07fm9fgh/galaxy-dev/tool-data/funannotate/2025-02-17-211028
+test	Funannotate database Test	1.0	./test/
diff -r 1c81a82b5b8e -r 5459ec34767a test-data/funannotate_options.loc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/funannotate_options.loc	Fri Mar 07 22:33:29 2025 +0000
@@ -0,0 +1,9 @@
+# this is a tab separated file describing options available for selects in the funannotate tool
+# these options are derived separetely for each funannotate DB
+#
+# the columns are:
+# value	name	select	db_value
+#
+# db_value is the ID of the funannotate DB
+# value and name are the value and name to be used
+# select describes the command line parameter / select for which the values can be used
\ No newline at end of file
diff -r 1c81a82b5b8e -r 5459ec34767a tool-data/funannotate_options.loc.sample
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/funannotate_options.loc.sample	Fri Mar 07 22:33:29 2025 +0000
@@ -0,0 +1,9 @@
+# this is a tab separated file describing options available for selects in the funannotate tool
+# these options are derived separetely for each funannotate DB
+#
+# the columns are:
+# value	name	select	db_value
+#
+# db_value is the ID of the funannotate DB
+# value and name are the value and name to be used
+# select describes the command line parameter / select for which the values can be used
\ No newline at end of file
diff -r 1c81a82b5b8e -r 5459ec34767a tool_data_table_conf.xml.sample
--- a/tool_data_table_conf.xml.sample	Fri Mar 07 22:33:21 2025 +0000
+++ b/tool_data_table_conf.xml.sample	Fri Mar 07 22:33:29 2025 +0000
@@ -3,4 +3,8 @@
         value, description, format_version, path
         
     
+    
+        value, name, select, db_value
+        
+    
 
diff -r 1c81a82b5b8e -r 5459ec34767a tool_data_table_conf.xml.test
--- a/tool_data_table_conf.xml.test	Fri Mar 07 22:33:21 2025 +0000
+++ b/tool_data_table_conf.xml.test	Fri Mar 07 22:33:29 2025 +0000
@@ -3,4 +3,8 @@
         value, description, format_version, path
         
     
+    
+        value, name, select, db_value
+        
+