Clinical-Genomics / demultiplexing

To keep scripts associated with execution of the Illumina demultiplexing pipeline
5 stars 0 forks source link

Fix empty sample sheet test in novaseq demux script #121

Closed barrystokman closed 3 years ago

barrystokman commented 3 years ago

This PR adds/fixes the test for removing an empty samplesheet before fetching a new one, leading to an error email being sent without cause: ERROR starting novaseq HCTCNDSXY on clinical-preproc.scilifelab.se, line 56

How to prepare for test:

The defect is that the bash script is trying to remove a non-existing SampleSheet.csv, leading to an error email (rm: cannot remove/home/hiseq.clinical/STAGE/novaseq/runs//201203_A00689_0200_AHVKJCDRXX/SampleSheet.csv': No such file or directory`)

How to test:

TC1: no samplesheet

TC2: samplesheet already exists

TC3: empty samplesheet exists

Expected test outcome: No errors occur on line 56 of the script

Review:

This version is a:

barrystokman commented 3 years ago

Note:

-s : file exists AND is not empty ! -s : file does not exist OR is empty, instead of NOT (file exists AND is not empty) -> [[ -e file.txt && ! -s file.txt ]] should only return TRUE if the file exists AND is empty, which is the purpose of this check!

barrystokman commented 3 years ago

Yes, also working on the fluffy stuff but will test when I can find some time.

barrystokman commented 3 years ago

TC1 output:

[hiseq.clinical@thalamus 201203_A00689_0200_AHVKJCDRXX]$ bash /home/hiseq.clinical/STAGE/git/demultiplexing/scripts/novaseq/checkfornewrun.bash /home/hiseq.clinical/STAGE/novaseq/runs/ /home/hiseq.clinical/STAGE/novaseq/demux/
demux sheet fetch --application nova --pad --longest HVKJCDRXX > /home/hiseq.clinical/STAGE/novaseq/runs//201203_A00689_0200_AHVKJCDRXX/SampleSheet.csv
mkdir -p /home/hiseq.clinical/STAGE/novaseq/demux//201203_A00689_0200_AHVKJCDRXX/
date +'%Y%m%d%H%M%S' > /home/hiseq.clinical/STAGE/novaseq/runs//201203_A00689_0200_AHVKJCDRXX/demuxstarted.txt
bash /home/hiseq.clinical/STAGE/git/demultiplexing/scripts/novaseq/demux-novaseq.bash /home/hiseq.clinical/STAGE/novaseq/runs//201203_A00689_0200_AHVKJCDRXX /home/hiseq.clinical/STAGE/novaseq/demux/ &>> /home/hiseq.clinical/STAGE/novaseq/demux//201203_A00689_0200_AHVKJCDRXX/projectlog.20201215113443.log
rm -f /home/hiseq.clinical/STAGE/novaseq/demux//201203_A00689_0200_AHVKJCDRXX/copycomplete.txt
date +'%Y%m%d%H%M%S' > /home/hiseq.clinical/STAGE/novaseq/demux//201203_A00689_0200_AHVKJCDRXX/demuxcomplete.txt

:heavy_check_mark:

TC2 output:

[hiseq.clinical@thalamus 201203_A00689_0200_AHVKJCDRXX]$ bash /home/hiseq.clinical/STAGE/git/demultiplexing/scripts/novaseq/checkfornewrun.bash /home/hiseq.clinical/STAGE/novaseq/runs/ /home/hiseq.clinical/STAGE/novaseq/demux/
mkdir -p /home/hiseq.clinical/STAGE/novaseq/demux//201203_A00689_0200_AHVKJCDRXX/
date +'%Y%m%d%H%M%S' > /home/hiseq.clinical/STAGE/novaseq/runs//201203_A00689_0200_AHVKJCDRXX/demuxstarted.txt
bash /home/hiseq.clinical/STAGE/git/demultiplexing/scripts/novaseq/demux-novaseq.bash /home/hiseq.clinical/STAGE/novaseq/runs//201203_A00689_0200_AHVKJCDRXX /home/hiseq.clinical/STAGE/novaseq/demux/ &>> /home/hiseq.clinical/STAGE/novaseq/demux//201203_A00689_0200_AHVKJCDRXX/projectlog.20201215113831.log
rm -f /home/hiseq.clinical/STAGE/novaseq/demux//201203_A00689_0200_AHVKJCDRXX/copycomplete.txt
date +'%Y%m%d%H%M%S' > /home/hiseq.clinical/STAGE/novaseq/demux//201203_A00689_0200_AHVKJCDRXX/demuxcomplete.txt

:heavy_check_mark:

TC3 output:

[hiseq.clinical@thalamus 201203_A00689_0200_AHVKJCDRXX]$ bash /home/hiseq.clinical/STAGE/git/demultiplexing/scripts/novaseq/checkfornewrun.bash /home/hiseq.clinical/STAGE/novaseq/runs/ /home/hiseq.clinical/STAGE/novaseq/demux/
demux sheet fetch --application nova --pad --longest HVKJCDRXX > /home/hiseq.clinical/STAGE/novaseq/runs//201203_A00689_0200_AHVKJCDRXX/SampleSheet.csv
mkdir -p /home/hiseq.clinical/STAGE/novaseq/demux//201203_A00689_0200_AHVKJCDRXX/
date +'%Y%m%d%H%M%S' > /home/hiseq.clinical/STAGE/novaseq/runs//201203_A00689_0200_AHVKJCDRXX/demuxstarted.txt
bash /home/hiseq.clinical/STAGE/git/demultiplexing/scripts/novaseq/demux-novaseq.bash /home/hiseq.clinical/STAGE/novaseq/runs//201203_A00689_0200_AHVKJCDRXX /home/hiseq.clinical/STAGE/novaseq/demux/ &>> /home/hiseq.clinical/STAGE/novaseq/demux//201203_A00689_0200_AHVKJCDRXX/projectlog.20201215114152.log
rm -f /home/hiseq.clinical/STAGE/novaseq/demux//201203_A00689_0200_AHVKJCDRXX/copycomplete.txt
date +'%Y%m%d%H%M%S' > /home/hiseq.clinical/STAGE/novaseq/demux//201203_A00689_0200_AHVKJCDRXX/demuxcomplete.txt
barrystokman commented 3 years ago

When testing effort >>> coding effort...

But it works and an approval would be greatly appreciated!

barrystokman commented 3 years ago

Bumped: image

Deployed thalamus: image