Skip to content

Commit

Permalink
Update nf-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jfy133 committed Feb 8, 2024
1 parent 14a1507 commit 474feb0
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 12 deletions.
2 changes: 1 addition & 1 deletion nf-test.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ config {
testsDir "tests/"

// nf-test directory including temporary files for each test
workDir "/tmp"
workDir ".nf-test"

// location of library folder that is added automatically to the classpath
libDir "lib/"
Expand Down
19 changes: 15 additions & 4 deletions tests/test.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,22 @@ nextflow_pipeline {
assertAll(
{ assert workflow.success },
{ assert snapshot(
path("$outputDir/diamond/database.dmnd"),
path("$outputDir/kaiju/database.fmi"),
).match() },
path("$outputDir/diamond/database.dmnd"),
path("$outputDir/kaiju/database.fmi"),
path("$outputDir/malt/malt-build.log").readLines().last().contains('Peak memory'),
path("$outputDir/malt/malt_index/index0.idx"),
path("$outputDir/malt/malt_index/ref.db"),
path("$outputDir/malt/malt_index/ref.idx"),
path("$outputDir/malt/malt_index/ref.inf"),
path("$outputDir/malt/malt_index/taxonomy.idx"),
path("$outputDir/malt/malt_index/taxonomy.map"),
path("$outputDir/malt/malt_index/taxonomy.tre")
).match()
},
{ assert new File("$outputDir/pipeline_info/software_versions.yml").exists() },
{ assert new File("$outputDir/multiqc/multiqc_report.html").exists() }
{ assert new File("$outputDir/multiqc/multiqc_report.html").exists() },
{ assert path("$outputDir/malt/malt_index/table0.db").exists() },
{ assert path("$outputDir/malt/malt_index/table0.idx").exists() },
)
}
}
Expand Down
16 changes: 14 additions & 2 deletions tests/test.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,20 @@
"test_profile": {
"content": [
"database.dmnd:md5,9d57aa88cd1766adfda8360876fc0e4f",
"database.fmi:md5,54fd89f5e4eab61af30175e8aa389598"
"database.fmi:md5,54fd89f5e4eab61af30175e8aa389598",
true,
"index0.idx:md5,876139dc930e68992cd2625e08bba48a",
"ref.db:md5,335d4c8c7367999d79bef51882809f5f",
"ref.idx:md5,a07f93cdce0154d3e05e8cacc5480a3a",
"ref.inf:md5,446275f4f879e2b115e983db7c9ced18",
"taxonomy.idx:md5,309f2a558c08f551fc939e749fd42fd8",
"taxonomy.map:md5,5bb3f2192e925bca2e61e4b54f1671e0",
"taxonomy.tre:md5,f76fb2d5aa9b0d637234d48175841e0e"
],
"timestamp": "2023-12-14T12:55:54.070245428"
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-02-08T10:59:42.922218767"
}
}
14 changes: 9 additions & 5 deletions workflows/createtaxdb.nf
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ workflow CREATETAXDB {
ch_versions = ch_versions.mix(CAT_CAT_DNA.out.versions.first())
}

// TODO: COPY COMPRESSION PROCEDURE ABOVE BUT FOR AA!
// TODO: Possibly need to have a modification step to get header correct to actually run with kaiju...
// TEST first!
// docs: https://github.com/bioinformatics-centre/kaiju#custom-database
Expand Down Expand Up @@ -144,8 +143,6 @@ workflow CREATETAXDB {
// MODULE: Run DIAMOND/MAKEDB
//

// TODO
// - nf-test
if ( params.build_diamond ) {
DIAMOND_MAKEDB ( CAT_CAT_AA.out.file_out, params.prot2taxid, params.nodesdmp, params.namesdmp )
ch_versions = ch_versions.mix(DIAMOND_MAKEDB.out.versions.first())
Expand Down Expand Up @@ -173,8 +170,6 @@ workflow CREATETAXDB {
ch_malt_mapdb = file(params.malt_mapdb)
}

ch_input_for_malt

if ( params.malt_sequencetype == 'Protein') {
ch_input_for_malt = ch_prepped_aa_fastas.map{ meta, file -> file }
} else {
Expand Down Expand Up @@ -209,6 +204,15 @@ workflow CREATETAXDB {
ch_multiqc_logo.toList()
)
multiqc_report = MULTIQC.out.report.toList()

emit:
versions = CUSTOM_DUMPSOFTWAREVERSIONS.out.versions
multiqc_report_html = MULTIQC.out.report
diamond_database = DIAMOND_MAKEDB.out.db
kaiju_database = KAIJU_MKFMI.out.fmi
malt_database = MALT_BUILD.out.index


}

/*
Expand Down

0 comments on commit 474feb0

Please sign in to comment.