Skip to content

Commit

Permalink
Merge pull request #456 from RoanKanninga/3.2.3
Browse files Browse the repository at this point in the history
improved the copy prmtotmp data + bugfix in CheckIlluminaEncoding
  • Loading branch information
Gerbenvandervries committed Mar 8, 2016
2 parents 7f909e8 + eab474b commit 6e55bc0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 19 deletions.
12 changes: 6 additions & 6 deletions compute5/NGS_DNA/protocols/CheckIlluminaEncoding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ 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
encoding="1.5"
if [[ ${count} -eq 1 ]]
then
lastEncoding=${encoding}
count=$(( count++ ))
count=$(( count+1 ))
fi

if ! [ "${encoding}" == "${lastEncoding}" ]
Expand All @@ -49,7 +49,7 @@ do
if [[ ${count} -eq 1 ]]
then
lastEncoding=${encoding}
count=$(( count++ ))
count=$(( count+1 ))
fi
if ! [ "${encoding}" == "${lastEncoding}" ]
then
Expand All @@ -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
Expand Down
41 changes: 28 additions & 13 deletions compute5/NGS_DNA/protocols/CopyPrmTmpData.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,36 @@ 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" ]]
then
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
Expand All @@ -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
Expand Down

0 comments on commit 6e55bc0

Please sign in to comment.