Skip to content

Commit

Permalink
Merge pull request #106 from Daniel-VM/dev
Browse files Browse the repository at this point in the history
Revamping Dragonflye: Introducing Hybrid Mode & Patch Updates
  • Loading branch information
Daniel-VM authored Nov 9, 2023
2 parents 39de87c + 544fbbb commit 126e080
Show file tree
Hide file tree
Showing 12 changed files with 130 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
strategy:
matrix:
# Run remaining test profiles with minimum nextflow version
profile: [test_long_miniasm, test_hybrid, test_long, test_dfast]
profile: [test_long_miniasm, test_hybrid, test_long, test_dfast, test_hybrid_dragonflye]
steps:
- name: Check out pipeline code
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Added`

- [#104](https://github.com/nf-core/bacass/pull/104) - Added dragonflye module for long-reads assembly
- [#104](https://github.com/nf-core/bacass/pull/104), [#106](https://github.com/nf-core/bacass/pull/106) - Added dragonflye module and enbled draft genome polishing with short-reads.

### `Fixed`

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The pipeline can then perform long read assembly utilizing [Unicycler](https://g
### Hybrid Assembly

For users specifying both short read and long read (NanoPore) data, the pipeline can perform a hybrid assembly approach utilizing [Unicycler](https://github.com/rrwick/Unicycler), taking the full set of information from short reads and long reads into account.
For users specifying both short read and long read (NanoPore) data, the pipeline can perform a hybrid assembly approach utilizing [Unicycler](https://github.com/rrwick/Unicycler) (short read assembly followed by gap closing with long reads) or [Dragonflye](https://github.com/rpetit3/dragonflye) (long read assembly followed by polishing with short reads), taking the full set of information from short reads and long reads into account.

### Assembly QC and annotation

Expand Down
8 changes: 5 additions & 3 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ process {

withName: 'PORECHOP_PORECHOP' {
ext.args = ''
ext.prefix = { "${meta.id}.porechop" }
publishDir = [
path: { "${params.outdir}/trimming/longreads" },
mode: params.publish_dir_mode,
Expand Down Expand Up @@ -96,7 +97,7 @@ process {

withName: 'DRAGONFLYE' {
ext.args = {
if ( !$meta.gsize?.equals('NA') ){
if ( meta.gsize && !meta.gsize.equals('NA') ){
if ( !params.dragonflye_args.contains("--gsize") ) {
"--gsize ${meta.gsize} ${params.dragonflye_args}"
} else {
Expand All @@ -106,16 +107,17 @@ process {
params.dragonflye_args ?: ''
}
}

publishDir = [
path: { "${params.outdir}/Dragonflye" },
mode: params.publish_dir_mode,
pattern: "*.{fa,log}",
saveAs: { filename ->
if (filename.equals('versions.yml')) {
null
} else {
} else if (filename.endsWith('.log')) {
"${meta.id}.${filename}"
} else {
filename
}
}
]
Expand Down
30 changes: 30 additions & 0 deletions conf/test_hybrid_dragonflye.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
========================================================================================
Nextflow config file for running minimal tests
========================================================================================
Defines input files and everything required to run a fast and simple pipeline test.
Use as follows:
nextflow run nf-core/bacass -profile test_hybrid_dragonflye,<docker/singularity>
----------------------------------------------------------------------------------------
*/

params {
config_profile_name = 'Test hybrid-dragonflye profile'
config_profile_description = 'Minimal test dataset to check pipeline function'

// Limit resources so that this can run on GitHub Actions
max_cpus = 2
max_memory = 6.GB
max_time = 6.h

// Input data
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/bacass/bacass_hybrid_dragonflye.tsv'

// some extra args to speed tests up
assembly_type='hybrid'
assembler='dragonflye'
prokka_args=" --fast"
skip_kraken2 = true
}
3 changes: 2 additions & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"dragonflye": {
"branch": "master",
"git_sha": "516189e968feb4ebdd9921806988b4c12b4ac2dc",
"installed_by": ["modules"]
"installed_by": ["modules"],
"patch": "modules/nf-core/dragonflye/dragonflye.diff"
},
"fastp": {
"branch": "master",
Expand Down
66 changes: 66 additions & 0 deletions modules/nf-core/dragonflye/dragonflye.diff

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modules/nf-core/dragonflye/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions modules/nf-core/dragonflye/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modules/nf-core/dragonflye/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,14 @@ profiles {
executor.cpus = 4
executor.memory = 8.GB
}
test { includeConfig 'conf/test.config' }
test_dfast { includeConfig 'conf/test_dfast.config' }
test_hybrid { includeConfig 'conf/test_hybrid.config' }
test_long { includeConfig 'conf/test_long.config' }
test_long_miniasm { includeConfig 'conf/test_long_miniasm.config' }
test_long_dragonflye{ includeConfig 'conf/test_long_dragonflye.config' }
test_full { includeConfig 'conf/test_full.config' }
test { includeConfig 'conf/test.config' }
test_dfast { includeConfig 'conf/test_dfast.config' }
test_hybrid { includeConfig 'conf/test_hybrid.config' }
test_hybrid_dragonflye { includeConfig 'conf/test_hybrid_dragonflye.config'}
test_long { includeConfig 'conf/test_long.config' }
test_long_miniasm { includeConfig 'conf/test_long_miniasm.config' }
test_long_dragonflye { includeConfig 'conf/test_long_dragonflye.config' }
test_full { includeConfig 'conf/test_full.config' }
}

// Set default registry for Apptainer, Docker, Podman and Singularity independent of -profile
Expand Down
7 changes: 4 additions & 3 deletions workflows/bacass.nf
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ workflow BACASS {
ch_assembly = Channel.empty()

//
// MODULE: Unicycler, genome assembly, nf-core module allows only short assembly
// MODULE: Unicycler, genome assembly, nf-core module allows only short, long and hybrid assembly
//
if ( params.assembler == 'unicycler' ) {
UNICYCLER (
Expand All @@ -236,6 +236,7 @@ workflow BACASS {
ch_versions = ch_versions.mix( UNICYCLER.out.versions.ifEmpty(null) )
}


//
// MODULE: Canu, genome assembly, long reads
//
Expand Down Expand Up @@ -294,11 +295,11 @@ workflow BACASS {
}

//
// MODULE: Dragonflye, genome assembly, long reads
// MODULE: Dragonflye, genome assembly of long reads. Moreover, it provides the option for polishing the draft genome using short reads when both short and long reads are available.
//
if( params.assembler == 'dragonflye' ){
DRAGONFLYE(
ch_for_assembly.map { meta, sr, lr -> tuple(meta, lr) }
ch_for_assembly
)
ch_assembly = ch_assembly.mix( DRAGONFLYE.out.contigs.dump(tag: 'dragonflye') )
ch_versions = ch_versions.mix( DRAGONFLYE.out.versions.ifEmpty(null) )
Expand Down

0 comments on commit 126e080

Please sign in to comment.