Skip to content

Commit 9466773

Browse files
committed
Version 2.1.0 push
1 parent bd78138 commit 9466773

3 files changed

Lines changed: 49 additions & 21 deletions

File tree

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ template-workflow
55
.*.swo
66
*.pyc
77
*.pyo
8-
.DS_Store
8+
.DS_Store
9+
work/
10+
output/
11+
*.log

main.nf

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ process runArtic {
2828
maxRetries 3
2929

3030
input:
31-
tuple val(meta), path(fastq_file), path(fastq_stats)
31+
tuple val(meta), path(fastq_file), path(fastq_stats), path(scheme_dir)
3232
val models_ok
3333
output:
3434
path "${meta.alias}.consensus.fasta", emit: consensus
@@ -75,9 +75,9 @@ process runArtic {
7575
7676
artic minion --normalise ${params.normalise} --threads ${task.cpus} \
7777
--read-file ${meta.alias}_..fastq \
78-
--scheme-name ${params._scheme_name} \
79-
--scheme-length ${params._scheme_length} \
80-
--scheme-version ${params._scheme_version} \
78+
--scheme-name ${params.parsed_scheme_name} \
79+
--scheme-length ${params.parsed_scheme_length} \
80+
--scheme-version ${params.parsed_scheme_version} \
8181
--scheme-directory ${params.store_dir}/primer-schemes/ \
8282
${model_str} \
8383
${meta.alias}
@@ -93,8 +93,8 @@ process runArtic {
9393
9494
artic minion --normalise ${params.normalise} --threads ${task.cpus} \
9595
--read-file ${meta.alias}_..fastq \
96-
--bed ${params._bed} \
97-
--ref ${params._ref} \
96+
--bed ${scheme_dir}/primer.bed \
97+
--ref ${scheme_dir}/reference.fasta \
9898
${model_str} \
9999
${meta.alias}
100100
@@ -251,7 +251,7 @@ process squirrel {
251251
// See https://github.com/nextflow-io/nextflow/issues/1636
252252
// This is the only way to publish files from a workflow whilst
253253
// decoupling the publish from the process steps.
254-
process output {
254+
process output_results {
255255
// publish inputs to output directory
256256
label "artic"
257257

@@ -282,6 +282,7 @@ process get_models {
282282
workflow pipeline {
283283
take:
284284
samples
285+
scheme_dir
285286
main:
286287
software_versions = getVersions()
287288
// workflow_params = getParams()
@@ -312,7 +313,16 @@ workflow pipeline {
312313
ch_models_ok = Channel.value("models_ok")
313314
}
314315

315-
artic = runArtic(samples, ch_models_ok)
316+
ch_artic_in = samples.map { meta, reads, stats ->
317+
[
318+
meta,
319+
reads,
320+
stats,
321+
scheme_dir
322+
]
323+
}
324+
325+
artic = runArtic(ch_artic_in, ch_models_ok)
316326
// all_depth = combineDepth(artic.depth_stats.collect())
317327
// collate consensus and variants
318328
all_consensus = allConsensus(artic.consensus.collect())
@@ -370,6 +380,11 @@ workflow {
370380

371381
params._bed = false
372382
params._ref = false
383+
scheme_dir = []
384+
385+
if (!params.scheme_version) {
386+
error "${c_purple}EXITING: --scheme_version parameter must be specified.${c_reset}"
387+
}
373388

374389
if (!params.min_len) {
375390
params.remove('min_len')
@@ -395,10 +410,14 @@ workflow {
395410
}
396411

397412
scheme_splits = params.scheme_version.split("/")
413+
if (scheme_splits.size() != 3) {
414+
error "${c_purple}EXITING: --scheme_version parameter must be in the format 'scheme_name/scheme_length/scheme_version' (e.g. 'artic-inrb-mpox/2500/v1.0.0').${c_reset}"
415+
}
398416

399-
params._scheme_name = scheme_splits[0]
400-
params._scheme_length = scheme_splits[1]
401-
params._scheme_version = scheme_splits[2]
417+
params.parsed_scheme_name = scheme_splits[0]
418+
params.parsed_scheme_length = scheme_splits[1]
419+
params.parsed_scheme_version = scheme_splits[2]
420+
println """${c_purple}Using primer scheme: ${params.parsed_scheme_name} (${params.parsed_scheme_length} bp, version ${params.parsed_scheme_version})${c_reset}"""
402421

403422
} else {
404423
//custom scheme path defined
@@ -407,6 +426,8 @@ workflow {
407426
params._bed = file("""${params.custom_scheme}/primer.bed""", type:'file', checkIfExists:true)
408427
params._ref = file("""${params.custom_scheme}/reference.fasta""", type:'file', checkIfExists:true)
409428

429+
scheme_dir = file(params.custom_scheme, type: 'dir', checkIfExists: true)
430+
410431
// check to make sure min and max length have been set
411432
if (!params.max_len || !params.min_len) {
412433
log.info """${c_purple}EXITING: --min_len and --max_len parameters must be specified when using custom schemes.${c_reset}"""
@@ -453,8 +474,8 @@ workflow {
453474
"allow_multiple_basecall_models":false,
454475
])
455476

456-
pipeline(samples)
457-
output(pipeline.out.toList())
477+
pipeline(samples, scheme_dir)
478+
output_results(pipeline.out.results.toList())
458479
}
459480

460481
workflow.onComplete {

nextflow.config

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,15 @@ params {
3030
override_model = null
3131
scheme_version = "artic-inrb-mpox/2500/v1.0.0"
3232
list_schemes = false
33-
custom_scheme = null
33+
custom_scheme = false
3434
aws_image_prefix = null
3535
aws_queue = null
3636
disable_ping = false
3737
lab_id = null
3838
testkit = null
39+
store_dir = "./store_dir"
40+
_scheme_length = false
41+
_scheme_name = null
3942

4043
monochrome_logs = false
4144
validate_params = true
@@ -45,9 +48,10 @@ params {
4548
wf {
4649
example_cmd = [
4750
"--fastq 'wf-artic-demo/fastq'",
48-
"--sample_sheet 'wf-artic-demo/sample_sheet.csv'",
49-
"--scheme_name 'SARS-CoV-2'",
50-
"--scheme_version 'Midnight-ONT/V3'",
51+
"--scheme_version 'artic-inrb-mpox/2500/v1.0.0'",
52+
"--out_dir 'output'",
53+
"--store_dir 'store_dir'",
54+
"--clade 'cladei'",
5155
]
5256
common_sha = 'sha8b5843d549bb210558cbb676fe537a153ce771d6'
5357
container_sha = 'sha15e9dfa0469ddd0641dfe1a5f07bedb475a8a03d'
@@ -61,7 +65,7 @@ manifest {
6165
description = 'Run the ARTIC fieldbioinformatics workflow on multiplexed MPXV ONT data'
6266
mainScript = 'main.nf'
6367
nextflowVersion = '>=23.04.2'
64-
version = 'v2.0.0'
68+
version = 'v2.1.0'
6569
}
6670

6771
epi2melabs {
@@ -82,9 +86,9 @@ process {
8286
conda = "nanoporetech::fastcat bioconda::tabix"
8387
}
8488
withLabel: artic {
85-
container = "quay.io/artic/fieldbioinformatics:1.6.1"
89+
container = "quay.io/artic/fieldbioinformatics:1.7.3"
8690
memory = { 4.GB * task.attempt }
87-
conda = "bioconda::artic=1.6.1"
91+
conda = "bioconda::artic=1.7.3"
8892
}
8993
withLabel: squirrel {
9094
container = "articnetworkorg/squirrel@sha256:6311a61f667fa288b7ede67e88f4b7451e31f8b1da3ac61c5d1c8f303e253591"

0 commit comments

Comments
 (0)