changeset 3:bdd8632fa9fb draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_fetch_ncbi_taxonomy/ commit 1bcd553f81064957d5786302361675c29ed58a8d"
author iuc
date Mon, 06 Jul 2020 19:32:35 -0400
parents 4af4e175db0d
children d6acd5cd497b
files data_manager/data_manager.py data_manager/ncbi_taxonomy_fetcher.xml test-data/ncbi_taxonomy.loc test-data/taxonomy.json tool-data/ncbi_taxonomy.loc.sample tool_data_table_conf.xml.test
diffstat 6 files changed, 35 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/data_manager.py	Tue Apr 28 03:57:59 2020 -0400
+++ b/data_manager/data_manager.py	Mon Jul 06 19:32:35 2020 -0400
@@ -5,12 +5,7 @@
 import shutil
 import tarfile
 import zipfile
-try:
-    # For Python 3.0 and later
-    from urllib.request import Request, urlopen
-except ImportError:
-    # Fall back to Python 2 imports
-    from urllib2 import Request, urlopen
+from urllib.request import Request, urlopen
 
 
 def url_download(url, workdir):
--- a/data_manager/ncbi_taxonomy_fetcher.xml	Tue Apr 28 03:57:59 2020 -0400
+++ b/data_manager/ncbi_taxonomy_fetcher.xml	Mon Jul 06 19:32:35 2020 -0400
@@ -1,6 +1,9 @@
 <?xml version="1.0"?>
-<tool id="ncbi_taxonomy_fetcher" name="NCBI" tool_type="manage_data" version="1.0.1">
+<tool id="ncbi_taxonomy_fetcher" name="NCBI" tool_type="manage_data" version="1.0.2">
     <description>taxonomy downloader</description>
+    <requirements>
+        <requirement type="package" version="3.7">python</requirement>
+    </requirements>
     <command detect_errors="exit_code">
     <![CDATA[
         python '$__tool_directory__/data_manager.py' --out '${out_file}'
@@ -19,4 +22,15 @@
     <outputs>
         <data name="out_file" format="data_manager_json" />
     </outputs>
+    <tests>
+        <test>
+            <param name="database_name" value="tax_name"/>
+            <param name="database_id" value="tax_id"/>
+            <output name="out_file" value="taxonomy.json"/>
+        </test>
+    </tests>
+    <help>
+        Download a taxonomy dump from a provided URL.
+        The default URL is the latest dump from NCBI taxonomy.
+    </help>
 </tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/ncbi_taxonomy.loc	Mon Jul 06 19:32:35 2020 -0400
@@ -0,0 +1,5 @@
+# Tab separated fields where
+# value is unique key
+# name is descriptive name
+# path is path to directory containing names.dmp and nodes.dmp files
+#value	name	path
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/taxonomy.json	Mon Jul 06 19:32:35 2020 -0400
@@ -0,0 +1,1 @@
+{"data_tables": {"ncbi_taxonomy": {"name": "tax_name", "path": ".", "value": "tax_name"}}}
\ No newline at end of file
--- a/tool-data/ncbi_taxonomy.loc.sample	Tue Apr 28 03:57:59 2020 -0400
+++ b/tool-data/ncbi_taxonomy.loc.sample	Mon Jul 06 19:32:35 2020 -0400
@@ -0,0 +1,5 @@
+# Tab separated fields where
+# value is unique key
+# name is descriptive name
+# path is path to directory containing names.dmp and nodes.dmp files
+#value	name	path
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_data_table_conf.xml.test	Mon Jul 06 19:32:35 2020 -0400
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<tables>
+    <!-- Locations of taxonomy data downloaded from NCBI -->
+    <table name="ncbi_taxonomy" comment_char="#">
+        <columns>value, name, path</columns>
+        <file path="${__HERE__}/test-data/ncbi_taxonomy.loc" />
+    </table>
+</tables>