# HG changeset patch
# User iuc
# Date 1629960885 0
# Node ID ef7f9e2f32f21178b9364ec879524cf305acd68f
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_funannotate commit 9613152729099079c7465c3d5d42005ef22ca91e"
diff -r 000000000000 -r ef7f9e2f32f2 data_manager/funannotate.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data_manager/funannotate.py	Thu Aug 26 06:54:45 2021 +0000
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+
+import argparse
+import json
+import operator
+import os
+import subprocess
+import sys
+from datetime import datetime
+
+
+if __name__ == "__main__":
+
+    parser = argparse.ArgumentParser()
+    parser.add_argument('--partial', dest='partial', action='store_true', help='Only download a small subset of data (for testing)')
+    parser.add_argument("version_id")
+    parser.add_argument("datatable_name")
+    parser.add_argument("galaxy_datamanager_filename")
+    args = parser.parse_args()
+
+    with open(args.galaxy_datamanager_filename) as fh:
+        config = json.load(fh)
+
+    output_directory = config.get("output_data", [{}])[0].get("extra_files_path", None)
+    data_manager_dict = {}
+    data_manager_dict["data_tables"] = config.get("data_tables", {})
+    data_manager_dict["data_tables"][args.datatable_name] = data_manager_dict[
+        "data_tables"
+    ].get(args.datatable_name, [])
+
+    os.mkdir(output_directory)
+    cmd_args = ['funannotate', 'setup', '-d', output_directory, '-b', 'all']
+    if args.partial:
+        cmd_args += ['-i', 'merops', '-b', 'eukaryota']
+    proc = subprocess.Popen(args=cmd_args, shell=False, cwd=output_directory)
+    return_code = proc.wait()
+    if return_code:
+        print("Error downloading Funannotate database.", file=sys.stderr)
+        sys.exit(return_code)
+
+    version_id = datetime.today().strftime('%Y-%m-%d-%H%M%S')
+
+    version = '1.0'
+
+    data_manager_dict["data_tables"][args.datatable_name].append(
+        dict(
+            value=version_id,
+            description="Funannotate database %s" % version_id,
+            format_version=version,
+            path=output_directory,
+        )
+    )
+
+    data_manager_dict["data_tables"][args.datatable_name].sort(
+        key=operator.itemgetter("value"), reverse=True
+    )
+    with open(args.galaxy_datamanager_filename, "w") as fh:
+        json.dump(data_manager_dict, fh, indent=2, sort_keys=True)
diff -r 000000000000 -r ef7f9e2f32f2 data_manager/funannotate.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data_manager/funannotate.xml	Thu Aug 26 06:54:45 2021 +0000
@@ -0,0 +1,39 @@
+
+    
+        funannotate
+    
+    funannotate check --show-versions
+    
+    
+        
+    
+    
+        
+    
+    
+        
+            
+            
+        
+    
+    
+    
+        10.5281/zenodo.4054262
+    
+
diff -r 000000000000 -r ef7f9e2f32f2 data_manager_conf.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data_manager_conf.xml	Thu Aug 26 06:54:45 2021 +0000
@@ -0,0 +1,19 @@
+
+
+    
+        
+            
+        
+    
+
diff -r 000000000000 -r ef7f9e2f32f2 test-data/funannotate.loc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/funannotate.loc	Thu Aug 26 06:54:45 2021 +0000
@@ -0,0 +1,9 @@
+# this is a tab separated file describing the location of funannotate databases used for the
+# funannotate annotation tool
+#
+# the columns are:
+# value  description format_version	path
+#
+# 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
diff -r 000000000000 -r ef7f9e2f32f2 tool-data/funannotate.loc.sample
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/funannotate.loc.sample	Thu Aug 26 06:54:45 2021 +0000
@@ -0,0 +1,8 @@
+# this is a tab separated file describing the location of funannotate databases used for the
+# funannotate annotation tool
+#
+# the columns are:
+# value  description format_version	path
+#
+# for example
+# 2021-07-20-120000	Funannotate database 2021-07-20-120000	1.0	/tmp/database/funannotate/funannotate/2021-07-20-120000
diff -r 000000000000 -r ef7f9e2f32f2 tool_data_table_conf.xml.sample
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_data_table_conf.xml.sample	Thu Aug 26 06:54:45 2021 +0000
@@ -0,0 +1,6 @@
+
+    
+        value, description, format_version, path
+        
+    
+
diff -r 000000000000 -r ef7f9e2f32f2 tool_data_table_conf.xml.test
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_data_table_conf.xml.test	Thu Aug 26 06:54:45 2021 +0000
@@ -0,0 +1,6 @@
+
+    
+        value, description, format_version, path
+        
+    
+