diff ena_webin_cli.xml @ 1:1090ae5e7b29 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/ena_webin_cli commit 6f9ce1aba91681e831f2649fb36b74cc3d572eb3
author iuc
date Fri, 24 Oct 2025 08:03:03 +0000
parents 7f669682f4ac
children
line wrap: on
line diff
--- a/ena_webin_cli.xml	Mon Oct 06 12:13:07 2025 +0000
+++ b/ena_webin_cli.xml	Fri Oct 24 08:03:03 2025 +0000
@@ -2,7 +2,7 @@
     <description>Submission of consensus sequences to the European Nucleotide Archive (ENA)</description>
     <macros>
         <token name="@TOOL_VERSION@">9.0.1</token>
-        <token name="@VERSION_SUFFIX@">0</token>
+        <token name="@VERSION_SUFFIX@">1</token>
     </macros>
     <requirements>
         <requirement type="package" version="@TOOL_VERSION@">ena-webin-cli</requirement>
@@ -13,35 +13,27 @@
 ## -----------------------------------------------------------------------------
 ## 1) Initialize log and credentials
 ## -----------------------------------------------------------------------------
+echo "Initializing log and credentials";
 
 ## Truncate (or create) the Galaxy-captured Webin-CLI log dataset.
 : > "$webin_cli_log";
 
-## Default path where the <configfile name="credentials"> content will be written.
-## In dry-run we override this with a fake file so tests don’t require real creds.
-#set $credentials = 'credentials'
-#if $dry_run == "true":
-    #set $credentials = './test_fake_path'
-    touch $credentials;
-    echo "username:test_user" >> "$credentials";
-    echo "password:test_password" >> "$credentials";
-#end if
-
 ## Extract username/password from the credentials file.
 ## NOTE: $webin_id appears in bash, so we escape it as \$webin_id.
-webin_id=`grep 'username' $credentials | cut -d':' -f2,2`;
+webin_id=`grep 'username' $credentials | cut -d':' -f2`;
 if [ -z "\$webin_id" ]; then
     ## Fail early with guidance if no username is present.
     echo "No ENA credentials defined. Set your credentials via: User -> Preferences -> Manage Information" >&2;
     exit 1;
 else
   ## Pull the password similarly.
-  password=`grep 'password' $credentials | cut -d':' -f2,2`;
+  password=`grep 'password' $credentials | cut -d':' -f2`;
 fi;
 
 ## -----------------------------------------------------------------------------
 ## 2) Create a base manifest (fields common to all submissions)
 ## -----------------------------------------------------------------------------
+echo "Creating a base manifest (fields common to all submissions)";
 
 ## Name of the base manifest template (we append more fields later).
 #set $manifest_base = 'manifest_base.tab'
@@ -62,6 +54,7 @@
 ## -----------------------------------------------------------------------------
 ## 3) Build per-sample manifests depending on metadata workflow
 ## -----------------------------------------------------------------------------
+echo "Building per-sample manifests depending on metadata workflow";
 
 #if $metadata_file_or_form.metadata_format == "file":
     ## --------------------------- FILE-DRIVEN WORKFLOW ------------------------
@@ -151,8 +144,9 @@
 #end if
 
 ## -----------------------------------------------------------------------------
-## 4) Prepare output directory and build CLI flags safely with Cheetah
+## 4) Prepare output directory and build CLI flags
 ## -----------------------------------------------------------------------------
+echo "Preparing output directory and build CLI flags";
 
 ## Webin-CLI will write receipts/logs under this directory (we later tar it).
 #set $outputs_dir = 'outputs'
@@ -173,6 +167,7 @@
 ## -----------------------------------------------------------------------------
 ## 5) Execute Webin-CLI
 ## -----------------------------------------------------------------------------
+echo "Executing Webin-CLI";
 
 #if $metadata_file_or_form.metadata_format == "file":
     ## Loop over each manifest written by process_input.py (submit_list.tab).
@@ -184,17 +179,18 @@
         echo "Submitting manifest \$manifest" >> "$webin_cli_log" 2>&1;
 
         ## Invoke Webin-CLI with computed flags.
-        ena-webin-cli -context genome -manifest "\$manifest" -userName "'\$webin_id'" -password "'\$password'" -centerName "'\$center_name'"  -inputDir './fasta' $test_flag $action_flag -outputDir $outputs_dir >> '$webin_cli_log' 2>&1 || true;
+        ena-webin-cli -context genome -manifest "\$manifest" -userName "\$webin_id" -password "\$password" -centerName "\$center_name"  -inputDir "./fasta" $test_flag $action_flag -outputDir $outputs_dir >> '$webin_cli_log' 2>&1 || true;
     done < submit_list.tab;
 
 #else:
     ## Single run in "form" mode with the one generated manifest.
-    ena-webin-cli -context genome -manifest $generated_manifest -userName "'\$webin_id'" -password "'\$password'" -centerName "'\$center_name'" -inputDir ./  $test_flag $action_flag -outputDir $outputs_dir >> "$webin_cli_log" 2>&1 || true;
+    ena-webin-cli -context genome -manifest $generated_manifest -userName "\$webin_id" -password "\$password" -centerName "\$center_name" -inputDir "./"  $test_flag $action_flag -outputDir $outputs_dir >> "$webin_cli_log" 2>&1 || true;
 #end if
 
 ## -----------------------------------------------------------------------------
 ## 6) Package outputs for Galaxy
 ## -----------------------------------------------------------------------------
+echo "Packaging outputs for Galaxy";
 
 ## Tar up the Webin-CLI output directory so Galaxy can collect a single dataset.
 tar -cf $webin_cli_outputs $outputs_dir ;
@@ -211,9 +207,14 @@
         <configfile name="credentials"><![CDATA[
 #set $webin_id = $__user__.extra_preferences.get('ena_webin_account|webin_id', "").strip()
 #set $password = $__user__.extra_preferences.get('ena_webin_account|password', "").strip()
-#if $webin_id != "":
-    username:$webin_id
-    password:$password
+## In dry-run we add fake creds when not provided.
+#if  $webin_id == "" and $dry_run == "true":
+#set $webin_id = "test-webin"
+#set $password = "test-password"
+#end if
+#if $webin_id != "" :
+username:$webin_id
+password:$password
 #end if
         ]]></configfile>
 
@@ -314,8 +315,8 @@
             <conditional name="metadata_file_or_form">
                 <param name="metadata_format" value="form"/>
                 <param name="assembly_name" value="Test assembly name"/>
-                <param name="study_accession" value="PRJEB49173"/>
-                <param name="sample_accession" value="SAMEA11953908"/>
+                <param name="study_accession" value="FAKE001"/>
+                <param name="sample_accession" value="FAKESAMP001"/>
                 <param name="sequencing_platform" value="Nanopore 0011"/>
                 <param name="description" value="Test Description"/>
                 <param name="center_name" value="Test center name"/>
@@ -349,8 +350,8 @@
             <conditional name="metadata_file_or_form">
                 <param name="metadata_format" value="form"/>
                 <param name="assembly_name" value="Test assembly name"/>
-                <param name="study_accession" value="PRJEB49173"/>
-                <param name="sample_accession" value="SAMEA11953908"/>
+                <param name="study_accession" value="FAKE001"/>
+                <param name="sample_accession" value="FAKESAMP001"/>
                 <param name="sequencing_platform" value="Nanopore 0011"/>
                 <param name="description" value="Test Description"/>
                 <param name="center_name" value="Test center name"/>