File Info

Filename
.command.sh
Full Path
s3://natera-rnd-pltf-dev-nextflow-scratch-01/work/9b/a2b74cb0a50426a71caef35f08aa74/.command.sh
Size
3.2 KB
Attempt
#!/bin/bash -euo pipefail
echo "=== DEBUGGING INFORMATION ==="
echo "Current working directory: $(pwd)"
echo "Input files:"
echo "  - starfusion_tsv: BVT_FFPE_TRNA_bst_01_02_A23WKFTLT4_1.starfusion.starfusion.fusion_predictions.tsv"
echo "  - blacklist: blacklist_hg38_GRCh38_v2.4.0.tsv.gz"
echo "  - filter_config: starfusion_filter_config.yaml"
echo "  - aih_blacklist_breakpoints: blacklist_breakpoint_database_2026-04-27.tsv"

echo ""
echo "=== PYTHON INFORMATION ==="
which python || echo "python not found in PATH"
python --version || echo "python --version failed"
which python3 || echo "python3 not found in PATH"
python3 --version || echo "python3 --version failed"

echo ""
echo "=== SCRIPT LOCATION ==="
echo "Checking for filter_starfusion_main.py:"
which filter_starfusion_main.py || echo "filter_starfusion_main.py not found in PATH"
ls -la filter_starfusion_main.py 2>/dev/null || echo "filter_starfusion_main.py not in current directory"
ls -la bin/filter_starfusion_main.py 2>/dev/null || echo "bin/filter_starfusion_main.py not found"
if [ -d bin ]; then
    echo "bin/ directory exists:"
    ls -la bin/ || echo "Could not list bin/ directory"
else
    echo "bin/ directory does not exist"
fi

echo ""
echo "=== ENVIRONMENT PATH ==="
echo $PATH

echo ""
echo "=== CURRENT DIRECTORY CONTENTS ==="
ls -la

echo ""
echo "=== PROJECT DIRECTORY INFO ==="
echo "NXF_PROJECT_DIR: ${NXF_PROJECT_DIR:-not set}"
echo "baseDir: ${baseDir:-not set}"

echo ""
echo "=== Running filter script ==="
AIH_TS="${PWD}/_empty_aih_blacklist.tsv"
if [[ -n 'blacklist_breakpoint_database_2026-04-27.tsv' ]] && [[ -f 'blacklist_breakpoint_database_2026-04-27.tsv' ]]; then
    AIH_TS='blacklist_breakpoint_database_2026-04-27.tsv'
else
    printf 'BREAKPOINT_ID\tblacklist_evidence_score\n' > "$AIH_TS"
fi
filter_starfusion_main.py \
    --input BVT_FFPE_TRNA_bst_01_02_A23WKFTLT4_1.starfusion.starfusion.fusion_predictions.tsv \
    --blacklist blacklist_hg38_GRCh38_v2.4.0.tsv.gz \
    --aih-blacklist-breakpoints "$AIH_TS" \
    --filter-config starfusion_filter_config.yaml \
    --output BVT_FFPE_TRNA_bst_01_02_A23WKFTLT4_1.starfusion.starfusion.fusion_predictions.filtered.tsv \
    --summary BVT_FFPE_TRNA_bst_01_02_A23WKFTLT4_1.starfusion.starfusion.fusion_predictions.filter_summary.txt \
    --add-reason-column \


# The script creates pass_only file by replacing .tsv with _pass_only.tsv
# Python: args.output.replace('.tsv', '_pass_only.tsv')
# So: BVT_FFPE_TRNA_bst_01_02_A23WKFTLT4_1.starfusion.starfusion.fusion_predictions.filtered.tsv -> BVT_FFPE_TRNA_bst_01_02_A23WKFTLT4_1.starfusion.starfusion.fusion_predictions.filtered_pass_only.tsv
# No rename needed - script already creates it with correct name

cat <<-END_VERSIONS > versions.yml
"NFCORE_RNAFUSION:RNAFUSION:STARFUSION_WORKFLOW:STARFUSION_FILTER":
    filter_starfusion_main.py: "1.0"
    pandas: $(python -c "import pandas; print(pandas.__version__)" 2>/dev/null || echo "unknown")
    numpy: $(python -c "import numpy; print(numpy.__version__)" 2>/dev/null || echo "unknown")
    pyyaml: $(python -c "import yaml; print(yaml.__version__)" 2>/dev/null || echo "unknown")
    boto3: $(python -c "import boto3; print(boto3.__version__)" 2>/dev/null || echo "unknown")
END_VERSIONS