changeset 3:4d60b98f85fe draft

planemo upload for repository https://github.com/ASaiM/galaxytools/tree/master/data_managers/data_manager_metaphlan2_database_downloader commit d474c6ecde051fa66db3635ba28bbbf28623cfdc-dirty
author bebatut
date Tue, 21 Feb 2017 05:35:13 -0500
parents 923507cb8756
children a32443fcfb30
files data_manager/data_manager_metaphlan2_download.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/data_manager_metaphlan2_download.py	Tue Feb 21 05:30:28 2017 -0500
+++ b/data_manager/data_manager_metaphlan2_download.py	Tue Feb 21 05:35:13 2017 -0500
@@ -78,7 +78,7 @@
         raise Exception("add_data_table_entry: no table '%s'" % table)
 
 
-def download_metaphlan2_db(data_tables, table_name, target_dir):
+def download_metaphlan2_db(data_tables, build, table_name, target_dir):
     """Download MetaPhlAn2 database
 
     Creates references to the specified file(s) on the Galaxy
@@ -95,7 +95,7 @@
 
     """
     today = datetime.date.today()
-    db_target_dir = os.path.join(target_dir, database, build)
+    db_target_dir = os.path.join(target_dir, build)
     os.makedirs(db_target_dir)
     cmd = "metaphlan2_databases --output %s" % (db_target_dir)
     subprocess.check_call(cmd, shell=True)
@@ -103,7 +103,7 @@
         data_tables,
         table_name,
         dict(
-            dbkey="db_v20",
+            dbkey=build,
             value=today.isoformat(),
             name="MetaPhlAn2 clade-specific marker genes"))
 
@@ -140,6 +140,7 @@
     if options.database == "db_v20":
         download_metaphlan2_db(
             data_tables,
+            "db_v20"
             "metaphlan2_database",
             target_dir)