#!/bin/bash


###### SLURM CONFIGURATION ########
# Define the partition
#SBATCH -p short
# choose a node
#SBATCH --nodelist=node13
#  Number of cpu
#SBATCH -c 2
# define a jobname
#SBATCH --job-name=ebola
# define a mail  
#SBATCH --mail-user=your_mail_adress
# define a event (BEGIN, ABORT , END or ALL)
#SBATCH --mail-type=ALL
##################################################


# create our personal folder
cd /scratch

# the $SLURM_JOB_ID variable allows to retreive the job ID
mkdir login-$SLURM_JOB_ID

#  transfer our data inside it
cd login-$SLURM_JOB_ID
scp -r san:/projects/medium/formation/Slurm/TPassembly/Ebola .

# load the software to use
module load abyss/2.2.5

# perform your analysis
cd Ebola
abyss-pe k=35 in='ebola1.fastq ebola2.fastq' name=k35

# transfer you results

cd ..

# replace login with your cluster account
scp -r /scratch/login-$SLURM_JOB_ID/Ebola san:/users/login/Ebola45


# remove the folder
# replace login with your cluster account
cd /scratch && rm -rf login-$SLURM_JOB_ID

# Obtain infos of the job ( CPU or memory used) directly into the output file
seff $SLURM_JOB_ID

