#!/bin/bash -l
#$ -cwd
#$ -N si
#$ -l h_rt=96:00:00
#$ -l s_rt=96:00:00
#$ -pe smp 1 -R y -binding linear:1
#$ -l h_vmem=8G
#$ -o log/spliceai_split.$TASK_ID.log
#$ -e log/spliceai_split.$TASK_ID.log
#$ -t 1-1082
#$ -tc 100

i=$SGE_TASK_ID

mkdir -p variant_split_spliceai

sif=~/projects/software/singularity/spliceai/spliceai.sif

singularity exec \
  --bind ${HOME}:${HOME} \
  ${sif} spliceai \
    -R spliceai_input/hg38.fa \
    -A spliceai_input/ensembl107.canon.tsv \
    -M 1 \
    -I variant_split/variant_split.${i}.vcf.gz \
    -O variant_split_spliceai/variant_split.${i}.spliceai.vcf

bgzip -f variant_split_spliceai/variant_split.${i}.spliceai.vcf
