Skip to content

Commit 563d1ca

Browse files
configs to allow convenient primer change
1 parent 767f66c commit 563d1ca

File tree

7 files changed

+414
-17
lines changed

7 files changed

+414
-17
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Microbial Utility Toolbox And wrapper for data traNsmission and Transformation
3333
### Self-test
3434
* `source activate D_mutant`
3535
* `cd MUTANT`
36-
* `mutant analyse sarscov2 tests/testdata/fasta_files --profiles local,docker --config_artic mutant/config/local/artic.json --config_mutant mutant/config/local/mutant.json --config_case tests/testdata/MIC3109_artic.json`
36+
* `mutant analyse sarscov2 tests/testdata/fasta_files --profiles local,docker --config_artic mutant/config/local/default_config.json --config_mutant mutant/config/local/mutant.json --config_case tests/testdata/MIC3109_artic.json`
3737
* Wait for pipeline completion (~3m). Check results in `./results/`
3838

3939
Or install MUTANT under S_mutant and run `cg workflow mutant start frankhusky` with results in `/home/proj/stage/mutant/cases/frankhusky`

mutant/cli.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def analyse(ctx):
3737
@click.option(
3838
"--config_artic",
3939
help="Custom artic configuration file",
40-
default="{}/config/hasta/artic.json".format(WD),
40+
default="{}/config/hasta/default_config.json".format(WD),
4141
)
4242
@click.option("--config_case", help="Provided config for the case", default="")
4343
@click.option(
@@ -138,7 +138,7 @@ def sarscov2(ctx):
138138
@click.option(
139139
"--config_artic",
140140
help="Custom artic configuration file",
141-
default="{}/config/hasta/artic.json".format(WD),
141+
default="{}/config/hasta/default_config.json".format(WD),
142142
)
143143
@click.option("--fastq_folder", help="Sequence data folder for the case", required=True)
144144
@click.option("--config_case", help="Provided config for the case", required=True)
@@ -173,7 +173,7 @@ def postproc(ctx, input_folder, config_artic, fastq_folder, config_case):
173173
@click.option(
174174
"--config_artic",
175175
help="Custom artic configuration file",
176-
default="{}/config/hasta/artic.json".format(WD),
176+
default="{}/config/hasta/default_config.json".format(WD),
177177
)
178178
@click.option("--config_case", help="Provided config for the case", required=True)
179179
@click.pass_context
File renamed without changes.

mutant/config/hasta/artic-stage.json mutant/config/hasta/default_config_stage.json

+55-12
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ params {
3030
tracedir = "${params.outdir}/pipeline_info"
3131
// cache option makes it a bit easier to set conda or singularity cacheDir
3232
cache = "/home/proj/stage/mutant/nf-cache/"
33-
// Scheme name
34-
scheme = 'nCoV-2019'
35-
// Scheme version
36-
schemeVersion = 'V3'
3733
// gff file
3834
gff = "$baseDir/typing/MN908947.3.gff"
3935
// SARS-CoV-2 VOC
@@ -45,9 +41,9 @@ if ( params.medaka || params.nanopolish ) {
4541
// Clinical genomics override
4642
params {
4743
// Minimum read length for artic guppyplex
48-
min_length = 400
44+
min_length = 150
4945
// Maximum read length for artic guppyplex
50-
max_length = 700
46+
max_length = 1200
5147
// Set to an integer to enable normalising in artic minion
5248
// IF SET TO false THIS WILL USE artic minion DEFAULT (100)
5349
normalise = 500
@@ -63,6 +59,14 @@ if ( params.medaka || params.nanopolish ) {
6359
csqAfThreshold = 0.75
6460
// Minimum coverage depth to call aa consequences of variant.
6561
csqDpThreshold = 20
62+
// Repo to download your primer scheme from
63+
schemeRepoURL = 'https://github.com/Clinical-Genomics/primer-schemes.git'
64+
// Directory within schemeRepoURL that contains primer schemes
65+
schemeDir = 'primer-schemes'
66+
// Scheme name
67+
scheme = 'midnight_nanopore'
68+
// Scheme version
69+
schemeVersion = 'V1'
6670
}
6771
}
6872

@@ -96,6 +100,14 @@ if ( params.illumina ) {
96100
wgsMetricsOptions = "--COVERAGE_CAP 1000000 --LOCUS_ACCUMULATION_CAP 1000000"
97101
// Customization of multiQC report
98102
multiqcOptions = '--cl_config "picard_config: { general_stats_target_coverage: [10,30,50,100] }" --module cutadapt --module fastqc --module ivar --module picard'
103+
// Repo to download your primer scheme from
104+
schemeRepoURL = 'https://github.com/artic-network/primer-schemes.git'
105+
// Directory within schemeRepoURL that contains primer schemes
106+
schemeDir = 'primer-schemes'
107+
// Scheme name
108+
scheme = 'nCoV-2019'
109+
// Scheme version
110+
schemeVersion = 'V3'
99111
}
100112
}
101113

@@ -104,12 +116,13 @@ if ( params.illumina ) {
104116
profiles {
105117
conda {
106118
if ( params.medaka || params.nanopolish ) {
107-
process.conda = "$baseDir/environments/nanopore/environment.yml"
108-
} else if (params.illumina) {
109-
process.conda = "$baseDir/environments/illumina/environment.yml"
119+
process.conda = "$baseDir/environments/nanopore/environment.yml"
120+
}
121+
else if (params.illumina) {
122+
process.conda = "$baseDir/environments/illumina/environment.yml"
110123
}
111124
if (params.cache){
112-
conda.cacheDir = params.cache
125+
conda.cacheDir = params.cache
113126
}
114127
includeConfig "$baseDir/conf/conda.config"
115128
}
@@ -123,7 +136,38 @@ profiles {
123136
singularity.autoMounts = true
124137
// Container
125138
if ( params.medaka || params.nanopolish ) {
126-
process.container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
139+
process {
140+
withName:articDownloadScheme {
141+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
142+
}
143+
withName:articGuppyPlex {
144+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
145+
}
146+
withName:articMinIONMedaka {
147+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
148+
}
149+
withName:articRemoveUnmappedReads {
150+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
151+
}
152+
withName:makeQCCSV {
153+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
154+
}
155+
withName:writeQCSummaryCSV {
156+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
157+
}
158+
withName:collateSamples {
159+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
160+
}
161+
withName:pangolinTyping {
162+
container = "file:///${baseDir}/artic-ncov2019-pangolin.sif"
163+
}
164+
withName:typeVariants {
165+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
166+
}
167+
withName:mergeTypingCSVs {
168+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
169+
}
170+
}
127171
}
128172
else if (params.illumina) {
129173
process.container = "file:///${baseDir}/artic-ncov2019-illumina.sif"
@@ -169,4 +213,3 @@ manifest {
169213
nextflowVersion = '>=20.01.0'
170214
version = '1.0.0'
171215
}
172-
+181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
// Global default params, used in configs
2+
profiles {
3+
slurm {
4+
process.executor = 'slurm'
5+
process.clusterOptions = { "-A production --qos high" }
6+
process.time = '1h'
7+
process.memory = '16 GB'
8+
process.cpus = 4
9+
process.errorStrategy = 'retry'
10+
process.maxRetries = 2
11+
}
12+
}
13+
process {
14+
withLabel: largecpu {
15+
cpus = 6
16+
}
17+
withLabel: largemem {
18+
memory = '48 GB'
19+
}
20+
}
21+
22+
// Load base.config by default for all pipelines
23+
includeConfig "$baseDir/conf/base.config"
24+
25+
params {
26+
// Workflow flags
27+
outdir = 'results'
28+
// Boilerplate options
29+
help = false
30+
tracedir = "${params.outdir}/pipeline_info"
31+
// cache option makes it a bit easier to set conda or singularity cacheDir
32+
cache = "/home/proj/production/mutant/nf-cache/"
33+
// gff file
34+
gff = "$baseDir/typing/MN908947.3.gff"
35+
// SARS-CoV-2 VOC
36+
yaml = "$baseDir/typing/SARS-CoV-2.types.yaml"
37+
}
38+
39+
if ( params.illumina ) {
40+
includeConfig "$baseDir/conf/illumina.config"
41+
// Clinical genomics override
42+
params {
43+
// Allow reads that don't have primer sequence? Ligation prep = false, nextera = true
44+
allowNoprimer = true
45+
// Length of illumina reads to keep after primer trimming
46+
illuminaKeepLen = 30
47+
// Sliding window quality threshold for keeping reads after primer trimming (illumina)
48+
illuminaQualThreshold = 20
49+
// Mpileup depth for ivar (although undocumented in mpileup, setting to zero removes limit)
50+
mpileupDepth = 100000
51+
// iVar frequency threshold for consensus variant (ivar consensus: -t)
52+
ivarFreqThreshold = 0.75
53+
// Minimum coverage depth to call variant (ivar consensus: -m; ivar variants -m)
54+
ivarMinDepth = 10
55+
// iVar frequency threshold to call variant (ivar variants: -t )
56+
ivarMinFreqThreshold = 0.25
57+
// iVar minimum mapQ to call variant (ivar variants: -q)
58+
ivarMinVariantQuality = 20
59+
// Typing frequency threshold to call aa consequences of variant. Set to ivarFreqThreshold for consistency with consensus
60+
csqAfThreshold = 0.75
61+
// Minimum coverage depth to call aa consequences of variant. Set to ivarMinDepth for consistency with consensus
62+
csqDpThreshold = 10
63+
// Java settings for picard tools. The "-Xmx" setting is useful if running into java memory issues
64+
picardJavaSettings = "-Xmx10g"
65+
// Options for picard CollectWgsMetrics
66+
wgsMetricsOptions = "--COVERAGE_CAP 1000000 --LOCUS_ACCUMULATION_CAP 1000000"
67+
// Customization of multiQC report
68+
multiqcOptions = '--cl_config "picard_config: { general_stats_target_coverage: [10,30,50,100] }" --module cutadapt --module fastqc --module ivar --module picard'
69+
// Repo to download your primer scheme from
70+
schemeRepoURL = 'https://github.com/artic-network/primer-schemes.git'
71+
// Directory within schemeRepoURL that contains primer schemes
72+
schemeDir = 'primer-schemes'
73+
// Scheme name
74+
scheme = 'nCoV-2019'
75+
// Scheme version
76+
schemeVersion = 'V3'
77+
}
78+
}
79+
80+
// LESS RELEVANT PARAMETERS TO ALTER FROM THIS POINT ONWARD.
81+
82+
profiles {
83+
conda {
84+
if ( params.medaka || params.nanopolish ) {
85+
process.conda = "$baseDir/environments/nanopore/environment.yml"
86+
}
87+
else if (params.illumina) {
88+
process.conda = "$baseDir/environments/illumina/environment.yml"
89+
}
90+
if (params.cache){
91+
conda.cacheDir = params.cache
92+
}
93+
includeConfig "$baseDir/conf/conda.config"
94+
}
95+
docker {
96+
docker.enabled = true
97+
fixOwnership = true
98+
runOptions = "-u \$(id -u):\$(id -g)"
99+
}
100+
singularity {
101+
singularity.enabled = true
102+
singularity.autoMounts = true
103+
// Container
104+
if ( params.medaka || params.nanopolish ) {
105+
process {
106+
withName:articDownloadScheme {
107+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
108+
}
109+
withName:articGuppyPlex {
110+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
111+
}
112+
withName:articMinIONMedaka {
113+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
114+
}
115+
withName:articRemoveUnmappedReads {
116+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
117+
}
118+
withName:makeQCCSV {
119+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
120+
}
121+
withName:writeQCSummaryCSV {
122+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
123+
}
124+
withName:collateSamples {
125+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
126+
}
127+
withName:pangolinTyping {
128+
container = "file:///${baseDir}/artic-ncov2019-pangolin.sif"
129+
}
130+
withName:typeVariants {
131+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
132+
}
133+
withName:mergeTypingCSVs {
134+
container = "file:///${baseDir}/artic-ncov2019-nanopore.sif"
135+
}
136+
}
137+
}
138+
else if (params.illumina) {
139+
process.container = "file:///${baseDir}/artic-ncov2019-illumina.sif"
140+
}
141+
// Temporary directories
142+
if (params.cache) {
143+
singularity.cacheDir = params.cache
144+
env.NXF_TEMP="${params.cache}"
145+
env.NXF_SINGULARITY_LOCALCACHEDIR="${params.cache}"
146+
env.NXF_SINGULARITY_CACHEDIR="${params.cache}"
147+
env.NXF_SINGULARITY_TMPDIR="${params.cache}"
148+
env.SINGULARITY_LOCALCACHEDIR="${params.cache}"
149+
env.SINGULARITY_CACHEDIR="${params.cache}"
150+
env.SINGULARITY_TMPDIR="${params.cache}"
151+
env.SINGULARITY_ROOTFS="${params.cache}"
152+
env.TMPDIR="${params.cache}"
153+
env.TEMPDIR="${params.cache}"
154+
}
155+
}
156+
}
157+
// Capture exit codes from upstream processes when piping
158+
process.shell = ['/bin/bash', '-euo', 'pipefail']
159+
timeline {
160+
enabled = true
161+
file = "${params.tracedir}/execution_timeline.html"
162+
}
163+
report {
164+
enabled = true
165+
file = "${params.tracedir}/execution_report.html"
166+
}
167+
trace {
168+
enabled = true
169+
file = "${params.tracedir}/execution_trace.txt"
170+
}
171+
dag {
172+
enabled = true
173+
file = "${params.tracedir}/pipeline_dag.svg"
174+
}
175+
manifest {
176+
author = 'Mikrobgruppen'
177+
description = 'Nextflow for running the Artic ncov2019 pipeline on hasta'
178+
mainScript = 'main.nf'
179+
nextflowVersion = '>=20.01.0'
180+
version = '1.0.0'
181+
}

0 commit comments

Comments
 (0)