-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from BenjaminsM/master
Changes from Roan for winged helix and circleci instead of jenkins
- Loading branch information
Showing
12 changed files
with
248 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
# | ||
# Python CircleCI 2.0 configuration file | ||
# Check https://circleci.com/docs/2.0/language-python/ for more details. | ||
# | ||
version: 2.1 | ||
orbs: | ||
shellcheck: circleci/[email protected] | ||
jobs: | ||
build: | ||
docker: | ||
- image: cimg/base:stable | ||
working_directory: ~/repo | ||
resource_class: small | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install ShellCheck | ||
command: | | ||
set -e | ||
set -u | ||
set -o pipefail | ||
# Check if we are root or need sudo. | ||
if [[ ${EUID} == 0 ]]; then | ||
export SUDO='' | ||
else | ||
export SUDO='sudo' | ||
fi | ||
SHELLCHECK_VERSION=0.8.0 | ||
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" \ | ||
| tar -xJf - | ||
cd "shellcheck-v${SHELLCHECK_VERSION}/" | ||
${SUDO} cp shellcheck /usr/local/bin/ | ||
- run: | ||
name: Run IndentationCheck | ||
shell: /bin/bash | ||
command: | | ||
set -e | ||
set -u | ||
set -o pipefail | ||
check/indentationcheck.sh | ||
- run: | ||
name: Run ShellCheck | ||
shell: /bin/bash | ||
command: | | ||
set -e | ||
set -u | ||
set -o pipefail | ||
check/shellcheck.sh | ||
... | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
# | ||
# Python CircleCI 2.0 configuration file | ||
# Check https://circleci.com/docs/2.0/language-python/ for more details. | ||
# | ||
version: 2.1 | ||
orbs: | ||
shellcheck: circleci/[email protected] | ||
jobs: | ||
build: | ||
docker: | ||
- image: cimg/base:stable | ||
working_directory: ~/repo | ||
resource_class: small | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install ShellCheck | ||
command: | | ||
set -e | ||
set -u | ||
set -o pipefail | ||
# Check if we are root or need sudo. | ||
if [[ ${EUID} == 0 ]]; then | ||
export SUDO='' | ||
else | ||
export SUDO='sudo' | ||
fi | ||
SHELLCHECK_VERSION=0.8.0 | ||
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" \ | ||
| tar -xJf - | ||
cd "shellcheck-v${SHELLCHECK_VERSION}/" | ||
${SUDO} cp shellcheck /usr/local/bin/ | ||
- run: | ||
name: Run IndentationCheck | ||
shell: /bin/bash | ||
command: | | ||
set -e | ||
set -u | ||
set -o pipefail | ||
check/indentationcheck.sh | ||
- run: | ||
name: Run ShellCheck | ||
shell: /bin/bash | ||
command: | | ||
set -e | ||
set -u | ||
set -o pipefail | ||
check/shellcheck.sh | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
htsLibVersion='HTSlib/1.3.2-foss-2015b' | ||
compareGenotypeCallsVersion='CompareGenotypeCalls/1.8.1-Java-1.8.0_74' | ||
bedToolsVersion='BEDTools/2.25.0-foss-2015b' | ||
htsLibVersion='HTSlib/1.14-foss-2018b' | ||
compareGenotypeCallsVersion='CompareGenotypeCalls/1.8.1-Java-8-LTS' | ||
bedToolsVersion='BEDTools/2.30.0-foss-2018b' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
TMP_LFS='tmp05' | ||
PRM_LFS='prm05' | ||
SCR_LFS="${TMP_LFS}" | ||
DAT_LFS='dat05' | ||
HOSTNAME_TMP='porch+betabarrel' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
TMP_LFS='tmp06' | ||
PRM_LFS='prm06' | ||
SCR_LFS="${TMP_LFS}" | ||
DAT_LFS='dat06' | ||
HOSTNAME_TMP='porch+copperfist' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
TMP_LFS='tmp07' | ||
PRM_LFS='prm07' | ||
SCR_LFS='${TMP_LFS}' | ||
HOSTNAME_PRM='localhost' | ||
DIAGNOSTICS_TMP_LFS='tmp07' | ||
HOSTNAME_TMP='porch+wingedhelix' | ||
DAT_LFS='dat07' | ||
TMP_ROOT_DIAGNOSTICS_DIR="/groups/${GROUP}/${TMP_LFS}/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
TMP_LFS='tmp07' | ||
PRM_LFS='prm07' | ||
SCR_LFS="${TMP_LFS}" | ||
DAT_LFS='dat07' | ||
HOSTNAME_TMP='porch+wingedhelix' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
concordanceDir="/groups/umcg-atd/tmp06/concordance/array-array/" | ||
SAMPLE_ID="pathToSample" | ||
# | ||
## | ||
### Needs an index folder with a file to compare with | ||
### Data to compare with should be in ${concordanceDir} | ||
### Creates subfolders automatically | ||
### data will be bgzipped/tabix'ed | ||
### only first 100K lines will be selected for comparison | ||
### output will be in results ${concordanceDir}/results/ | ||
## | ||
# | ||
|
||
echo "creating workfolders : results,tmp,samplesheets,jobs and original in ${concordanceDir}" | ||
mkdir -p "${concordanceDir}/"{results,tmp,samplesheets,jobs,original} | ||
|
||
module load HTSlib | ||
module list | ||
## indexVCF to compare all input files with: | ||
indexVcf="${concordanceDir}/index/${SAMPLE_ID}" | ||
|
||
## grep first 100K lines for comparison | ||
head -100000 "${indexVcf}" > "${indexVcf}.header100000" | ||
|
||
# get sampleID out of filename | ||
cp "${indexVcf}" "${concordanceDir}/original/" | ||
indexBase=$(basename "${indexVcf%%.*}") | ||
index="${indexBase}" | ||
|
||
#CompareGenotypes needs a bgzipped file | ||
bgzip -c "${indexVcf}.header100000" > "${indexVcf}.gz" | ||
tabix -p vcf "${indexVcf}.gz" | ||
|
||
for i in "${concordanceDir}"*".vcf" | ||
do | ||
# get sampleID without path | ||
sampleIDBase=$(basename "${i}") | ||
# get sampleID without extension | ||
sampleID="${sampleIDBase%%.*}" | ||
|
||
#outputFile prefix | ||
concordanceCheckId="${index}_${sampleID}" | ||
|
||
#create sampleSheet for CompareGenotypes script | ||
sampleSheet="${concordanceDir}//samplesheets/${index}_${sampleID}.sampleId.txt" | ||
echo -e "data1Id\tdata2Id\tlocation1\tlocation2" > "${sampleSheet}" | ||
echo -e "${index}\t${sampleID}\t${indexVcf}\t${i}" >> "${sampleSheet}" | ||
|
||
## grep first 100K lines for comparison | ||
head -100000 "${i}" > "${i}.header100000" | ||
|
||
#CompareGenotypes needs a bgzipped file | ||
echo "tabixing ${i}" | ||
bgzip -c "${i}.header100000" > "${i}.gz" | ||
tabix -p vcf "${i}.gz" | ||
|
||
|
||
# create jobs (EOH must stay left aligned, NO INDENTATION! | ||
|
||
cat << EOH > "${concordanceDir}/jobs/${concordanceCheckId}.sh" | ||
#!/bin/bash | ||
#SBATCH --job-name=Concordance_${concordanceCheckId} | ||
#SBATCH --output=${concordanceDir}/jobs/${concordanceCheckId}.out | ||
#SBATCH --error=${concordanceDir}/jobs/${concordanceCheckId}.err | ||
#SBATCH --time=00:30:00 | ||
#SBATCH --cpus-per-task 1 | ||
#SBATCH --mem 6gb | ||
#SBATCH --open-mode=append | ||
#SBATCH --export=NONE | ||
#SBATCH --get-user-env=60L | ||
set -eu | ||
module load CompareGenotypeCalls | ||
module load BEDTools | ||
module list | ||
java -XX:ParallelGCThreads=1 -Djava.io.tmpdir="${concordanceDir}/temp/" -Xmx9g -jar \${EBROOTCOMPAREGENOTYPECALLS}/CompareGenotypeCalls.jar \ | ||
-d1 "${indexVcf}.gz" \ | ||
-D1 VCF \ | ||
-d2 "${i}.gz" \ | ||
-D2 VCF \ | ||
-ac \ | ||
--sampleMap "${sampleSheet}" \ | ||
-o "${concordanceDir}/tmp/${concordanceCheckId}" \ | ||
-sva | ||
echo "moving ${concordanceDir}/tmp/${concordanceCheckId}.sample to ${concordanceDir}/results/" | ||
mv "${concordanceDir}/tmp/${concordanceCheckId}.sample" "${concordanceDir}/results/" | ||
echo "moving ${concordanceDir}/tmp/${concordanceCheckId}.variants to ${concordanceDir}/results/" | ||
mv "${concordanceDir}/tmp/${concordanceCheckId}.variants" "${concordanceDir}/results/" | ||
echo "finished" | ||
if [ -e "${concordanceDir}/logs/${concordanceCheckId}.ConcordanceCheck.started" ] | ||
then | ||
mv "${concordanceDir}/logs/${concordanceCheckId}.ConcordanceCheck."{started,finished} | ||
else | ||
touch "${concordanceDir}/logs/${concordanceCheckId}.ConcordanceCheck.finished" | ||
fi | ||
mv "${concordanceDir}/jobs/${concordanceCheckId}.sh."{started,finished} | ||
EOH | ||
|
||
echo "submitting: ${concordanceDir}/jobs/${concordanceCheckId}.sh" | ||
sbatch "${concordanceDir}/jobs/${concordanceCheckId}.sh" | ||
|
||
done | ||
|
||
|