#!/bin/bash
#SBATCH -J FastQScreen-0.15.3-case
#SBATCH -p batch
#SBATCH --nodes 1
#SBATCH --ntasks-per-node 2
#SBATCH -t 0:05:00

#export align_function=bwa
#export align_function=bowtie
export align_function=bowtie2

module load gcc/13.2.0-iqpfkya fastq-screen
module load $align_function
#module load bismark # if we want to use bisulfides

capital_align_function=${align_function^^}
root_folder_variable=${capital_align_function}_ROOT

# prepare configuration file
echo -e "$capital_align_function ${!root_folder_variable}/bin/$align_function">>my_configuration_file_$SLURM_JOB_ID.conf
#echo -e "BISMARK $BISMARK_ROOT/bin/bismark">>my_configuration_file_$SLURM_JOB_ID.conf # if we want to use bisulfides
echo -e "THREADS $SLURM_NTASKS">>my_configuration_file_$SLURM_JOB_ID.conf
echo -e "DATABASE Human $HOME/FastQ_Screen_Genomes/Human/Homo_sapiens.GRCh38">>my_configuration_file_$SLURM_JOB_ID.conf
echo -e "DATABASE Mouse $HOME/FastQ_Screen_Genomes/Mouse/Mus_musculus.GRCm38">>my_configuration_file_$SLURM_JOB_ID.conf

# run FastQScreen on test dataset with bowtie2 aligner using the above configuration
fastq_screen --force $HOME/fastq_screen_test_dataset/fqs_test_dataset.fastq.gz --conf $PWD/my_configuration_file_$SLURM_JOB_ID.conf --aligner $align_function
