Mercurial > repos > iuc > data_manager_meme_motif_database_downloader
changeset 5:7563ad02ce6a draft
Uploaded
author | iuc |
---|---|
date | Thu, 15 Mar 2018 09:25:11 -0400 |
parents | 6d6b69ad6bdc |
children | c7019708aac8 |
files | data_manager/data_manager_meme_motif_databases_downloader.py data_manager/data_manager_meme_motif_databases_downloader.xml data_manager_conf.xml tool-data/meme_motif_databases.loc.sample |
diffstat | 4 files changed, 20 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/data_manager/data_manager_meme_motif_databases_downloader.py Tue Mar 13 08:58:05 2018 -0400 +++ b/data_manager/data_manager_meme_motif_databases_downloader.py Thu Mar 15 09:25:11 2018 -0400 @@ -78,8 +78,8 @@ def download(target_directory, web_url, name, description, data_table_names=DEFAULT_DATA_TABLE_NAMES): + motif_databases_directory = os.path.join(target_directory, 'motif_databases') data_manager_dict = {} - data_table_entry = {} # Download the databases. work_directory = os.path.abspath(os.path.join(os.getcwd(), 'meme_motif_databases')) make_directory(work_directory) @@ -89,17 +89,20 @@ # Move the database files into the defined output directory. move_files(work_directory, target_directory) remove_directory(work_directory) - # Populate the data_manager_dict with the database data entry. - for file_path in os.listdir(target_directory): - full_path = os.path.abspath(os.path.join(target_directory, file_path)) - entry_name = "%s" % os.path.basename(file_path) - data_table_entry['value'] = name - data_table_entry['name'] = name - data_table_entry['path'] = full_path - data_table_entry['description'] = description - # Populate the data_manager_dict. - for data_table_name in data_table_names: - data_manager_dict = add_data_table_entry(data_manager_dict, data_table_name, data_table_entry) + # Populate the data_manager_dict with the database data entries. + for file_name in os.listdir(motif_databases_directory): + data_table_entry = {} + full_path = os.path.abspath(os.path.join(motif_databases_directory, file_name)) + # Eliminate anything that is not a directory. + if os.path.isdir(full_path): + entry_name = "%s" % os.path.basename(full_path) + data_table_entry['value'] = entry_name + data_table_entry['name'] = entry_name + data_table_entry['path'] = full_path + data_table_entry['description'] = description + # Populate the data_manager_dict. + for data_table_name in data_table_names: + data_manager_dict = add_data_table_entry(data_manager_dict, data_table_name, data_table_entry) return data_manager_dict params = json.loads(open(args.out_file).read())
--- a/data_manager/data_manager_meme_motif_databases_downloader.xml Tue Mar 13 08:58:05 2018 -0400 +++ b/data_manager/data_manager_meme_motif_databases_downloader.xml Thu Mar 15 09:25:11 2018 -0400 @@ -36,3 +36,4 @@ </citations> </citations> </tool> +
--- a/data_manager_conf.xml Tue Mar 13 08:58:05 2018 -0400 +++ b/data_manager_conf.xml Thu Mar 15 09:25:11 2018 -0400 @@ -3,14 +3,14 @@ <data_manager tool_file="data_manager/data_manager_meme_motif_databases_downloader.xml" id="data_manager_meme_motif_databases_download" > <data_table name="meme_motif_databases"> <output> - <column name="value" /> + <column name="value"/> <column name="name"/> <column name="path" output_ref="out_file"> <move type="file"> <source>${path}</source> - <target base="${GALAXY_DATA_MANAGER_DATA_PATH}">meme_motif_databases/${value}</target> + <target base="${GALAXY_DATA_MANAGER_DATA_PATH}">meme_motif_databases/${name}</target> </move> - <value_translation>${GALAXY_DATA_MANAGER_DATA_PATH}/meme_motif_databases/${value}</value_translation> + <value_translation>${GALAXY_DATA_MANAGER_DATA_PATH}/meme_motif_databases/${name}</value_translation> <value_translation type="function">abspath</value_translation> </column> <column name="description" />
--- a/tool-data/meme_motif_databases.loc.sample Tue Mar 13 08:58:05 2018 -0400 +++ b/tool-data/meme_motif_databases.loc.sample Thu Mar 15 09:25:11 2018 -0400 @@ -1,3 +1,3 @@ ## MEME Motif Databases #Value Name Path Description -#2017_12 2017_12 /meme_motif_databases/2017_12 December 2017 +#ARABD ARABD /meme_motif_databases/2017_12 December 2017