#!/bin/bash -euo pipefail
# R and symlinks don't get along
cp -LR report.Rmd real_report.Rmd
mv real_report.Rmd report.Rmd
cp -LR log_scorefiles.json log_combined.json


echo nextflow run pgscatalog/pgsc_calc -profile docker --input samplesheet.csv --target_build GRCh38 --pgs_id PGS000327,PGS000135,PGS002746,PGS000907,PGS003333 --parallel --max_memory 30.GB --max_cpus 14 --min_overlap 0.3 > command.txt
echo "keep_multiallelic: false" > params.txt
echo "keep_ambiguous   : false"    >> params.txt
echo "min_overlap      : 0.3"       >> params.txt

R -e 'rmarkdown::render("report.Rmd",         output_options = list(self_contained=TRUE))'

cat <<-END_VERSIONS > versions.yml
SCORE_REPORT:
    R: $(echo $(R --version 2>&1) | head -n 1 | cut -f 3 -d ' ')
END_VERSIONS
