Skip to content

Commit

Permalink
Merge pull request #272 from RoanKanninga/master
Browse files Browse the repository at this point in the history
put quotes around variable in a comparison
  • Loading branch information
Gerbenvandervries committed Aug 20, 2015
2 parents 545f3ac + 2e9346e commit 98912f6
Show file tree
Hide file tree
Showing 24 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/BwaAlign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ${checkStage}
READGROUPLINE="@RG\tID:${lane}\tPL:illumina\tLB:${filePrefix}\tSM:${externalSampleID}"

#If paired-end use two fq files as input, else only one
if [ ${seqType} == "PE" ]
if [ "${seqType}" == "PE" ]
then
#Run BWA for paired-end
bwa mem \
Expand Down
14 changes: 7 additions & 7 deletions compute5/NGS_DNA-3.0.2/protocols/CheckIlluminaEncoding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ do
count=$(( count++ ))
fi

if ! [ ${encoding} == ${lastEncoding} ]
if ! [ "${encoding}" == "${lastEncoding}" ]
then
echo "error, encoding not possible"
echo "${encoding} is not matching last encoding (${lastEncoding}"
Expand All @@ -51,28 +51,28 @@ do
lastEncoding=${encoding}
count=$(( count++ ))
fi
if ! [ ${encoding} == ${lastEncoding} ]
if ! [ "${encoding}" == "${lastEncoding}" ]
then
echo "error, encoding not possible"
echo "${encoding} is not matching last encoding (${lastEncoding}"
echo "LINE: " $line
exit 1
fi
lastEncoding=${encoding}
lastEncoding="${encoding}"
elif [[ "$line" =~ @ ]] || [[ "$line" =~ [A-J] ]]
then
nodecision=$(( nodecision++ ))
else
echo "The encoding is not matching to anything, check FastQ documentation (count=$count)"
fi
done
if [ $nodecision == $numberoflines ]
if [ "${nodecision}" == "${numberoflines}" ]
then
echo "Within all the lines, no decision was made about the encoding, all the encoding is between A and J. This is then probably an 1.9 encoding sample, so 1.9 is set as encoding"
encoding="1.9"
fi

if [ ${encoding} == "1.9" ]
if [ "${encoding}" == "1.9" ]
then
echo "encoding is Illumina 1.8 - Sanger / Illumina 1.9"
else
Expand All @@ -92,11 +92,11 @@ fi
#check illumina encoding using function checkIlluminaEncoding()

#If paired-end do fastqc for both ends, else only for one
if [ ${seqType} == "SR" ]
if [ "${seqType}" == "SR" ]
then
checkIlluminaEncoding ${srBarcodeFqGz}

elif [ $seqType == "PE" ]
elif [ "${seqType}" == "PE" ]
then
checkIlluminaEncoding ${peEnd1BarcodeFqGz}
checkIlluminaEncoding ${peEnd2BarcodeFqGz}
Expand Down
6 changes: 3 additions & 3 deletions compute5/NGS_DNA-3.0.2/protocols/CollectBamMetrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ TMP_DIR=${tempDir}
mv ${tmpCollectBamMetricsPrefix}.quality_by_cycle.pdf ${inputCollectBamMetricsBam}.quality_by_cycle.pdf

#If paired-end data *.insert_size_metrics files also need to be moved
if [ ${seqType} == "PE" ]
if [ "${seqType}" == "PE" ]
then
echo -e "\nDetected paired-end data, moving all files.\n\n"
mv ${tmpCollectBamMetricsPrefix}.insert_size_metrics ${inputCollectBamMetricsBam}.insert_size_metrics
Expand All @@ -82,7 +82,7 @@ TMP_DIR=${tempDir}

######IS THIS STILL NEEDED, IMPROVEMENTS/UPDATES TO BE DONE?#####
#Create nicer insertsize plots if seqType is PE
#if [ ${seqType} == "PE" ]
#if [ "${seqType}" == "PE" ]
#then
# Overwrite the PDFs that were just created by nicer onces:
${recreateInsertSizePdfR} \
Expand All @@ -99,7 +99,7 @@ TMP_DIR=${tempDir}
#####THIS "FAKE" FILE SHOULDN'T BE NEEDED, PLEASE FIX IN NEXT PIPELINE VERSION#####

