Skip to content
This repository was archived by the owner on Jan 27, 2020. It is now read-only.

Commit f79642e

Browse files
authored
Merge pull request #486 from SciLifeLab/dev
merge dev into master for bug fixes and for v 1.2.3
2 parents 58dce6d + 10de976 commit f79642e

38 files changed

Lines changed: 441 additions & 308 deletions

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
data/chr17_testdata
2-
Annotation
1+
Annotation/
2+
data/chr17_testdata/
33
Preprocessing/
4-
Reports/
54
References/
5+
Reports/
66
VariantCalling/
77
work/
88
.*swp
99
.nextflow*
10+
*.img
11+
*.tar.gz
1012
timeline.html*
1113
trace.txt*
12-
*.tar.gz

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ env:
1111
- NXF_VER=0.25.6 SGT_VER=2.3.1 PROFILE=singularity TEST=ANNOTATESNPEFF TOOL_INSTALL=all
1212
- NXF_VER=0.25.6 PROFILE=docker TEST=ANNOTATESNPEFF TOOL_INSTALL=nextflow
1313
- NXF_VER=0.25.6 PROFILE=docker TEST=ANNOTATEVEP TOOL_INSTALL=nextflow
14-
- NXF_VER=0.25.6 PROFILE=docker TEST=BUILDCONTAINERS TOOL_INSTALL=nextflow
1514
- NXF_VER=0.25.6 SGT_VER=2.3.1 PROFILE=singularity TEST=RECALIBRATE TOOL_INSTALL=all
1615
- NXF_VER=0.25.6 PROFILE=docker TEST=RECALIBRATE TOOL_INSTALL=nextflow
1716
- NXF_VER=0.25.6 SGT_VER=2.3.1 PROFILE=singularity TEST=REALIGN TOOL_INSTALL=all
1817
- NXF_VER=0.25.6 PROFILE=docker TEST=REALIGN TOOL_INSTALL=nextflow
18+
- NXF_VER=0.25.6 PROFILE=docker TEST=BUILDCONTAINERS TOOL_INSTALL=nextflow
1919
- NXF_VER=0.25.6 SGT_VER=2.3.1 PROFILE=singularity TEST=MAPPING TOOL_INSTALL=all
2020
- NXF_VER=0.25.6 PROFILE=docker TEST=MAPPING TOOL_INSTALL=nextflow
2121

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
[![caw version][version-badge]][version-link] [![License][license-badge]][license-link] [![nextflow version][nextflow-badge]][nextflow-link] [![Join the chat at https://gitter.im/SciLifeLab/CAW][gitter-badge]][gitter-link] [![Travis status][travis-badge]][travis-link]
66

7-
87
CAW is a complete open source pipeline to detect somatic variants from WGS data developed at the [National Genomics Infastructure][ngi-link] at [SciLifeLab Stockholm][scilifelab-stockholm-link], Sweden and [National Bioinformatics Infastructure Sweden][nbis-link] at [SciLifeLab][scilifelab-link].
98

109
The pipeline uses [Nextflow][nextflow-link], a bioinformatics domain specific language for workflow building and [Singularity](http://singularity.lbl.gov/), a container technology specific for high-performance computing.

buildContainers.nf

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ kate: syntax groovy; space-indent on; indent-width 2;
3636
================================================================================
3737
*/
3838

39-
version = '1.2.2'
39+
version = '1.2.3'
4040

4141
// Check that Nextflow version is up to date enough
4242
// try / throw / catch works for NF versions < 0.25 when this was implemented
@@ -58,6 +58,22 @@ if (params.version) exit 0, versionMessage()
5858
if (!isAllowedParams(params)) exit 1, "params is unknown, see --help for more information"
5959
if (!checkUppmaxProject()) exit 1, "No UPPMAX project ID found! Use --project <UPPMAX Project ID>"
6060

61+
// Default params:
62+
// Such params are overridden by command line or configuration definitions
63+
64+
// containerPath is empty
65+
params.containerPath = ''
66+
// all containers to be build
67+
params.containers = 'all'
68+
// Docker will not be used
69+
params.docker = false
70+
// Containers will not be pushed on DockerHub
71+
params.push = false
72+
// DockerHub repository is maxulysse
73+
params.repository = 'maxulysse'
74+
// Singularity will not be used
75+
params.singularity = false
76+
6177
verbose = params.verbose
6278
containersList = defineContainersList()
6379
containers = params.containers.split(',').collect {it.trim()}
@@ -67,7 +83,9 @@ push = params.docker && params.push ? true : false
6783
repository = params.repository
6884
tag = params.tag ? params.tag : version
6985
singularity = params.singularity ? true : false
70-
singularityPublishDir = params.singularity && params.singularityPublishDir ? params.singularityPublishDir : "."
86+
containerPath = params.singularity && params.containerPath ? params.containerPath : "."
87+
88+
if (!docker && !singularity) exit 1, 'No builder choose, specify --docker or --singularity, see --help for more information'
7189

7290
if (!checkContainers(containers,containersList)) exit 1, 'Unknown container(s), see --help for more information'
7391

@@ -106,7 +124,7 @@ if (verbose) dockerContainersBuilt = dockerContainersBuilt.view {
106124
process PullSingularityContainers {
107125
tag {repository + "/" + container + ":" + tag}
108126

109-
publishDir singularityPublishDir, mode: 'move'
127+
publishDir containerPath, mode: 'move'
110128

111129
input:
112130
val container from singularityContainers
@@ -188,6 +206,8 @@ def checkParams(it) {
188206
'callName',
189207
'contact-mail',
190208
'contactMail',
209+
'container-path',
210+
'containerPath',
191211
'containers',
192212
'docker',
193213
'genome',
@@ -205,9 +225,7 @@ def checkParams(it) {
205225
'sampleDir',
206226
'single-CPUMem',
207227
'singleCPUMem',
208-
'singularity-publish-dir',
209228
'singularity',
210-
'singularityPublishDir',
211229
'step',
212230
'tag',
213231
'test',
@@ -241,7 +259,6 @@ def defineContainersList(){
241259
'snpeff',
242260
'snpeffgrch37',
243261
'snpeffgrch38',
244-
'vep',
245262
'vepgrch37',
246263
'vepgrch38'
247264
]
@@ -258,7 +275,7 @@ def helpMessage() {
258275
log.info " Usage:"
259276
log.info " nextflow run SciLifeLab/buildContainers.nf [--docker] [--push]"
260277
log.info " [--containers <container1...>] [--singularity]"
261-
log.info " [--singularityPublishDir <path>]"
278+
log.info " [--containerPath <path>]"
262279
log.info " [--tag <tag>] [--repository <repository>]"
263280
log.info " Example:"
264281
log.info " nextflow run . --docker --containers multiqc,fastqc"
@@ -275,7 +292,7 @@ def helpMessage() {
275292
log.info " --repository: Build containers under given repository"
276293
log.info " Default: maxulysse"
277294
log.info " --singularity: Build containers using Singularity"
278-
log.info " --singularityPublishDir: Select where to download containers"
295+
log.info " --containerPath: Select where to download containers"
279296
log.info " Default: $PWD"
280297
log.info " --tag`: Build containers using given tag"
281298
log.info " Default (version number): " + version

buildReferences.nf

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ kate: syntax groovy; space-indent on; indent-width 2;
3939
================================================================================
4040
*/
4141

42-
version = '1.2.2'
42+
version = '1.2.3'
4343

4444
// Check that Nextflow version is up to date enough
4545
// try / throw / catch works for NF versions < 0.25 when this was implemented
@@ -61,8 +61,14 @@ if (params.version) exit 0, versionMessage()
6161
if (!isAllowedParams(params)) exit 1, "params is unknown, see --help for more information"
6262
if (!checkUppmaxProject()) exit 1, "No UPPMAX project ID found! Use --project <UPPMAX Project ID>"
6363

64+
// Default params:
65+
// Such params are overridden by command line or configuration definitions
66+
67+
// No download
6468
params.download = false
65-
params.refDir = ""
69+
// refDir is empty
70+
params.refDir = ''
71+
6672
verbose = params.verbose
6773
download = params.download ? true : false
6874

@@ -309,6 +315,8 @@ def checkParams(it) {
309315
'callName',
310316
'contact-mail',
311317
'contactMail',
318+
'container-path',
319+
'containerPath',
312320
'containers',
313321
'docker',
314322
'download',
@@ -331,9 +339,7 @@ def checkParams(it) {
331339
'sampleDir',
332340
'single-CPUMem',
333341
'singleCPUMem',
334-
'singularity-publish-dir',
335342
'singularity',
336-
'singularityPublishDir',
337343
'step',
338344
'tag',
339345
'test',

configuration/containers.config

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
vim: syntax=groovy
3+
-*- mode: groovy;-*-
4+
* -------------------------------------------------
5+
* Nextflow config file for CAW project
6+
* -------------------------------------------------
7+
* Images for every process
8+
* All images will be pulled automatically
9+
* -------------------------------------------------
10+
*/
11+
12+
process {
13+
$BuildBWAindexes.container = "${params.repository}/caw:${params.tag}"
14+
$BuildPicardIndex.container = "${params.repository}/picard:${params.tag}"
15+
$BuildSAMToolsIndex.container = "${params.repository}/caw:${params.tag}"
16+
$BuildVCFIndex.container = "${params.repository}/igvtools:${params.tag}"
17+
$ConcatVCF.container = "${params.repository}/caw:${params.tag}"
18+
$CreateRecalibrationTable.container = "${params.repository}/gatk:${params.tag}"
19+
$IndelRealigner.container = "${params.repository}/gatk:${params.tag}"
20+
$MapReads.container = "${params.repository}/caw:${params.tag}"
21+
$MarkDuplicates.container = "${params.repository}/picard:${params.tag}"
22+
$MergeBams.container = "${params.repository}/caw:${params.tag}"
23+
$RealignerTargetCreator.container = "${params.repository}/gatk:${params.tag}"
24+
$RecalibrateBam.container = "${params.repository}/gatk:${params.tag}"
25+
$RunAlleleCount.container = "${params.repository}/runallelecount:${params.tag}"
26+
$RunAscat.container = "${params.repository}/r-base:${params.tag}"
27+
$RunBamQC.container = "${params.repository}/qualimap:${params.tag}"
28+
$RunBcftoolsStats.container = "${params.repository}/caw:${params.tag}"
29+
$RunConvertAlleleCounts.container = "${params.repository}/r-base:${params.tag}"
30+
$RunFastQC.container = "${params.repository}/fastqc:${params.tag}"
31+
$RunFreeBayes.container = "${params.repository}/freebayes:${params.tag}"
32+
$RunGenotypeGVCFs.container = "${params.repository}/gatk:${params.tag}"
33+
$RunHaplotypecaller.container = "${params.repository}/gatk:${params.tag}"
34+
$RunManta.container = "${params.repository}/caw:${params.tag}"
35+
$RunMultiQC.container = "${params.repository}/multiqc:${params.tag}"
36+
$RunMutect1.container = "${params.repository}/mutect1:${params.tag}"
37+
$RunMutect2.container = "${params.repository}/gatk:${params.tag}"
38+
$RunSamtoolsStats.container = "${params.repository}/caw:${params.tag}"
39+
$RunSingleManta.container = "${params.repository}/caw:${params.tag}"
40+
$RunSingleStrelka.container = "${params.repository}/caw:${params.tag}"
41+
$RunSnpeff.container = {params.genome == "GRCh38" ? "${params.repository}/snpeffgrch38:${params.tag}" : "${params.repository}/snpeffgrch37:${params.tag}"}
42+
$RunStrelka.container = "${params.repository}/caw:${params.tag}"
43+
$RunVEP.container = {params.genome == "GRCh38" ? "${params.repository}/vepgrch38:${params.tag}" : "${params.repository}/vepgrch37:${params.tag}"}
44+
}

configuration/docker.config

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,5 @@ docker {
1414
fixOwnership = true
1515
}
1616

17-
process {
18-
$BuildBWAindexes.container = 'maxulysse/caw:1.2.1'
19-
$BuildPicardIndex.container = 'maxulysse/picard:1.2.1'
20-
$BuildSAMToolsIndex.container = 'maxulysse/caw:1.2.1'
21-
$BuildVCFIndex.container = 'maxulysse/igvtools:1.2.1'
22-
$ConcatVCF.container = 'maxulysse/caw:1.2.1'
23-
$CreateRecalibrationTable.container = 'maxulysse/gatk:1.2.1'
24-
$IndelRealigner.container = 'maxulysse/gatk:1.2.1'
25-
$MapReads.container = 'maxulysse/caw:1.2.1'
26-
$MarkDuplicates.container = 'maxulysse/picard:1.2.1'
27-
$MergeBams.container = 'maxulysse/caw:1.2.1'
28-
$RealignerTargetCreator.container = 'maxulysse/gatk:1.2.1'
29-
$RecalibrateBam.container = 'maxulysse/gatk:1.2.1'
30-
$RunAlleleCount.container = 'maxulysse/runallelecount:1.2.1'
31-
$RunAscat.container = 'maxulysse/r-base:1.2.1'
32-
$RunBamQC.container = 'maxulysse/qualimap:1.2.1'
33-
$RunBcftoolsStats.container = 'maxulysse/caw:1.2.1'
34-
$RunConvertAlleleCounts.container = 'maxulysse/r-base:1.2.1'
35-
$RunFastQC.container = 'maxulysse/fastqc:1.2.1'
36-
$RunFreeBayes.container = 'maxulysse/freebayes:1.2.1'
37-
$RunGenotypeGVCFs.container = 'maxulysse/gatk:1.2.1'
38-
$RunHaplotypecaller.container = 'maxulysse/gatk:1.2.1'
39-
$RunManta.container = 'maxulysse/caw:1.2.1'
40-
$RunMultiQC.container = 'maxulysse/multiqc:1.2.1'
41-
$RunMutect1.container = 'maxulysse/mutect1:1.2.1'
42-
$RunMutect2.container = 'maxulysse/gatk:1.2.1'
43-
$RunSamtoolsStats.container = 'maxulysse/caw:1.2.1'
44-
$RunSingleManta.container = 'maxulysse/caw:1.2.1'
45-
$RunSingleStrelka.container = 'maxulysse/caw:1.2.1'
46-
$RunSnpeff.container = {params.genome == "GRCh38" ? 'maxulysse/snpeffgrch38:1.2.1' : 'maxulysse/snpeffgrch37:1.2.1'}
47-
$RunStrelka.container = 'maxulysse/caw:1.2.1'
48-
$RunVEP.container = {params.genome == "GRCh38" ? 'maxulysse/vepgrch38:1.2.1' : 'maxulysse/vepgrch37:1.2.1'}
49-
}
17+
params.repository='maxulysse'
18+
params.tag='1.2.3'

configuration/singularity-path.config

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,43 @@ vim: syntax=groovy
1212

1313
singularity {
1414
enabled = true
15+
runOptions = "--bind /scratch"
1516
}
1617

18+
params.containerPath='containers'
19+
params.tag='1.2.3'
20+
1721
process {
18-
$BuildBWAindexes.container = 'containers/caw-1.2.1.img'
19-
$BuildPicardIndex.container = 'containers/picard-1.2.1.img'
20-
$BuildSAMToolsIndex.container = 'containers/caw-1.2.1.img'
21-
$BuildVCFIndex.container = 'containers/igvtools-1.2.1.img'
22-
$ConcatVCF.container = 'containers/caw-1.2.1.img'
23-
$CreateRecalibrationTable.container = 'containers/gatk-1.2.1.img'
24-
$GenerateMultiQCconfig.container = 'containers/multiqc-1.2.1.img'
25-
$IndelRealigner.container = 'containers/gatk-1.2.1.img'
26-
$MapReads.container = 'containers/caw-1.2.1.img'
27-
$MarkDuplicates.container = 'containers/picard-1.2.1.img'
28-
$MergeBams.container = 'containers/caw-1.2.1.img'
29-
$RealignerTargetCreator.container = 'containers/gatk-1.2.1.img'
30-
$RecalibrateBam.container = 'containers/gatk-1.2.1.img'
31-
$RunAlleleCount.container = 'containers/runallelecount-1.2.1.img'
32-
$RunAscat.container = 'containers/r-base-1.2.1.img'
33-
$RunBamQC.container = 'containers/qualimap-1.2.1.img'
34-
$RunBcftoolsStats.container = 'containers/caw-1.2.1.img'
35-
$RunConvertAlleleCounts.container = 'containers/r-base-1.2.1.img'
36-
$RunFastQC.container = 'containers/fastqc-1.2.1.img'
37-
$RunFreeBayes.container = 'containers/freebayes-1.2.1.img'
38-
$RunGenotypeGVCFs.container = 'containers/gatk-1.2.1.img'
39-
$RunHaplotypecaller.container = 'containers/gatk-1.2.1.img'
40-
$RunManta.container = 'containers/caw-1.2.1.img'
41-
$RunMultiQC.container = 'containers/multiqc-1.2.1.img'
42-
$RunMutect1.container = 'containers/mutect1-1.2.1.img'
43-
$RunMutect2.container = 'containers/gatk-1.2.1.img'
44-
$RunSamtoolsStats.container = 'containers/caw-1.2.1.img'
45-
$RunSingleManta.container = 'containers/caw-1.2.1.img'
46-
$RunSingleStrelka.container = 'containers/caw-1.2.1.img'
47-
$RunSnpeff.container = {params.genome == "GRCh38" ? 'containers/snpeffgrch38-1.2.1.img' : 'containers/snpeffgrch37-1.2.1.img'}
48-
$RunStrelka.container = 'containers/caw-1.2.1.img'
49-
$RunVEP.container = {params.genome == "GRCh38" ? 'containers/vepgrch38-1.2.1.img' : 'containers/vepgrch37-1.2.1.img'}
22+
$BuildBWAindexes.container = "${params.containerPath}/caw-${params.tag}.img"
23+
$BuildPicardIndex.container = "${params.containerPath}/picard-${params.tag}.img"
24+
$BuildSAMToolsIndex.container = "${params.containerPath}/caw-${params.tag}.img"
25+
$BuildVCFIndex.container = "${params.containerPath}/igvtools-${params.tag}.img"
26+
$ConcatVCF.container = "${params.containerPath}/caw-${params.tag}.img"
27+
$CreateRecalibrationTable.container = "${params.containerPath}/gatk-${params.tag}.img"
28+
$GenerateMultiQCconfig.container = "${params.containerPath}/multiqc-${params.tag}.img"
29+
$IndelRealigner.container = "${params.containerPath}/gatk-${params.tag}.img"
30+
$MapReads.container = "${params.containerPath}/caw-${params.tag}.img"
31+
$MarkDuplicates.container = "${params.containerPath}/picard-${params.tag}.img"
32+
$MergeBams.container = "${params.containerPath}/caw-${params.tag}.img"
33+
$RealignerTargetCreator.container = "${params.containerPath}/gatk-${params.tag}.img"
34+
$RecalibrateBam.container = "${params.containerPath}/gatk-${params.tag}.img"
35+
$RunAlleleCount.container = "${params.containerPath}/runallelecount-${params.tag}.img"
36+
$RunAscat.container = "${params.containerPath}/r-params.base-${params.tag}.img"
37+
$RunBamQC.container = "${params.containerPath}/qualimap-${params.tag}.img"
38+
$RunBcftoolsStats.container = "${params.containerPath}/caw-${params.tag}.img"
39+
$RunConvertAlleleCounts.container = "${params.containerPath}/r-params.base-${params.tag}.img"
40+
$RunFastQC.container = "${params.containerPath}/fastqc-${params.tag}.img"
41+
$RunFreeBayes.container = "${params.containerPath}/freebayes-${params.tag}.img"
42+
$RunGenotypeGVCFs.container = "${params.containerPath}/gatk-${params.tag}.img"
43+
$RunHaplotypecaller.container = "${params.containerPath}/gatk-${params.tag}.img"
44+
$RunManta.container = "${params.containerPath}/caw-${params.tag}.img"
45+
$RunMultiQC.container = "${params.containerPath}/multiqc-${params.tag}.img"
46+
$RunMutect1.container = "${params.containerPath}/mutect1-${params.tag}.img"
47+
$RunMutect2.container = "${params.containerPath}/gatk-${params.tag}.img"
48+
$RunSamtoolsStats.container = "${params.containerPath}/caw-${params.tag}.img"
49+
$RunSingleManta.container = "${params.containerPath}/caw-${params.tag}.img"
50+
$RunSingleStrelka.container = "${params.containerPath}/caw-${params.tag}.img"
51+
$RunSnpeff.container = {params.genome == "GRCh38" ? "${params.containerPath}/snpeffgrch38-${params.tag}.img" : "${params.containerPath}/snpeffgrch37-${params.tag}.img"}
52+
$RunStrelka.container = "${params.containerPath}/caw-${params.tag}.img"
53+
$RunVEP.container = {params.genome == "GRCh38" ? "${params.containerPath}/vepgrch38-${params.tag}.img" : "${params.containerPath}/vepgrch37-${params.tag}.img"}
5054
}

0 commit comments

Comments
 (0)