This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demux-novaseq.sh
52 lines (40 loc) · 1.8 KB
/
demux-novaseq.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
#SBATCH -c 18
##SBATCH -p PARTITION # use this if you want to specify a partition to run test on, for instance `dragen` or `gpu`
#SBATCH --qos=low
#SBATCH --time=600
#SBATCH --mail-type=ALL
#SBATCH --mail-user=YOUR.NAME@scilifelab.se
set -eu -o pipefail
##########
# PARAMS #
##########
RUN_DIR=${1?'Run dir'}
DEMUX_DIR=${2?'Demux dir'}
BASEMASK=${3?'Basemask'}
UNALIGNED_DIR=${4?'Unaligned directory'}
EMAIL=YOUR.NAME@scilifelab.se
#############
# FUNCTIONS #
#############
log() {
NOW=$(date +"%Y%m%d%H%M%S")
echo "[${NOW}] $*"
}
failed() {
mail -s "ERROR demultiplexing of $(basename "$RUN_DIR")" ${EMAIL} < "${DEMUX_DIR}/${UNALIGNED_DIR}/project.*.log"
}
trap failed ERR
########
# INIT #
########
log "On node: $(hostname)"
log "starting, will use ${TMPDIR}"
log "Run directory: ${RUN_DIR}"
log "Demux directory: ${DEMUX_DIR}"
################
# RUN BCL2FASTQ#
################
log "start demultiplexing ${RUN_DIR}"
log "singularity exec --bind /home/proj/stage/flowcells/novaseq,/home/proj/stage/flowcells/novaseq/"$SLURM_JOB_ID":/run/user/$(id -u) /home/proj/stage/demux-on-hasta/novaseq/container/bcl2fastq_v2-20-0.sif bcl2fastq --loading-threads 3 --processing-threads 15 --writing-threads 3 --runfolder-dir ${RUN_DIR} --output-dir ${DEMUX_DIR}/${UNALIGNED_DIR} --use-bases-mask ${BASEMASK} --sample-sheet ${RUN_DIR}/SampleSheet.csv --barcode-mismatches 1"
singularity exec --bind /home/proj/stage/flowcells/novaseq,/home/proj/stage/flowcells/novaseq/"$SLURM_JOB_ID":/run/user/$(id -u) /home/proj/stage/demux-on-hasta/novaseq/container/bcl2fastq_v2-20-0.sif bcl2fastq --loading-threads 3 --processing-threads 15 --writing-threads 3 --runfolder-dir ${RUN_DIR} --output-dir ${DEMUX_DIR}/${UNALIGNED_DIR} --use-bases-mask ${BASEMASK} --sample-sheet ${RUN_DIR}/SampleSheet.csv --barcode-mismatches 1