#Run Picard HsMetrics if capturingKit was used
if [ ${capturingKit} != "None" ]
if [ "${capturingKit}" != "None" ]
then
java -jar -Xmx4g ${EBROOTPICARD}/${picardJar} ${hsMetricsJar} \
INPUT=${inputCollectBamMetricsBam} \
Expand Down
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/CountAllFinishedFiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ countShScripts=$(($countShScripts-3))

rm -f ${projectJobsDir}/${taskId}_INCORRECT

if (( $countShScripts == $countFinishedFiles ))
if [ "${countShScripts}" == "$countFinishedFiles" ]
then
echo "all files are finished" > ${projectJobsDir}/${taskId}_CORRECT
else
Expand Down
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/CoveragePerBase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
sleep 5
module load ${gatkVersion}

if [ $GCC_Analysis == "diagnostiek" ] || [ $GCC_Analysis == "diagnostics" ]
if [ "${GCC_Analysis}" == "diagnostiek" ] || [ "${GCC_Analysis}" == "diagnostics" ]
then
if [ -f ${capturedIntervalsPerBase} ]
then
Expand Down
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/FastQC.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ makeTmpDir ${intermediateDir}
tmpIntermediateDir=${MC_tmpFile}

#If paired-end do fastqc for both ends, else only for one
if [ ${seqType} == "PE" ]
if [ "${seqType}" == "PE" ]
then
fastqc ${peEnd1BarcodeFqGz} \
${peEnd2BarcodeFqGz} \
Expand Down
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/IndelFiltration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ array_contains () {
local seeking=$2
local in=1
for element in "${array[@]}"; do
if [[ $element == $seeking ]]; then
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
Expand Down
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/MergeBam.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ array_contains () {
local seeking=$2
local in=1
for element in "${!array-}"; do
if [[ $element == $seeking ]]; then
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
Expand Down
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/MergeBatches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ array_contains () {
local seeking=$2
local in=1
for element in "${!array-}"; do
if [[ $element == $seeking ]]; then
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
Expand Down
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/MergeIndelsAndSnps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ array_contains () {
local seeking=$2
local in=1
for element in "${!array-}"; do
if [[ $element == $seeking ]]; then
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
Expand Down
4 changes: 2 additions & 2 deletions compute5/NGS_DNA-3.0.2/protocols/Pindel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ configFile=${intermediateDir}/${externalSampleID}.pindel.config.txt


echo "${bamFilePindel} ${targetedInsertSize} ${externalSampleID}" > ${configFile}
if [ ${seqType} == "PE" ]
if [ "${seqType}" == "PE" ]
then
pindel \
-f ${indexFile} \
Expand Down Expand Up @@ -71,7 +71,7 @@ then
perl /gcc/tools/scripts/filterPindelVcf.pl ${pindelOutputVcf}.tmp ${pindelOutputVcf}


elif [ ${seqType} == "SR" ]
elif [ "${seqType}" == "SR" ]
then
echo "Pindel step is skipped because it is not Paired End but the seqType="${seqType}
fi
Expand Down
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/QCReport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ array_contains () {
local seeking=$2
local in=1
for element in "${!array-}"; do
if [[ $element == $seeking ]]; then
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
Expand Down
6 changes: 3 additions & 3 deletions compute5/NGS_DNA-3.0.2/protocols/SequenomConcordanceCheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ else
sed -e 's/chr//' ${sample}.genotypeArray.vcf | awk '{OFS="\t"; if (!/^#/){print $1,$2-1,$2}}' \
> ${sample}.genotypeArray.bed

if [ $build == "build37" ]
if [ "${build}" == "build37" ]
then
###################################
#Sequonomfile is on build 37
Expand Down Expand Up @@ -193,11 +193,11 @@ then
--comp comp_immuno \
--header >> ${sampleConcordanceFile}
fi
if [ $build == "N/A" ]
if [ "${build}" == "N/A" ]
then
echo "ERROR: unsure which build was used. None of the probes we checked was found in the array file."
fi
if [ $build == "ERROR" ]
if [ "${build}" == "ERROR" ]
then
echo "ERROR: one of the probe in the array file has an unexpected position. Therefore, we are not able to tell which build was used."
fi
Expand Down
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/SnpEff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ array_contains () {
local seeking=$2
local in=1
for element in "${!array}"; do
if [[ $element == $seeking ]]; then
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
Expand Down
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/SnpFiltration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ array_contains () {
local seeking=$2
local in=1
for element in "${array[@]}"; do
if [[ $element == $seeking ]]; then
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
Expand Down
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/SnpVQSRFiltration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ array_contains () {
local seeking=$2
local in=1
for element in "${array[@]}"; do
if [[ $element == $seeking ]]; then
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
Expand Down
4 changes: 2 additions & 2 deletions compute5/NGS_DNA-3.0.2/protocols/SpikePhiX.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ then
echo "Skip this step! PhiX was already spiked in!"
exit 0
else
if [ ${seqType} == "SR" ]
if [ "${seqType}" == "SR" ]
then
echo "Spike phiX not implemented yet for Single Read"
exit 1
elif [ $seqType == "PE" ]
elif [ "${seqType}" == "PE" ]
then
echo "Append phiX reads"
cat ${peEnd1BarcodeFqGz} ${phiXEnd1Gz} > ${peEnd1BarcodeFqGz}.tmp
Expand Down
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/SplitIndelsAndSNPs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ array_contains () {
local seeking=$2
local in=1
for element in "${!array-}"; do
if [[ $element == $seeking ]]; then
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
Expand Down
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/VariantAnnotator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ array_contains () {
local seeking=$2
local in=1
for element in "${!array-}"; do
if [[ $element == $seeking ]]; then
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
Expand Down
24 changes: 12 additions & 12 deletions compute5/NGS_DNA-3.0.2/protocols/VariantGVCFCalling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ array_contains () {
local seeking=$2
local in=1
for element in "${!array-}"; do
if [[ $element == $seeking ]]; then
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
Expand Down Expand Up @@ -75,14 +75,14 @@ baitBatchLength=`cat ${capturedBatchBed} | wc -l`
bams=($(printf '%s\n' "${realignedBam[@]}" | sort -u ))
inputs=$(printf ' -I %s ' $(printf '%s\n' ${bams[@]}))

if [ ${baitBatchLength} == 0 ]
if [ ${baitBatchLength} -eq 0 ]
then
echo "skipped ${capturedBatchBed}, because the batch is empty"
else
if [[ ${capturedBatchBed} == *batch-[0-9]*X.bed ]]
then

if [ ${sex} == "Male" ]
if [ "${sex}" == "Male" ]
then
echo "X (male): NON AUTOSOMAL REGION"
java -Xmx12g -XX:ParallelGCThreads=2 -Djava.io.tmpdir=${tempDir} -jar \
Expand All @@ -98,7 +98,7 @@ else
-L ${capturedBatchBed} \
--emitRefConfidence GVCF \
-ploidy 1
elif [ ${sex} == "Female" ]
elif [ "${sex}" == "Female" ]
then
echo "X (female)"
#Run GATK HaplotypeCaller in DISCOVERY mode to call SNPs and indels
Expand All @@ -116,13 +116,13 @@ else
--emitRefConfidence GVCF \
-ploidy 2
fi
elif [[ $capturedBatchBed == *batch-[0-9]*Y.bed ]]
elif [[ "${capturedBatchBed}" == *batch-[0-9]*Y.bed ]]
then
echo "Y"
if [ ${sex} == "Female" ]
if [ "${sex}" == "Female" ]
then
echo "This sample is not a male, chromosome Y skipped!"
elif [ ${sex} == "Male" ]
elif [ "${sex}" == "Male" ]
then
java -Xmx12g -XX:ParallelGCThreads=2 -Djava.io.tmpdir=${tempDir} -jar \
${EBROOTGATK}/${gatkJar} \
Expand Down Expand Up @@ -155,9 +155,9 @@ else
-ploidy 2
fi

if [[ $capturedBatchBed == *batch-[0-9]*X.bed ]]
if [[ "${capturedBatchBed}" == *batch-[0-9]*X.bed ]]
then
if [ -f ${tmpSampleBatchVariantCallsMaleNONPAR} ] && [ -f ${tmpSampleBatchVariantCallsFemale} ]
if [ -f "${tmpSampleBatchVariantCallsMaleNONPAR}" ] && [ -f "${tmpSampleBatchVariantCallsFemale}" ]
then
echo "combine male and female chrX"
java -Xmx2g -jar ${EBROOTGATK}/${gatkJar} \
Expand All @@ -168,12 +168,12 @@ else
--variant ${tmpSampleBatchVariantCallsFemale} \
-o ${tmpSampleBatchVariantCalls}

elif [ ! -f ${tmpSampleBatchVariantCallsMaleNONPAR} ]
elif [ ! -f "${tmpSampleBatchVariantCallsMaleNONPAR}" ]
then
echo "There are no males"
tmpSampleBatchVariantCalls=${tmpSampleBatchVariantCallsFemale}
tmpSampleBatchVariantCallsIdx=${tmpSampleBatchVariantCallsFemaleIdx}
elif [ ! -f ${tmpSampleBatchVariantCallsFemale} ]
elif [ ! -f "${tmpSampleBatchVariantCallsFemale}" ]
then
echo "There are no females!"
tmpSampleBatchVariantCalls=${tmpSampleBatchVariantCallsMaleNONPAR}
Expand All @@ -184,7 +184,7 @@ else
fi

echo -e "\nVariantCalling finished succesfull. Moving temp files to final.\n\n"
if [ -f ${tmpSampleBatchVariantCalls} ]
if [ -f "${tmpSampleBatchVariantCalls}" ]
then
mv ${tmpSampleBatchVariantCalls} ${sampleBatchVariantCalls}
mv ${tmpSampleBatchVariantCallsIdx} ${sampleBatchVariantCallsIdx}
Expand Down
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/VariantGVCFCombine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ array_contains () {
local seeking=$2
local in=1
for element in "${!array-}"; do
if [[ $element == $seeking ]]; then
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
Expand Down
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/VariantGVCFGenotyping.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ array_contains () {
local seeking=$2
local in=1
for element in "${!array-}"; do
if [[ $element == $seeking ]]; then
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
Expand Down
2 changes: 1 addition & 1 deletion compute5/NGS_DNA-3.0.2/protocols/VcfToTable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ array_contains () {
local seeking=$2
local in=1
for element in "${!array-}"; do
if [[ $element == $seeking ]]; then
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
Expand Down
4 changes: 2 additions & 2 deletions compute5/NGS_DNA-3.0.2/protocols/dbNSFPAnnotation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ array_contains () {
local seeking=$2
local in=1
for element in "${!array-}"; do
if [[ $element == $seeking ]]; then
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
Expand Down Expand Up @@ -94,7 +94,7 @@ ${variantAnnotatorSampleOutputSnpsFilteredVcf} > ${tmpDbNSFPSampleVcf}

FIRSTLINE=`head -1 ${tmpDbNSFPSampleVcf}`

if [[ $FIRSTLINE == *"hg38"* ]]
if [[ "$FIRSTLINE" == *"hg38"* ]]
then
sed '1d' ${tmpDbNSFPSampleVcf} > ${dbNSFPSampleVcf}
echo "removed first line of ${tmpDbNSFPSampleVcf} and moved file to ${dbNSFPSampleVcf}"
Expand Down

0 comments on commit 98912f6

Please sign in to comment.