# HG changeset patch
# User rnateam
# Date 1497369788 14400
# Node ID 7d2252852f964baf0c6483c66b25372ccf4b103d
# Parent 30bb49887172cb0239ecad35fdc446626d34377c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_sortmerna_database_downloader commit 4241c1d4b05a177bd2c74f5a139f51d4f65e0b55
diff -r 30bb49887172 -r 7d2252852f96 data_manager/data_manager_sortmerna_download.py
--- a/data_manager/data_manager_sortmerna_download.py Tue Jun 06 13:40:27 2017 -0400
+++ b/data_manager/data_manager_sortmerna_download.py Tue Jun 13 12:03:08 2017 -0400
@@ -4,6 +4,7 @@
import argparse
import json
import os
+import shutil
import tarfile
import requests
import subprocess
@@ -126,23 +127,28 @@
if not filename.endswith("fasta"):
continue
input_filepath = os.path.join(file_dir, filename)
- output_filepath = os.path.join(target_dir, filename)
- # Move file
- os.rename(input_filepath, output_filepath)
+ # Extract the db name
+ db_name = os.path.splitext(filename)[0]
+ # Create the directory where to put the fasta files and indexed files
+ filedir = os.path.join(target_dir, db_name)
+ 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
+ shutil.move(input_filepath, fasta_filepath)
# Index the file with indexdb_rna
command = "indexdb_rna --ref %s,%s" % (
- output_filepath,
- os.path.splitext(output_filepath)[0])
+ fasta_filepath,
+ indexed_filepath)
process = subprocess.call(command, shell=True )
# Add entry in the data table
- db_name = os.path.splitext(filename)[0]
add_data_table_entry(
data_tables,
"rRNA_databases",
dict(
- value=version,
+ value="%s-%s" %(version, db_name),
name=db_name,
- path=output_filepath))
+ path=filedir))
def download_db(data_tables, version, target_dir):
diff -r 30bb49887172 -r 7d2252852f96 data_manager_conf.xml
--- a/data_manager_conf.xml Tue Jun 06 13:40:27 2017 -0400
+++ b/data_manager_conf.xml Tue Jun 13 12:03:08 2017 -0400
@@ -6,11 +6,11 @@
-
+
rRNA_databases/${name}
- ${GALAXY_DATA_MANAGER_DATA_PATH}/rRNA_databases/${name}
+ ${GALAXY_DATA_MANAGER_DATA_PATH}/rRNA_databases/${name}/${name}.fasta
abspath