-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Make CheckM auto-detect file extensions (#76)
* test: Compress test data FASTA files * test: Change tests to use Channel.of * Revert "test: Compress test data FASTA files" This reverts commit 673fc7e. * test: Remove duplicated assignment * refactor: Move assemblyqc subwf into separate wf file * fix: Change imports * feat: Auto-detect fasta file extension * test: Add assemblyqc test * test: Change paths to file values * test: Remove vibrant from testing - Because its db fills up the runner storage * refactor: Remove meta.id from checkm outdir * Revert "refactor: Remove meta.id from checkm outdir" This reverts commit ec98f36. * test: Skip assemblyqc test on the CI * tests: Fix trace size * chore: Bump version and changelog
- Loading branch information
Showing
7 changed files
with
123 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
include { GET_DB_CACHE } from '../../modules/local/get_db_cache' | ||
include { QUAST } from '../../modules/nf-core/quast/main' | ||
include { KRAKEN2_KRAKEN2 as KRAKEN2_RUN } from '../../modules/nf-core/kraken2/kraken2/main' | ||
include { CHECKM_LINEAGEWF } from '../../modules/nf-core/checkm/lineagewf/main' | ||
|
||
workflow CHECK_ASSEMBLIES { | ||
take: | ||
assemblies | ||
krakendb_cache | ||
reference_genome | ||
use_reference_genome | ||
|
||
main: | ||
|
||
ch_multiqc_files = Channel.empty() | ||
ch_software_versions = Channel.empty() | ||
|
||
///* | ||
// * MODULE: Run Kraken2 | ||
// */ | ||
if (!params.skip_kraken) { | ||
if(krakendb_cache) { | ||
GET_DB_CACHE(krakendb_cache) | ||
KRAKEN2_RUN(assemblies, GET_DB_CACHE.out.minikraken, false, true) | ||
} else { | ||
KRAKEN2_DB() | ||
KRAKEN2_RUN(assemblies, KRAKEN2_DB.out.minikraken, false, true) | ||
} | ||
|
||
ch_software_versions = ch_software_versions.mix(KRAKEN2_RUN.out.versions.first().ifEmpty(null)) | ||
ch_multiqc_files = ch_multiqc_files.mix(KRAKEN2_RUN.out.report.collect{it[1]}.ifEmpty([])) | ||
} | ||
|
||
fasta_extension = assemblies.map{ id, path -> path.getExtension() }.first() | ||
|
||
/* | ||
* Module: CheckM Quality Check | ||
*/ | ||
CHECKM_LINEAGEWF(assemblies, fasta_extension, []) | ||
ch_software_versions = ch_software_versions.mix(CHECKM_LINEAGEWF.out.versions.first().ifEmpty(null)) | ||
/* | ||
* Module: QUAST quality check | ||
*/ | ||
// Need to reformat assembly channel for QUAST | ||
// pattern adapted from nf-core/bacass | ||
ch_assembly = Channel.empty() | ||
ch_assembly = ch_assembly.mix(assemblies.dump(tag: 'assembly')) | ||
ch_assembly | ||
.map { meta, fasta -> fasta } //QUAST doesn't take the meta tag | ||
.collect() | ||
.set { ch_to_quast } | ||
QUAST(ch_to_quast, reference_genome, [], use_reference_genome, false) | ||
ch_software_versions = ch_software_versions.mix(QUAST.out.versions.ifEmpty(null)) | ||
|
||
ch_multiqc_files = ch_multiqc_files.mix(QUAST.out.tsv.collect()) | ||
|
||
emit: | ||
assemblyqc_software = ch_software_versions | ||
multiqc = ch_multiqc_files | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
nextflow_workflow { | ||
|
||
name "Test Workflow CHECK_ASSEMBLIES" | ||
script "subworkflows/local/assemblyqc.nf" | ||
workflow "CHECK_ASSEMBLIES" | ||
|
||
test("Assembly QC runs without failures") { | ||
|
||
when { | ||
params { | ||
skip_kraken = true | ||
outdir = "$outputDir" | ||
} | ||
workflow { | ||
""" | ||
// define inputs of the workflow here. Example: | ||
input[0] = Channel.of( | ||
[[id:'SRR14022735'], file("$baseDir/test/SRR14022735_T1.scaffolds.fa")], | ||
[[id:'SRR14022737'], file("$baseDir/test/SRR14022737_T1.scaffolds.fa")], | ||
[[id:'SRR14022754'], file("$baseDir/test/SRR14022754_T1.scaffolds.fa")], | ||
[[id:'SRR14022764'], file("$baseDir/test/SRR14022764_T1.scaffolds.fa")], | ||
) | ||
input[1] = [] | ||
// No ref genome | ||
input[2] = [] | ||
input[3] = false | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.success | ||
assert workflow.trace.tasks().size() >= 2 | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters