From 05d3bce236befbcaefcc1369dd4a955b4fd42c04 Mon Sep 17 00:00:00 2001 From: RoanKanninga Date: Wed, 6 Sep 2023 14:57:16 +0200 Subject: [PATCH 1/3] permanant fix when there is no mac2unix/dos2unix --- generate_template.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/generate_template.sh b/generate_template.sh index 5bb2ba9..e43e832 100755 --- a/generate_template.sh +++ b/generate_template.sh @@ -23,8 +23,11 @@ rm -rf "${WORKDIR}/generatedscripts/NGS_Demultiplexing/${RAWDATANAME}/out.csv" ###### Dual barcode checker # sampsheet="${WORKDIR}/generatedscripts/NGS_Demultiplexing/${RAWDATANAME}/${RAWDATANAME}.csv" - -mac2unix "${sampsheet}" +SAMPLESHEET_SEP="," +cp "${sampsheet}"{,.converted} +sed -i 's/\r/\n/g' "${sampsheet}.converted" +sed -i "/^[\s${SAMPLESHEET_SEP}]*$/d" "${sampsheet}.converted" +mv "${sampsheet}.converted" "${sampsheet}" declare -a _sampleSheetColumnNames=() declare -A _sampleSheetColumnOffsets=() From 871db14ae62643fb665bb3a7a657680131653507 Mon Sep 17 00:00:00 2001 From: RoanKanninga Date: Thu, 7 Mar 2024 11:39:45 +0100 Subject: [PATCH 2/3] fix --- protocols/UploadSampleSheet.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/protocols/UploadSampleSheet.sh b/protocols/UploadSampleSheet.sh index 91a543f..2c36ea5 100755 --- a/protocols/UploadSampleSheet.sh +++ b/protocols/UploadSampleSheet.sh @@ -9,6 +9,7 @@ #string intermediateDir #string generatedScriptsDir #string nextSeqRunDataDir +#string logsDir WHOAMI=$(whoami) # shellcheck source=/home/${WHOAMI}/molgenis.cfg @@ -105,10 +106,10 @@ cd "${runResultsDir}" || exit while IFS='\n' read -r line; do resultsArray+=("$line"); done < <(find "${ngsDir}/"*.*) for i in "${resultsArray[@]}" do - ln -s "${i}" + ln -sf "${i}" done cd - || exit echo "made symlinks from the rawdata/ngs folder to the results folder: ${runResultsDir}" -echo "finished: $(date +%FT%T%z)" >> "${workDir}/logs/${filePrefix}//run01.demultiplexing.totalRuntime" +echo "finished: $(date +%FT%T%z)" >> "${workDir}/logs/${filePrefix}//${filePrefix}.demultiplexing.totalRuntime" From 30f7aa9f07e6bebcfad76d9cb263de38f808419a Mon Sep 17 00:00:00 2001 From: RoanKanninga Date: Mon, 11 Mar 2024 16:06:28 +0100 Subject: [PATCH 3/3] fixing logging (now in line with NGS_Automated) --- generate_template.sh | 1 + protocols/Demultiplex.sh | 8 ++++---- protocols/UploadSampleSheet.sh | 12 ++++++------ protocols/processInterop.sh | 2 -- templates/slurm/header_tnt.ftl | 2 +- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/generate_template.sh b/generate_template.sh index f84c035..72c8663 100755 --- a/generate_template.sh +++ b/generate_template.sh @@ -24,6 +24,7 @@ rm -rf "${WORKDIR}/generatedscripts/NGS_Demultiplexing/${RAWDATANAME}/out.csv" ###### Dual barcode checker # sampsheet="${WORKDIR}/generatedscripts/NGS_Demultiplexing/${RAWDATANAME}/${RAWDATANAME}.csv" + SAMPLESHEET_SEP="," cp "${sampsheet}"{,.converted} sed -i 's/\r/\n/g' "${sampsheet}.converted" diff --git a/protocols/Demultiplex.sh b/protocols/Demultiplex.sh index 0bd35cc..024a59e 100755 --- a/protocols/Demultiplex.sh +++ b/protocols/Demultiplex.sh @@ -270,8 +270,8 @@ discarded=$(fgrep "DISCARDED" ${runPrefix}.demultiplex.log | awk -F '[()]' '{pri if [[ "${discarded}" -gt 75 ]] then echo "discarded percentage (${discarded}%) is higher than 75 procent, exiting" - echo -e "Dear Helpdesk ,\ndiscarded percentage (${discarded}%) is higher than 75 procent. See ${ngsDir}/${runPrefix}.demultiplex.log for a complete overview of all barcodes.\nThe demultiplexing pipeline has quit for sequence run ${runPrefix}, please check if the correct barcodes are enterd in the samplesheet\nkind regards GCC" >> "${logsDir}/${filePrefix}/${filePrefix}.demultiplexing.discarded" - cat ${runPrefix}.demultiplex.log >> "${logsDir}/${filePrefix}/${filePrefix}.demultiplexing.discarded" + echo -e "Dear Helpdesk ,\ndiscarded percentage (${discarded}%) is higher than 75 procent. See ${ngsDir}/${runPrefix}.demultiplex.log for a complete overview of all barcodes.\nThe demultiplexing pipeline has quit for sequence run ${runPrefix}, please check if the correct barcodes are enterd in the samplesheet\nkind regards GCC" >> "${logsDir}/${filePrefix}/run01.demultiplexing.discarded" + cat ${runPrefix}.demultiplex.log >> "${logsDir}/${filePrefix}/run01.demultiplexing.discarded" if [[ -r ../../../logs/${SCRIPT_NAME}.mailinglist ]] then @@ -310,12 +310,12 @@ then echo -e "\nAlle lanen voor deze barcode(s) worden niet door de pipeline gehaald.\n\ngroeten,\nGCC" >> mailText.txt cat mailText.txt cat mailText.txt | mail -s "er zijn samples afgekeurd van run: ${runPrefix}" "${mailingList}" - cat mailText.txt >> "${logsDir}/${filePrefix}/${filePrefix}.demultiplexing.discarded" + cat mailText.txt >> "${logsDir}/${filePrefix}/run01.demultiplexing.discarded" fi else echo "number of discarded reads is ${discarded}" - cat ${runPrefix}.demultiplex.log >> "${logsDir}/${filePrefix}/${filePrefix}.demultiplexing.finished" + cat ${runPrefix}.demultiplex.log >> "${logsDir}/${filePrefix}/run01.demultiplexing.finished" fi diff --git a/protocols/UploadSampleSheet.sh b/protocols/UploadSampleSheet.sh index 6abceac..a06426e 100755 --- a/protocols/UploadSampleSheet.sh +++ b/protocols/UploadSampleSheet.sh @@ -69,7 +69,7 @@ then fi -if [ ! -f "${workDir}/logs/${filePrefix}/${filePrefix}.${SCRIPT_NAME}.finished" ] +if [ ! -f "${workDir}/logs/${filePrefix}/run01.${SCRIPT_NAME}.finished" ] then if curl -s -f -H "Content-Type: application/json" -X POST -d "{"username"="${USERNAME}", "password"="${PASSWORD}"}" https://${MOLGENISSERVER}/api/v1/login then @@ -81,7 +81,7 @@ then echo "curl couldn't connect to host, skipped the uploading of the samplesheet to ${MOLGENISSERVER}" > "${ngsDir}/${filePrefix}.csv.uploadingFailed" fi - touch "${workDir}/logs/${filePrefix}/${filePrefix}.${SCRIPT_NAME}.finished" + touch "${workDir}/logs/${filePrefix}/run01.${SCRIPT_NAME}.finished" else echo "samplesheet already uploaded to ${MOLGENISSERVER}" @@ -95,11 +95,11 @@ then rm "${ngsDir}/rejectedBarcodes.txt" fi -if [ -f "${workDir}/logs/${filePrefix}/${filePrefix}.demultiplexing.started" ] +if [ -f "${workDir}/logs/${filePrefix}/run01.demultiplexing.started" ] then - mv "${workDir}/logs/${filePrefix}/${filePrefix}.demultiplexing."{started,finished} + mv "${workDir}/logs/${filePrefix}/run01.demultiplexing."{started,finished} else - touch "${workDir}/logs/${filePrefix}/${filePrefix}.demultiplexing.finished" + touch "${workDir}/logs/${filePrefix}/run01.demultiplexing.finished" fi cd "${runResultsDir}" || exit @@ -112,4 +112,4 @@ done cd - || exit echo "made symlinks from the rawdata/ngs folder to the results folder: ${runResultsDir}" -echo "finished: $(date +%FT%T%z)" >> "${workDir}/logs/${filePrefix}//${filePrefix}.demultiplexing.totalRuntime" +echo "finished: $(date +%FT%T%z)" >> "${workDir}/logs/${filePrefix}//run01.demultiplexing.totalRuntime" diff --git a/protocols/processInterop.sh b/protocols/processInterop.sh index 6d6d579..e72a9ff 100755 --- a/protocols/processInterop.sh +++ b/protocols/processInterop.sh @@ -59,8 +59,6 @@ then fi -touch "${workDir}/logs/${filePrefix}/${filePrefix}.demultiplexing.started" - #################Dit stuk later aanpassen, naar hoe de diagnostiek het wil. Dit werkt ook nog niet, kan niet met komma getallen overweg.################## #if [ "${Q30}" -lt 100 ] diff --git a/templates/slurm/header_tnt.ftl b/templates/slurm/header_tnt.ftl index b5ca0c8..7106f53 100755 --- a/templates/slurm/header_tnt.ftl +++ b/templates/slurm/header_tnt.ftl @@ -48,7 +48,7 @@ export mydate_start # <#noparse> runName=$(basename $(cd ../ && pwd )) -MC_failedFile="${logsDirectory}/${runName}.demultiplexing.failed" +MC_failedFile="${logsDirectory}/run01.demultiplexing.failed" declare MC_singleSeperatorLine=$(head -c 120 /dev/zero | tr '\0' '-')