changeset 3:0df47f8552f6 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 01e8e726d711c0685f46d3146e4fe0f2a1306036
author iuc
date Wed, 07 Dec 2022 13:41:38 +0000
parents 7776cb18fdf8
children
files data_manager/interproscan.py data_manager/interproscan.xml
diffstat 2 files changed, 26 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/interproscan.py	Tue Feb 01 17:56:03 2022 +0000
+++ b/data_manager/interproscan.py	Wed Dec 07 13:41:38 2022 +0000
@@ -79,6 +79,14 @@
     else:
         tag = all_tags[-1]
 
+    setup_script = 'initial_setup.py'
+    sub_version = re.match(r"^[0-9]\.([0-9]{2})-[0-9]{2}\.[0-9]$", tag)
+    if sub_version and len(sub_version.groups()) == 1 and int(sub_version.group(1)) >= 58:
+        # The setup script was renamed in 5.58
+        setup_script = 'setup.py'
+    else:
+        raise RuntimeError("Sorry, this data manager can only download data for InterProScan >= 5.58-91.0. Use the 0.0.2 version for older versions of InterProScan.")
+
     print("Will download data for InterProScan version: %s" % tag)
 
     print("Getting MD5 checksum:")
@@ -125,7 +133,7 @@
     os.remove(dest_tar)
     shutil.rmtree(os.path.join(output_directory, 'interproscan-%s' % tag))
 
-    print("Running initial_setup.py (index hmm models)...")
+    print("Running {} (index hmm models)...".format(setup_script))
     # Write a temp properties file in work dir
     prop_file_src = os.path.join(os.path.dirname(os.path.realpath(shutil.which("interproscan.sh"))), 'interproscan.properties')
     with open(prop_file_src, 'r') as prop:
@@ -134,14 +142,14 @@
     with open('interproscan.properties', 'w') as prop:
         prop.write(prop_content)
     # Run the index command
-    cmd_args = [os.path.join(os.path.dirname(os.path.realpath(shutil.which("interproscan.sh"))), 'initial_setup.py')]
+    cmd_args = [os.path.join(os.path.dirname(os.path.realpath(shutil.which("interproscan.sh"))), setup_script), 'interproscan.properties']
     proc = subprocess.Popen(args=cmd_args, shell=False)
     out, err = proc.communicate()
     print(out)
     print(err, file=sys.stderr)
     return_code = proc.wait()
     if return_code:
-        print("Error running initial_setup.py.", file=sys.stderr)
+        print("Error running {}.".format(setup_script), file=sys.stderr)
         sys.exit(return_code)
 
     data_manager_dict["data_tables"][args.datatable_name].append(
--- a/data_manager/interproscan.xml	Tue Feb 01 17:56:03 2022 +0000
+++ b/data_manager/interproscan.xml	Wed Dec 07 13:41:38 2022 +0000
@@ -1,6 +1,6 @@
-<tool id="data_manager_interproscan" name="InterProScan data manager" version="0.0.2" tool_type="manage_data" profile="20.01">
+<tool id="data_manager_interproscan" name="InterProScan data manager" version="0.0.3" tool_type="manage_data" profile="20.01">
     <requirements>
-        <requirement type="package" version="5.54-87.0">interproscan</requirement>
+        <requirement type="package" version="5.59-91.0">interproscan</requirement>
         <requirement type="package" version="2.26.0">requests</requirement>
         <!-- Forcing an old hmmer version for indexing due to https://github.com/ebi-pf-team/interproscan/issues/232 -->
         <requirement type="package" version="3.1b2">hmmer</requirement>
@@ -15,7 +15,7 @@
     <inputs>
         <param name="partial_data" type="hidden" value="" help="Used for testing"/>
         <param name="version" type="text" value="" label="Version to download" help="Leave empty to download the latest version">
-            <validator type="regex" message="Version must be a valid InterProScan version (e.g. 5.52-86.0)">^([0-9]+\.[0-9]+-[0-9]+\.[0-9]+)?$</validator>
+            <validator type="regex" message="Version must be a valid InterProScan version (e.g. 5.59-91.0)">^([0-9]+\.[0-9]+-[0-9]+\.[0-9]+)?$</validator>
         </param>
     </inputs>
     <outputs>
@@ -31,26 +31,31 @@
                 </assert_contents>
             </output>
             <assert_stdout>
-                <has_text text="Pressed and indexed" />
-                <has_text text="Completed indexing the hmm models" />
+                <has_text text="Finished." />
             </assert_stdout>
         </test>
         <test>
             <param name="partial_data" value="--partial"/>
-            <param name="version" value="5.51-85.0"/>
+            <param name="version" value="5.58-91.0"/>
             <output name="output_file">
                 <assert_contents>
-                    <has_text text="InterProScan 5.51-85.0"/>
-                    <has_text text='"interproscan_version": "5.51-85.0'/>
+                    <has_text text="InterProScan 5.58-91.0"/>
+                    <has_text text='"interproscan_version": "5.58-91.0'/>
                 </assert_contents>
             </output>
             <assert_stdout>
-                <has_text text="Pressed and indexed" />
-                <has_text text="Completed indexing the hmm models" />
+                <has_text text="Finished." />
             </assert_stdout>
         </test>
         <test expect_failure="true">
             <param name="partial_data" value="--partial"/>
+            <param name="version" value="5.51-85.0"/>
+            <assert_stderr>
+                <has_text text="Sorry, this data manager can only download data for InterProScan >= 5.58-91.0. Use the 0.0.2 version for older versions of InterProScan." />
+            </assert_stderr>
+        </test>
+        <test expect_failure="true">
+            <param name="partial_data" value="--partial"/>
             <param name="version" value="xxxx"/>
             <assert_stderr>
                 <has_text text="Version must be a valid InterProScan version" />