#!/bin/bash -euo pipefail
fusion_report run rna_s1200_S21 . fusion_report_db --arriba rna_s1200_S21.arriba.fusions.filtered_pass_only.tsv --starfusion rna_s1200_S21.starfusion.starfusion.fusion_predictions.filtered_pass_only.tsv --allow-multiple-gene-symbols --tool-cutoff 1 --export csv
mv fusion_list.tsv rna_s1200_S21.fusionreport.tsv
mv fusion_list_filtered.tsv rna_s1200_S21.fusionreport_filtered.tsv
mv index.html rna_s1200_S21_fusionreport_index.html
[ ! -f fusions.csv ] || mv fusions.csv rna_s1200_S21.fusions.csv
[ ! -f fusions.json ] || mv fusions.json rna_s1200_S21.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