Skip to content

Commit

Permalink
Add support for flye --meta flag (#11)
Browse files Browse the repository at this point in the history
* bump version

* Add support for --meta flag
  • Loading branch information
dfornika authored Nov 29, 2023
1 parent 9606bb6 commit d21bfb0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ nextflow run BCCDC-PHL/dragonflye-nf \
--outdir <output directory>
```

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 <short-read fastq input directory> \
--fastq_input_long <long-read fastq input directory> \
--outdir <output directory>
```

## 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.
Expand Down
11 changes: 11 additions & 0 deletions modules/dragonflye.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand Down
3 changes: 2 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
Expand Down

0 comments on commit d21bfb0

Please sign in to comment.