Skip to content

Commit

Permalink
Merge pull request #289 from RoanKanninga/b37_gearshift
Browse files Browse the repository at this point in the history
updates for new GATK4 pipeline on new diagnostic clusters
  • Loading branch information
pneerincx authored Mar 7, 2022
2 parents 7d213ed + cb5e891 commit 47be3ca
Show file tree
Hide file tree
Showing 57 changed files with 1,052 additions and 848 deletions.
3 changes: 1 addition & 2 deletions batchIDList_chr.csv
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ batchID
20
21
22
Xp
Xnp
X
Y
MT
NC_001422.1
31 changes: 31 additions & 0 deletions check/indentationcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

#
# Use either WORKSPACE location for Jenkins or
# resolve path to scripts we need to check
# when executed manually outside Jenkins.
#
if [[ -z "${WORKSPACE:-}" ]]; then
MYDIR="$(cd -P "$(dirname "${0}")" && pwd)"
WORKSPACE="$(dirname ${MYDIR})"
fi

echo '#####################################################################################'
echo ' Bash code must be indented with TABs. Checking for lines indented with spaces ... '
echo '#####################################################################################'
grep -n '^[[:space:]]* [[:space:]]*' "${WORKSPACE:-../}"/{protocols,scripts}/*.*sh
grep_exit_status="${?}"
if [[ "${grep_exit_status}" -eq 0 ]]; then
echo '#####################################################################################'
echo ' ERROR: found Bash files containing lines (partially) indented with spaces.'
echo '#####################################################################################'
exit 1
elif [[ "${grep_exit_status}" -eq 1 ]]; then
echo ' Ok: all Bash files indented with TABs.'
echo '####################################################################################'
exit 0
else
echo ' FAILED: indentation sanity check failed.'
echo '####################################################################################'
exit 1
fi
108 changes: 108 additions & 0 deletions check/shellcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#!/bin/bash

#
# Disable some shellcheck warnings:
# * SC2004: $/${} is unnecessary on arithmetic variables.
# But for consistency we prefer to always use ${} anyway.
# * SC2015: Note that A && B || C is not if-then-else. C may run when A is true.
# We know and use this construct regularly to create "transactions"
# where C is only executed when both A and B have succeeded.
# * SC2154: Due to Molgenis Compute string initialization the warning is not valid
#
# * SC2148: the shebang is declared in the header.ftl not in the protocols
#

export SHELLCHECK_OPTS="-e SC2004 -e SC2015 -e SC2154 -e SC2148"

function showHelp() {
#
# Display commandline help on STDOUT.
#
cat <<EOH
===============================================================================================================
Script for sanity checking of Bash code of this repo using ShellCheck.
Usage:
$(basename "${0}") OPTIONS
Options:
-h Show this help.
-v Enables verbose output.
===============================================================================================================
EOH
exit 0
}


#
# Parse commandline options
#
while getopts ":hv" opt
do
case "${opt}" in
h)
showHelp
;;
v)
verbose='1'
;;
\?)
printf '%s\n' "FATAL: Invalid option -${OPTARG}. Try $(basename "${0}") -h for help."
exit 1
;;
:)
printf '%s\n' "FATAL: Option -${OPTARG} requires an argument. Try $(basename "${0}") -h for help."
exit 1
;;
*)
printf '%s\n' "FATAL Unhandled option. Try $(basename "${0}") -h for help."
exit 1
;;
esac
done

#
# Check if ShellCheck is installed.
#
which shellcheck 2>&1 >/dev/null \
|| {
printf '%s\n' 'FATAL: cannot find shellcheck; make sure it is installed and can be found in ${PATH}.'
exit 1
}

#
# Run ShellCheck for all Bash scripts in the bin/ subdir.
# * Includes sourced files, so the libraries from the lib/ subfolder
# are checked too as long a they are used in at least one script.
# * Select format and output based on whether this script is
# executed by Jenkins or by a regular user.
#
if [[ -n "${WORKSPACE:-}" ]]
then
#
# Exclude SC2154 (warning for variables that are referenced but not assigned),
# because we cannot easily resolve variables sourced from etc/*.cfg config files.
#
export SHELLCHECK_OPTS="${SHELLCHECK_OPTS} -e SC2154"
#
# ShellCheck for Jenkins.
#
shellcheck -a -x -o all -f checkstyle "${WORKSPACE}"/protocols/*.sh | tee checkstyle-result.xml
#
# Reformat the generated report to add hyperlinks to the ShellCheck issues on the wiki:
# https://github.com/koalaman/shellcheck/wiki/SC${ISSUENUMBER}
# explaining what is wrong with the code / style and how to improve it.
#
perl -pi -e "s|message='([^']+)'\s+source='ShellCheck.(SC[0-9]+)'|message='&lt;a href=&quot;https://github.com/koalaman/shellcheck/wiki/\$2&quot;&gt;\$2: \$1&lt;/a&gt;' source='ShellCheck.\$2'|" checkstyle-result.xml
else
#
# ShellCheck for regular user on the commandline.
#
MYDIR="$(cd -P "$(dirname "${0}")" && pwd)"
if [[ "${verbose:-0}" -eq 1 ]]
then
cd "${MYDIR}/.."
shellcheck -a -x -o all -f tty protocols/*.sh # cannot use the printf construct used below for non-vebose output as it destroys the terminal colors.
cd '-' # Goes back to previous directory before we changed to ${MYDIR}.
else
printf '%s\n' "$(cd "${MYDIR}/.." && shellcheck -a -x -o all -f gcc protocols/*.sh)"
fi
fi
24 changes: 13 additions & 11 deletions parameters.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,40 @@ checkStage,module list
javaSuffix,Java-8-LTS
javaVersion,Java/8-LTS
hpoVersion,90
gatkJar,gatk-package-4.2.4.2-local.jar
gavinPlusJar,gavin-plus-1.5.0-RELEASE.jar
picardJar,picard.jar
vepDBVersion,92
vepAssemblyVersion,GRCh37
bcfToolsVersion,BCFtools/1.14-${toolChain_max}
bedToolsVersion,BEDTools/2.30.0-${toolChain_max}
bwaVersion,BWA/0.7.17-${toolChain_min}
computeVersion,Molgenis-Compute/v19.01.1-${javaSuffix}
caddVersion,CADD/v1.4-${toolChain_max}
caddVersion,CADD/v1.3-${toolChain_max}
convadingVersion,1.2.1-${toolChain_min}
fastqcVersion,FastQC/0.11.9-${javaSuffix}
gatkVersion,GATK/4.2.4.1-${javaSuffix}
gatkJar,gatk-package-local.jar
gavinPlusJar,gavin-plus-RELEASE.jar
gavinPlusVersion,gavin-plus/1.5.0-${javaSuffix}
gVCF2BEDVersion,gVCF2BED/1.0.0-${toolChain_min}
refGnomADExomesVersion,2.1.1
refGnomADGenomesVersion,r2.0.2
hashdeepVersion,hashdeep/4.4-${toolChain_max}
htsLibVersion,HTSlib/1.14-${toolChain_max}
iolibVersion,io_lib/1.14.11-${toolChain_min}
mantaVersion,manta/1.6.0-${toolChain_min}
multiQCVersion,multiqc/1.11-${toolChain_max}
ngsUtilsVersion,ngs-utils/22.01.1
perlPlusVersion,PerlPlus/5.30.0-${toolChain_min}-v19.08.1
plink1Version,PLINK/1.07-x86_64
plink2Version,plink/1.9-beta6-20190617
plinkSeqVersion,plinkseq/x86_64-0.10
picardVersion,picard/2.26.10-${javaSuffix}
pigzVersion,pigz/2.7-${toolChain_max}
python2Version,Python/2.7.16-${toolChain_min}
pythonVersion,Python/3.10.2-${toolChain_min}-bare
rVersion,R/4.0.3-${toolChain_max}
sambambaVersion,sambamba/0.7.0
samtoolsVersion,SAMtools/1.14-${toolChain_max}
seqTkVersion,seqtk/1.3-${toolChain_min}
snpEffVersion,snpEff/4.3t-Java-${javaSuffix}
snpEffVersion,snpEff/4.3t-${javaSuffix}
vcfAnnoVersion,vcfanno/v0.3.3
vepVersion,VEP/90.5
vcfAnnoExecutable,vcfanno

##### GENERAL DIRECTORIES #####
dataDir,${appsDir}/data/
Expand Down Expand Up @@ -184,8 +186,8 @@ caddAnnotation,${dataDir}/CADD/whole_genome_SNVs.tsv.gz
caddAnnotationVcf,${dataDir}/CADD/whole_genome_SNVs.vcf.gz
caddUnknownIndelAnnotation,${projectPrefix}.batch-${batchID}.unknown.indels.vcf.gz
gonlAnnotation,${dataDir}/gonl/release5_noContam_noChildren_with_AN_AC_GTC_stripped/
gnomADGenomesAnnotation,${dataDir}/gnomAD/release-170228/vcf/genomes/r2.0.2/
gnomADExomesAnnotation,${dataDir}/gnomAD/release-170228/vcf/exomes/
gnomADGenomesAnnotation,${dataDir}/gnomAD/release-170228/vcf/genomes/${refGnomADGenomesVersion}/
gnomADExomesAnnotation,${dataDir}/gnomAD/${refGnomADExomesVersion}/
clinvarAnnotation,${dataDir}/ClinVar/clinvar_20180401.vcf.gz
mantaDir,${intermediateDir}/Manta/${externalSampleID}/
wgsMetrics,${dedupBamMetrics}.wgs_metrics
Expand Down
6 changes: 3 additions & 3 deletions parameters_resources_wgs.csv
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ walltime_protocols_ApplyBaseRecalibration,02:30:00
walltime_protocols_AnnotateVcf,05:59:00
walltime_protocols_Autotest,05:59:00
walltime_protocols_BaseRecalibrator,15:59:00
walltime_protocols_BwaAlignAndSortSam,56:59:00
walltime_protocols_BwaAlignAndSortSam,76:59:00
walltime_protocols_CartegeniaFiltering,05:59:00
walltime_protocols_CartegeniaTree,05:59:00
walltime_protocols_CollectBamIndexMetrics,05:59:00
Expand All @@ -108,8 +108,8 @@ walltime_protocols_GenderCheck,00:30:00
walltime_protocols_InSilicoConcordance,00:20:00
walltime_protocols_IndelFiltration,05:59:00
walltime_protocols_MakeDedupBamMd5,01:00:00
walltime_protocols_Manta,25:59:00
walltime_protocols_MarkDuplicates,25:59:00
walltime_protocols_Manta,23:59:00
walltime_protocols_MarkDuplicates,23:59:00
walltime_protocols_MergeBam,05:59:00
walltime_protocols_MergeBatches,25:59:00
walltime_protocols_MergeIndelsAndSnpsProject,05:59:00
Expand Down
Loading

0 comments on commit 47be3ca

Please sign in to comment.