Files
labweb/public/scripts/pHPredict.sh
2025-12-16 11:39:15 +08:00

48 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# Script name: run_pH_analysis_pipeline.sh
# Function: Combine InterPro annotation and pH prediction into one pipeline
# Usage: ./run_pH_analysis_pipeline.sh <prokka_annotation_dir>
# Example: ./run_pH_analysis_pipeline.sh ./prokka_annotation
# Check input parameter (must be 1: prokka annotation directory)
if [ $# -ne 2 ]; then
echo "Error: Incorrect number of arguments!"
echo "Usage: $0 <prokka_annotation_dir> <ph_predict_dir>"
echo "Example: $0 ./prokka_annotation ./ph_predict_dir"
exit 1
fi
PROKKA_DIR="$1"
output_dir="$2"
mkdir -p "$output_dir" || {
echo "Error: Failed to create output directory $output_dir!"
exit 1
}
# Step 1: Run InterPro annotation script
echo "=== Step 1: Starting InterPro annotation ==="
if [ -f "/app/scripts/pfam_annotation.sh" ]; then
bash /app/scripts/pfam_annotation.sh "$PROKKA_DIR" "$output_dir"|| {
echo "Error: pfam_annotation.sh execution failed!"
exit 1
}
else
echo "Error: pfam_annotation.sh not found in current directory!"
exit 1
fi
# Step 2: Run pH prediction Python script
echo -e "\n=== Step 2: Starting pH model prediction ==="
if [ -f "/app/scripts/pHmodel.py" ]; then
# Assume pHmodel.py takes two parameters: input dir (.) and output dir (.) as in original command
python /app/scripts/pHmodel.py "$output_dir" "$output_dir" || {
echo "Error: pHmodel.py execution failed!"
exit 1
}
else
echo "Error: pHmodel.py not found in current directory!"
exit 1
fi
echo -e "\n=== All steps completed successfully ==="