#!/bin/bash -euo pipefail
fusion_report run NTC_0001_0001_23H5VFLT4_s15 . fusion_report_db --arriba NTC_0001_0001_23H5VFLT4_s15.arriba.fusions.filtered_pass_only.tsv --starfusion NTC_0001_0001_23H5VFLT4_s15.starfusion.starfusion.fusion_predictions.filtered_pass_only.tsv --allow-multiple-gene-symbols --tool-cutoff 1 --export csv
mv fusion_list.tsv NTC_0001_0001_23H5VFLT4_s15.fusionreport.tsv
mv fusion_list_filtered.tsv NTC_0001_0001_23H5VFLT4_s15.fusionreport_filtered.tsv
mv index.html NTC_0001_0001_23H5VFLT4_s15_fusionreport_index.html
[ ! -f fusions.csv ] || mv fusions.csv NTC_0001_0001_23H5VFLT4_s15.fusions.csv
[ ! -f fusions.json ] || mv fusions.json NTC_0001_0001_23H5VFLT4_s15.fusions.json
cat <<-END_VERSIONS > versions.yml
"NFCORE_RNAFUSION:RNAFUSION:FUSIONREPORT_WORKFLOW:FUSIONREPORT":
fusion_report: $(fusion_report --version | sed 's/fusion-report //')
fusion_report DB retrieval: $(cat fusion_report_db/DB-timestamp.txt)
END_VERSIONS