From eab474b91d1e984eade0d1c1007ce3fb21717c81 Mon Sep 17 00:00:00 2001 From: RoanKanninga Date: Tue, 8 Mar 2016 14:37:12 +0100 Subject: [PATCH] improved the copy prmtotmp data + bugfix in CheckIlluminaEncoding --- .../protocols/CheckIlluminaEncoding.sh | 12 +++--- compute5/NGS_DNA/protocols/CopyPrmTmpData.sh | 41 +++++++++++++------ 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/compute5/NGS_DNA/protocols/CheckIlluminaEncoding.sh b/compute5/NGS_DNA/protocols/CheckIlluminaEncoding.sh index 26ceef13..a8a85496 100755 --- a/compute5/NGS_DNA/protocols/CheckIlluminaEncoding.sh +++ b/compute5/NGS_DNA/protocols/CheckIlluminaEncoding.sh @@ -16,13 +16,13 @@ checkIlluminaEncoding() { barcodeFqGz=$1 echo ${barcodeFqGz} -Lines=(`zcat ${barcodeFqGz} | head -96 | awk 'NR % 4 == 0'`) +lines=(`zcat ${barcodeFqGz} | head -96 | awk 'NR % 4 == 0'`) count=1 nodecision=0 numberoflines=0 -for line in ${Lines[*]} +for line in ${lines[@]} do - numberoflines=$(( numberoflines++ )) + numberoflines=$(( numberoflines+1 )) #check for illumina encoding 1.5 if [[ "$line" =~ [P-Z] ]] || [[ "$line" =~ [a-g] ]] then @@ -30,7 +30,7 @@ do if [[ ${count} -eq 1 ]] then lastEncoding=${encoding} - count=$(( count++ )) + count=$(( count+1 )) fi if ! [ "${encoding}" == "${lastEncoding}" ] @@ -49,7 +49,7 @@ do if [[ ${count} -eq 1 ]] then lastEncoding=${encoding} - count=$(( count++ )) + count=$(( count+1 )) fi if ! [ "${encoding}" == "${lastEncoding}" ] then @@ -61,7 +61,7 @@ do lastEncoding="${encoding}" elif [[ "$line" =~ @ ]] || [[ "$line" =~ [A-J] ]] then - nodecision=$(( nodecision++ )) + nodecision=$(( nodecision+1 )) else echo "The encoding is not matching to anything, check FastQ documentation (count=$count)" fi diff --git a/compute5/NGS_DNA/protocols/CopyPrmTmpData.sh b/compute5/NGS_DNA/protocols/CopyPrmTmpData.sh index c00e692b..e23bfa6a 100755 --- a/compute5/NGS_DNA/protocols/CopyPrmTmpData.sh +++ b/compute5/NGS_DNA/protocols/CopyPrmTmpData.sh @@ -25,7 +25,16 @@ for ((samplenumber = 0; samplenumber <= max_index; samplenumber++)) do RUNNAME=${sequencingStartDate[samplenumber]}_${sequencer[samplenumber]}_${run[samplenumber]}_${flowcell[samplenumber]} - PRMDATADIR=${allRawNgsPrmDataDir}/${RUNNAME} + WHOAMI=$(whoami) + HOST=$(hostname) + if [ "$HOST" == "zinc-finger.gcc.rug.nl" ] && [ ! -d /groups/umcg-gaf/prm02 ] + then + echo "${WHOAMI}@calculon.hpc.rug.nl:${allRawNgsPrmDataDir}/${RUNNAME}" + PRMDATADIR="${WHOAMI}@calculon.hpc.rug.nl:${allRawNgsPrmDataDir}/${RUNNAME}" + else + PRMDATADIR=${allRawNgsPrmDataDir}/${RUNNAME} + fi + TMPDATADIR=${allRawNgsTmpDataDir}/${RUNNAME} if [[ ${seqType[samplenumber]} == "SR" ]] @@ -33,17 +42,19 @@ do mkdir -p ${TMPDATADIR} if [[ ${barcode[samplenumber]} == "None" ]] then - rsync -a -r --no-perms \ + echo "copying ${RUNNAME}_L${lane[samplenumber]}.fq.gz..." + rsync -a -r --no-perms --no-owner \ ${PRMDATADIR}/${RUNNAME}_L${lane[samplenumber]}.fq.gz \ ${TMPDATADIR}/${RUNNAME}_L${lane[samplenumber]}.fq.gz - rsync -a -r --no-perms \ + rsync -a -r --no-perms --no-owner \ ${PRMDATADIR}/${RUNNAME}_L${lane[samplenumber]}.fq.gz.md5 \ ${TMPDATADIR}/${RUNNAME}_L${lane[samplenumber]}.fq.gz.md5 else - rsync -a -r --no-perms \ + echo "copying ${RUNNAME}_L${lane[samplenumber]}_${barcode[samplenumber]}.fq.gz..." + rsync -a -r --no-perms --no-owner \ ${PRMDATADIR}/${RUNNAME}_L${lane[samplenumber]}_${barcode[samplenumber]}.fq.gz \ ${TMPDATADIR}/${RUNNAME}_L${lane[samplenumber]}_${barcode[samplenumber]}.fq.gz - rsync -a -r --no-perms \ + rsync -a -r --no-perms --no-owner \ ${PRMDATADIR}/${RUNNAME}_L${lane[samplenumber]}_${barcode[samplenumber]}.fq.gz.md5 \ ${TMPDATADIR}/${RUNNAME}_L${lane[samplenumber]}_${barcode[samplenumber]}.fq.gz.md5 fi @@ -52,29 +63,33 @@ do mkdir -p ${TMPDATADIR} if [[ ${barcode[samplenumber]} == "None" ]] then - rsync -a -r --no-perms \ + echo "copying ${RUNNAME}_L${lane[samplenumber]}_1.fq.gz..." + rsync -a -r --no-perms --no-owner \ ${PRMDATADIR}/${RUNNAME}_L${lane[samplenumber]}_1.fq.gz \ ${TMPDATADIR}/${RUNNAME}_L${lane[samplenumber]}_1.fq.gz - rsync -a -r --no-perms \ + echo "copying ${RUNNAME}_L${lane[samplenumber]}_2.fq.gz..." + rsync -a -r --no-perms --no-owner \ ${PRMDATADIR}/${RUNNAME}_L${lane[samplenumber]}_2.fq.gz \ ${TMPDATADIR}/${RUNNAME}_L${lane[samplenumber]}_2.fq.gz - rsync -a -r --no-perms \ + rsync -a -r --no-perms --no-owner \ ${PRMDATADIR}/${RUNNAME}_L${lane[samplenumber]}_1.fq.gz.md5 \ ${TMPDATADIR}/${RUNNAME}_L${lane[samplenumber]}_1.fq.gz.md5 - rsync -a -r --no-perms \ + rsync -a -r --no-perms --no-owner \ ${PRMDATADIR}/${RUNNAME}_L${lane[samplenumber]}_2.fq.gz.md5 \ ${TMPDATADIR}/${RUNNAME}_L${lane[samplenumber]}_2.fq.gz.md5 else - rsync -a -r --no-perms \ + echo "copying ${RUNNAME}_L${lane[samplenumber]}_${barcode[samplenumber]}_1.fq.gz..." + rsync -a -r --no-perms --no-owner \ ${PRMDATADIR}/${RUNNAME}_L${lane[samplenumber]}_${barcode[samplenumber]}_1.fq.gz \ ${TMPDATADIR}/${RUNNAME}_L${lane[samplenumber]}_${barcode[samplenumber]}_1.fq.gz - rsync -a -r --no-perms \ + echo "copying ${RUNNAME}_L${lane[samplenumber]}_${barcode[samplenumber]}_2.fq.gz..." + rsync -a -r --no-perms --no-owner \ ${PRMDATADIR}/${RUNNAME}_L${lane[samplenumber]}_${barcode[samplenumber]}_2.fq.gz \ ${TMPDATADIR}/${RUNNAME}_L${lane[samplenumber]}_${barcode[samplenumber]}_2.fq.gz - rsync -a -r --no-perms \ + rsync -a -r --no-perms --no-owner \ ${PRMDATADIR}/${RUNNAME}_L${lane[samplenumber]}_${barcode[samplenumber]}_1.fq.gz.md5 \ ${TMPDATADIR}/${RUNNAME}_L${lane[samplenumber]}_${barcode[samplenumber]}_1.fq.gz.md5 - rsync -a -r --no-perms \ + rsync -a -r --no-perms --no-owner \ ${PRMDATADIR}/${RUNNAME}_L${lane[samplenumber]}_${barcode[samplenumber]}_2.fq.gz.md5 \ ${TMPDATADIR}/${RUNNAME}_L${lane[samplenumber]}_${barcode[samplenumber]}_2.fq.gz.md5 fi