From b410689019a09e58a9f5e065f08ca2f9443d215f Mon Sep 17 00:00:00 2001 From: RoanKanninga Date: Mon, 12 Feb 2018 16:02:06 +0100 Subject: [PATCH 1/2] added managevariantlist parser + updated makebedfordiagnostics --- makeBedForDiagnostics.sh | 21 ++++++++++++--------- parseManVarList.sh | 20 ++++++++++++++++++++ 2 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 parseManVarList.sh diff --git a/makeBedForDiagnostics.sh b/makeBedForDiagnostics.sh index e10d293..ede4362 100644 --- a/makeBedForDiagnostics.sh +++ b/makeBedForDiagnostics.sh @@ -16,6 +16,7 @@ Options: -h Show this help. -b Name of the BED file -n Name of the new BED file + -w Bedfile directory --> where to write to (default: this directory) -e Making BED file for exomekit true/false [default=false] =============================================================================================================== EOH @@ -24,9 +25,9 @@ EOH } -while getopts "b:d:e:h" opt; +while getopts "b:n:e:w:h" opt; do - case $opt in h)showHelp;; b)bedfile="${OPTARG}";; n)name="${OPTARG}";; e)exome="${OPTARG}";; + case $opt in h)showHelp;; b)bedfile="${OPTARG}";; n)name="${OPTARG}";; w)workDir="${OPTARG}";; e)exome="${OPTARG}";; esac done @@ -51,6 +52,10 @@ if [[ -z "${exome:-}" ]] then exome="false" fi +if [[ -z "${workdir:-}" ]] +then + workdir=$(pwd) +fi if [ -d "/apps/data/Agilent/${name}" ] @@ -63,22 +68,20 @@ then exit 1 fi -thisDir=$(pwd) umcgDir=/apps/data/UMCG/Diagnostics/ -mkdir -p "${name}/human_g1k_v37/" +mkdir -p "${workdir}/${name}/human_g1k_v37/" echo "created ${name}/human_g1k_v37/" -cp "${bedfile}" "${name}"/ -echo "copied ${bedfile} ${name}/" +cp "${bedfile}" "${workdir}/${name}"/ +echo "copied ${bedfile} ${workdir}/${name}/" ## navigate to folder -cd "${name}" +cd ${workdir}/"${name}" cp "${bedfile}" "human_g1k_v37/captured.bed" echo "copied ${bedfile} to human_g1k_v37/captured.bed" module load ngs-utils - cd human_g1k_v37/ ## Run the prepare step @@ -97,7 +100,7 @@ else fi ## -cd "${thisDir}" +cd "${workdir}" echo "copied ${name} to ${umcgDir}" cp -r "${name}" ${umcgDir} diff --git a/parseManVarList.sh b/parseManVarList.sh new file mode 100644 index 0000000..f26965d --- /dev/null +++ b/parseManVarList.sh @@ -0,0 +1,20 @@ +set -eu +manList=$1 + +ml ngs-utils +EBROOTNGSMINUTILS=$HOME/github/ngs-utils +if ls -d /apps/data/UMCG/ManVarList* 1> /dev/null 2>&1 +then + version=$(ls -d /apps/data/UMCG/ManVarList* | tail -1 | awk 'BEGIN {FS="_v"}{print $2+1}') +else + version=1 +fi +## UMCG-MVL_VKGLconsensusMVL-2017-11-27.txt +awk '{print $1,$2}' "${manList}" \ +| awk -F ':' '{print $1"\t"$2"\t"$3"\t"$4}' | awk '{if ($2 ~ /-/){print $1"\t"$2"\t"$3}else {print $1"\t"$2"-"$2"\t"$3}}' | awk -F '-' '{print $1"\t"$2}' | awk '{print $1"\t"($2-1)"\t"$3"\t"$4}' | sed '1d' > /apps/data/UMCG/ManVarList_v${version}_target.bed +cd /apps/data/UMCG/ + +sh ${EBROOTNGSMINUTILS}/makeBedForDiagnostics.sh -b ManVarList_v${version}_target.bed -n ManVarList_v${version} -w /apps/data/UMCG/ + +cd - + From 1d623286163cc4d4c6a620471f61ae670c897f8c Mon Sep 17 00:00:00 2001 From: RoanKanninga Date: Tue, 13 Feb 2018 15:38:09 +0100 Subject: [PATCH 2/2] added printing rejected samples to file --- countCoverage.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/countCoverage.sh b/countCoverage.sh index 95c8032..3f4fbbc 100644 --- a/countCoverage.sh +++ b/countCoverage.sh @@ -153,6 +153,7 @@ fi for i in "${REJECTEDSAMPLES[@]}" do echo "removed ${WORKDIR}/coverage/${i}.coverage" + echo "removed ${WORKDIR}/coverage/${i}.coverage" > ${WORKDIR}/rejectedSamples.txt rm ${WORKDIR}/coverage/${i}.coverage done