From d21bfb034467d134095b83545453c2ca016de67d Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Tue, 28 Nov 2023 16:26:39 -0800 Subject: [PATCH] Add support for flye `--meta` flag (#11) * bump version * Add support for --meta flag --- README.md | 12 ++++++++++++ modules/dragonflye.nf | 11 +++++++++++ nextflow.config | 3 ++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a794ed2..45364f5 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,18 @@ nextflow run BCCDC-PHL/dragonflye-nf \ --outdir ``` +The `--meta` flag can be passed through to flye by adding the `--flye_meta` flag. The `--meta` flag is intended for use with metagenome assemblies, +but may be helpful in other scenarios such as plasmid assembly: + +``` +nextflow run BCCDC-PHL/dragonflye-nf \ + --hybrid \ + --flye_meta \ + --fastq_input \ + --fastq_input_long \ + --outdir +``` + ## Output An output directory will be created for each sample under the directory provided with the `--outdir` flag. The directory will be named by sample ID, inferred from the fastq files (all characters before the first underscore in the fastq filenames), or the `ID` field of the samplesheet, if one is used. diff --git a/modules/dragonflye.nf b/modules/dragonflye.nf index fc32351..e4eda1c 100644 --- a/modules/dragonflye.nf +++ b/modules/dragonflye.nf @@ -18,14 +18,25 @@ process dragonflye { hybrid_long_reads = assembly_mode == "hybrid" ? "--reads ${reads[2]}" : "" long_reads = assembly_mode == "long" ? "--reads ${reads[0]}" : "" polypolish = assembly_mode == "hybrid" ? "--polypolish" : "" + meta = params.flye_meta ? "--opts '--meta'" : "" """ printf -- "- process_name: dragonflye\\n" >> ${sample_id}_dragonflye_${assembly_mode}_provenance.yml printf -- " tools:\\n" >> ${sample_id}_dragonflye_${assembly_mode}_provenance.yml printf -- " - tool_name: dragonflye\\n" >> ${sample_id}_dragonflye_${assembly_mode}_provenance.yml printf -- " tool_version: \$(dragonflye --version | cut -d ' ' -f 2 | tr -d 'v')\\n" >> ${sample_id}_dragonflye_${assembly_mode}_provenance.yml + printf -- " parameters:\\n" >> ${sample_id}_dragonflye_${assembly_mode}_provenance.yml + printf -- " - parameter: --tmpdir\\n" >> ${sample_id}_dragonflye_${assembly_mode}_provenance.yml + printf -- " value: ./tmp\\n" >> ${sample_id}_dragonflye_${assembly_mode}_provenance.yml + + if [ "${params.flye_meta}" == "true" ]; then + printf -- " - parameter: --opts\\n" >> ${sample_id}_dragonflye_${assembly_mode}_provenance.yml + printf -- " value: '--meta'\\n" >> ${sample_id}_dragonflye_${assembly_mode}_provenance.yml + fi + dragonflye --cpus ${task.cpus} \ --tmpdir './tmp' \ + ${meta} \ ${short_reads} \ ${hybrid_long_reads} \ ${long_reads} \ diff --git a/nextflow.config b/nextflow.config index 8d07c7c..5493d93 100644 --- a/nextflow.config +++ b/nextflow.config @@ -1,7 +1,7 @@ manifest { author = 'Dan Fornika' name = 'BCCDC-PHL/dragonflye-nf' - version = '0.1.2' + version = '0.1.3' description = 'Nextflow wrapper for Dragonflye Assembler' mainScript = 'main.nf' nextflowVersion = '>=20.01.0' @@ -25,6 +25,7 @@ params { fastq_input_long = 'NO_FILE' filtlong_min_length = 1000 filtlong_keep_percent = 90 + flye_meta = false samplesheet_input = 'NO_FILE' versioned_outdir = false collect_outputs = false