changeset 3:10ac95ec81d9 draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_selection_background commit bbba39ae993250a1e7301965b03c12621513775e"
author iuc
date Wed, 25 Aug 2021 21:07:59 +0000
parents e4f07770b340
children
files data_manager/data_manager_selection_background.py data_manager/data_manager_selection_background.xml tool_data_table_conf.xml.sample
diffstat 3 files changed, 14 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/data_manager_selection_background.py	Tue Aug 24 17:58:31 2021 +0000
+++ b/data_manager/data_manager_selection_background.py	Wed Aug 25 21:07:59 2021 +0000
@@ -111,21 +111,24 @@
     parser.add_argument('--dataset', dest='dataset', action='store', help='Path for the sequences')
 
     args = parser.parse_args()
-
-    work_dir = os.getcwd()
+    dbkey = str(args.dbkey)
 
     if args.uri is not None:
         background_fasta = url_download(args.uri)
     else:
         background_fasta = args.dataset
 
-    table_entry = '%s.fa' % args.dbkey
-    shutil.copy(background_fasta, os.path.join(work_dir, table_entry))
+    with open(args.output) as fh:
+        params = json.load(fh)
+    target_directory = params['output_data'][0]['extra_files_path']
+    os.makedirs(target_directory, exist_ok=True)
+    table_entry = '%s.fa' % dbkey
+    shutil.copy(background_fasta, os.path.join(target_directory, table_entry))
 
     # Update Data Manager JSON and write to file
     data_manager_entry = {
         'data_tables': {
-            'selection_background': {'value': args.dbkey, 'label': args.label, 'path': table_entry}
+            'selection_background': {'value': dbkey, 'label': args.label, 'path': table_entry}
         }
     }
 
--- a/data_manager/data_manager_selection_background.xml	Tue Aug 24 17:58:31 2021 +0000
+++ b/data_manager/data_manager_selection_background.xml	Wed Aug 25 21:07:59 2021 +0000
@@ -1,10 +1,12 @@
 <?xml version="1.0"?>
-<tool id="data_manager_selection_background" name="Add background sequences" tool_type="manage_data" version="1.0.2">
+<tool id="data_manager_selection_background" name="Add background sequences" tool_type="manage_data" version="1.0.3">
     <description>for selection analysis</description>
     <command detect_errors="exit_code">
     <![CDATA[
-        python '$__tool_directory__/data_manager_selection_background.py' --out '$selection_background_json'
-        --dbkey '${dbkey}'
+        python '$__tool_directory__/data_manager_selection_background.py' --output '$selection_background_json'
+        #if $dbkey:
+            --dbkey '${dbkey}'
+        #end if
         --label '${label}'
         #if $data_source.source_selector == 'history':
             --dataset '$data_source.dataset'
--- a/tool_data_table_conf.xml.sample	Tue Aug 24 17:58:31 2021 +0000
+++ b/tool_data_table_conf.xml.sample	Wed Aug 25 21:07:59 2021 +0000
@@ -1,6 +1,6 @@
 <tables>
     <!-- Locations of background sequences for clade analysis -->
-    <table name="selection_background" comment_char="#">
+    <table allow_duplicate_entries="False" name="selection_background" comment_char="#">
         <columns>value, label, path</columns>
         <file path="tool-data/selection_background.loc" />
     </table>