diff swissmodel_api.xml @ 1:f09a77e52ae5 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/main/tools/swissmodel_modelling_api commit d35c7d4dbe93451605d81b8e4fea8923e78b70ae
author iuc
date Sat, 10 Jan 2026 13:17:07 +0000
parents 0c3f56c85e98
children
line wrap: on
line diff
--- a/swissmodel_api.xml	Thu Dec 11 19:32:14 2025 +0000
+++ b/swissmodel_api.xml	Sat Jan 10 13:17:07 2026 +0000
@@ -1,13 +1,20 @@
-<tool name="SWISS-MODEL Modelling API" id="swissmodel_modelling_api" profile="21.05" version="2.0.0">
+<tool name="SWISS-MODEL Modelling API" id="swissmodel_modelling_api" profile="25.1" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
     <description>
         Fully automated protein structure homology-modelling
     </description>
+    <macros>
+        <token name="@TOOL_VERSION@">2.0.0</token>
+        <token name="@VERSION_SUFFIX@">0</token>
+    </macros>
     <xrefs>
         <xref type="bio.tools">swiss_model</xref>
     </xrefs>
     <requirements>
         <requirement type="package" version="3.11">python</requirement>
         <requirement type="package" version="2.32.5">requests</requirement>
+        <credentials name="swissmodel_api_credentials" version="1.0" label="SWISS-MODEL API Credentials" description="Credentials for accessing SWISS-MODEL API">
+            <secret name="swissmodel_api_token" inject_as_env="SWISSMODEL_API_TOKEN" optional="false" label="SWISS-MODEL API token" description="Token to authenticate to the SWISS-MODEL API. Can be managed on your https://swissmodel.expasy.org/login_page"/>
+        </credentials>
     </requirements>
     <command detect_errors="aggressive"><![CDATA[
 mkdir -p 'output_dir/'
@@ -27,7 +34,7 @@
                             --template-file '${template_file}'
                           #end if
                           '${project.project_type}'
-                          '${token}' output_dir
+                          output_dir
                           #if $project_type == 'alignment'
                             '${target_sequence}'
                           #else
@@ -39,12 +46,6 @@
 ]]>
     </command>
     <inputs>
-        <param name="token" type="text" optional="false" label="API token">
-            <help><![CDATA[
-Token to authenticate to the SWISS-MODEL API. Can be managed on your
-<a href="https://swissmodel.expasy.org/login_page" target="_blank"> SWISS-MODEL account</a> page.
-            ]]></help>
-        </param>
         <param name="project_title" type="text" value="Untitled project" optional="true" label="Project title"/>
         <conditional name="project">
             <param name="project_type" type="select" value="automodel" optional="false" label="Modelling setup" display="radio">
@@ -140,7 +141,7 @@
             </assert_stderr>
         </test>
         <!-- with sequences, everything else empty, fail -->
-        <test expect_exit_code="2" expect_failure="true">
+        <test expect_exit_code="1" expect_failure="true">
             <conditional name="project">
                 <repeat name="target_list">
                     <param name="sequence" value="MVVKAVCVINGDAKGTVFFEQESSGTPVKVSGEVCGL"/>
@@ -150,19 +151,7 @@
                 </repeat>
             </conditional>
             <assert_stderr>
-                <has_line line="Argument of '&lt;TOKEN&gt;' can not be an empty string"/>
-            </assert_stderr>
-        </test>
-        <!-- sequence and token (complete automodel job), fail (no real token) -->
-        <test expect_exit_code="1" expect_failure="true">
-            <conditional name="project">
-                <repeat name="target_list">
-                    <param name="sequence" value="MVVKAVCVINGDAKGTVFFEQESSGTPVKVSGEVCGL"/>
-                </repeat>
-            </conditional>
-            <param name="token" value="NOTAVALIDTOKEN"/>
-            <assert_stderr>
-                <has_line line="RuntimeError: Submitting modelling job failed (401)"/>
+                <has_line line="SWISS-MODEL token is not provided in credentials!"/>
             </assert_stderr>
         </test>
         <!-- alignment mode tests, as few params as possible, fail -->
@@ -216,7 +205,7 @@
             </assert_stderr>
         </test>
         <!-- alignment mode tests, with sequence, fail -->
-        <test expect_exit_code="2" expect_failure="true">
+        <test expect_exit_code="1" expect_failure="true">
             <conditional name="project">
                 <param name="assembly_id" value="0"/>
                 <param name="auth_asym_id" value="A"/>
@@ -227,23 +216,7 @@
                 <param name="template_sequence" value="MVVKAVCVINGDAKGTVFFEQESSGTPV"/>
             </conditional>
             <assert_stderr>
-                <has_line line="Argument of '&lt;TOKEN&gt;' can not be an empty string"/>
-            </assert_stderr>
-        </test>
-        <!-- alignment mode tests, with token, fail -->
-        <test expect_exit_code="1" expect_failure="true">
-            <conditional name="project">
-                <param name="assembly_id" value="0"/>
-                <param name="auth_asym_id" value="A"/>
-                <param name="pdb_id" value="1AKE"/>
-                <param name="project_type" value="alignment"/>
-                <param name="target_sequence" value="MVVKAVCVINGDAKGTVFFEQESSGTPVKVSG"/>
-                <param name="template_seqres_offset" value="0"/>
-                <param name="template_sequence" value="MVVKAVCVINGDAKGTVFFEQESSGTPV"/>
-            </conditional>
-            <param name="token" value="NOTAVALIDTOKEN"/>
-            <assert_stderr>
-                <has_line line="RuntimeError: Submitting modelling job failed (401)"/>
+                <has_line line="SWISS-MODEL token is not provided in credentials!"/>
             </assert_stderr>
         </test>
         <!-- usertemplate mode tests, as few params as possible, fail -->
@@ -257,7 +230,7 @@
             </assert_stderr>
         </test>
         <!-- usertemplate mode tests, with sequence, fail -->
-        <test expect_exit_code="2" expect_failure="true">
+        <test expect_exit_code="1" expect_failure="true">
             <conditional name="project">
                 <param name="project_type" value="usertemplate"/>
                 <param name="template_file" value="model_01.pdb"/>
@@ -269,24 +242,7 @@
                 </repeat>
             </conditional>
             <assert_stderr>
-                <has_line line="Argument of '&lt;TOKEN&gt;' can not be an empty string"/>
-            </assert_stderr>
-        </test>
-        <!-- usertemplate mode tests, with token, fail -->
-        <test expect_exit_code="1" expect_failure="true">
-            <conditional name="project">
-                <param name="project_type" value="usertemplate"/>
-                <param name="template_file" value="model_01.pdb"/>
-                <repeat name="target_list">
-                    <param name="sequence" value="MVVKAVCVINGDAKGTVFFEQESSGTPVKVSGEVCGL"/>
-                </repeat>
-                <repeat name="target_list">
-                    <param name="sequence" value="AKGLHGFHVHEFGDNTNGCMSSGPHFNPYGKE"/>
-                </repeat>
-            </conditional>
-            <param name="token" value="NOTAVALIDTOKEN"/>
-            <assert_stderr>
-                <has_line line="RuntimeError: Submitting modelling job failed (401)"/>
+                <has_line line="SWISS-MODEL token is not provided in credentials!"/>
             </assert_stderr>
         </test>
     </tests>