-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_confusion_analysis.sh
More file actions
executable file
·63 lines (52 loc) · 1.72 KB
/
run_confusion_analysis.sh
File metadata and controls
executable file
·63 lines (52 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# Helper script to run confusion matrix analysis in Docker
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
PREDICTIONS_FILE="${1:-analysis_results.csv}"
FEEDBACK_FILE="${2:-feedback.csv}"
echo "=========================================="
echo "BioAnalyzer Confusion Matrix Analysis"
echo "=========================================="
echo ""
echo "Predictions file: $PREDICTIONS_FILE"
echo "Feedback file: $FEEDBACK_FILE"
echo ""
# Check if files exist
if [ ! -f "$PREDICTIONS_FILE" ]; then
echo "Error: Predictions file not found: $PREDICTIONS_FILE"
exit 1
fi
if [ ! -f "$FEEDBACK_FILE" ]; then
echo "Error: Feedback file not found: $FEEDBACK_FILE"
exit 1
fi
# Check if Docker is available
if ! command -v docker &> /dev/null; then
echo "Error: Docker is not installed or not in PATH"
exit 1
fi
# Build the Docker image if it doesn't exist or is outdated
echo "Building/checking Docker image..."
docker build -t bioanalyzer-package . > /dev/null 2>&1 || {
echo "Building Docker image (this may take a few minutes)..."
docker build -t bioanalyzer-package .
}
echo ""
echo "Step 1: Checking PMID overlap..."
docker run --rm \
-v "$SCRIPT_DIR:/app" \
-w /app \
bioanalyzer-package \
python align_pmids.py "$PREDICTIONS_FILE" "$FEEDBACK_FILE"
echo ""
echo "Step 2: Running confusion matrix analysis..."
docker run --rm \
-v "$SCRIPT_DIR:/app" \
-w /app \
bioanalyzer-package \
python scripts/eval/confusion_matrix_analysis.py "$PREDICTIONS_FILE" "$FEEDBACK_FILE"
echo ""
echo "=========================================="
echo "Analysis complete! Check confusion_matrix_results/ for output"
echo "=========================================="