Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions galaxy_tools/run_spac_template.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# run_spac_template.sh - Minimal universal wrapper for SPAC templates
# Version: 2.0 - Refactored with separated Python code
set -euo pipefail

PARAMS_JSON="${1:?Missing params.json path}"
TEMPLATE_NAME="${2:?Missing template name}"

# Log start
echo "=== SPAC Template Execution ==="
echo "Template: $TEMPLATE_NAME"
echo "Parameters: $PARAMS_JSON"

# Execute Python bridge and capture output
"${SPAC_PYTHON:-python3}" tool_utils.py "$PARAMS_JSON" "$TEMPLATE_NAME" 2>&1 | tee tool_stdout.txt

EXIT_CODE=${PIPESTATUS[0]}

if [ $EXIT_CODE -ne 0 ]; then
echo "ERROR: Execution failed with exit code $EXIT_CODE"
exit $EXIT_CODE
fi

echo "=== Complete ==="
exit 0
11 changes: 11 additions & 0 deletions galaxy_tools/tool_config/boxplot_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Configuration for Boxplot tool"""

TOOL_CONFIG = {
'outputs': {
'DataFrames': 'dataframe_folder',
'figures': 'figure_folder'
},
'list_params': ['Feature_s_to_Plot'],
'column_params': [],
'input_key': 'Upstream_Analysis'
}
25 changes: 25 additions & 0 deletions galaxy_tools/tool_config/load_csv_files_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Configuration for Load CSV Files tool"""

def preprocess_load_csv(params):
"""Special preprocessing for Load CSV Files"""
Copy link

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function docstring should describe the parameters it accepts and what it returns.

Suggested change
"""Special preprocessing for Load CSV Files"""
"""
Special preprocessing for Load CSV Files.
Args:
params (dict): Dictionary of parameters for the tool, possibly including 'CSV_Files'.
Returns:
dict: The processed parameters dictionary with any necessary modifications.
"""

Copilot uses AI. Check for mistakes.
import os

# Handle CSV_Files path
if 'CSV_Files' in params:
if isinstance(params['CSV_Files'], list) and len(params['CSV_Files']) == 1:
params['CSV_Files'] = params['CSV_Files'][0]

# If single file, get directory
if isinstance(params['CSV_Files'], str) and os.path.isfile(params['CSV_Files']):
params['CSV_Files'] = os.path.dirname(params['CSV_Files'])

return params

TOOL_CONFIG = {
'outputs': {
'DataFrames': 'dataframe_folder'
},
'list_params': ['String_Columns'],
'column_params': [],
'preprocess': preprocess_load_csv
}
11 changes: 11 additions & 0 deletions galaxy_tools/tool_config/setup_analysis_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Configuration for Setup Analysis tool"""

TOOL_CONFIG = {
'outputs': {
'analysis': 'analysis_output.pickle'
},
'list_params': ['Features_to_Analyze'],
'column_params': ['X_Coordinate_Column', 'Y_Coordinate_Column',
'Features_to_Analyze', 'Annotation_s_'],
'input_key': 'Upstream_Dataset'
}
Loading