changeset 11:01d511f950d9 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_sortmerna_database_downloader commit a17ff4bb67251145f59ed1f4b437b4950308db08-dirty
author bebatut
date Mon, 12 Jun 2017 10:50:07 -0400
parents d2a91cfb9eef
children 1cb13ad2d59b
files data_manager/data_manager_sortmerna_download.py
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/data_manager_sortmerna_download.py	Mon Jun 12 10:25:42 2017 -0400
+++ b/data_manager/data_manager_sortmerna_download.py	Mon Jun 12 10:50:07 2017 -0400
@@ -126,12 +126,14 @@
         if not filename.endswith("fasta"):
             continue
         input_filepath = os.path.join(file_dir, filename)
-        output_dir = os.path.join(target_dir, filename)
-        os.mkdir(output_dir)
+        # Extract the db name
         db_name = os.path.splitext(filename)[0]
-        fasta_filepath = os.path.join(output_dir, "%s.fasta" % db_name)
-        indexed_filepath = os.path.join(output_dir, db_name)
-        # Move file
+        # Create the directory where to put the fasta files and indexed files
+        filedir = os.path.join(target_dir, filename)
+        os.mkdir(filedir)
+        fasta_filepath = os.path.join(filedir, "%s.fasta" % db_name)
+        indexed_filepath = os.path.join(filedir, db_name)
+        # Move the fasta file
         os.rename(input_filepath, fasta_filepath)
         # Index the file with indexdb_rna
         command = "indexdb_rna --ref %s,%s" % (