Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix argNorm/DeepARG overwriting output #409

Merged
merged 6 commits into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#402](https://github.com/nf-core/funcscan/pull/402) Fixed BGC length calculation for antiSMASH hits by comBGC. (by @jasmezz)
- [#406](https://github.com/nf-core/funcscan/pull/406) Fixed prediction tools not being executed if annotation workflow skipped. (by @jasmezz)
- [#407](https://github.com/nf-core/funcscan/pull/407) Fixed comBGC bug when parsing multiple antiSMASH files. (by @jasmezz)
- [#409](https://github.com/nf-core/funcscan/pull/409) Fixed argNorm overwriting its output for DeepARG. (by @jasmezz, @jfy133)

### `Dependencies`

Expand Down
2 changes: 1 addition & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ process {
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
ext.prefix = { "${meta.id}.normalized.tsv" }
ext.prefix = { input_tsv.toString().endsWith(".potential.ARG.deeparg.tsv") ? "${meta.id}.potential.ARG.normalized.tsv" : "${meta.id}.ARG.normalized.tsv" }
ext.args = "--hamronized"
}

Expand Down
2 changes: 1 addition & 1 deletion subworkflows/local/arg.nf
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ workflow ARG {
// Note: currently hardcoding versions as unreported by DeepARG
// Make sure to update on version bump.
ch_input_to_hamronization_deeparg = DEEPARG_PREDICT.out.arg.mix( DEEPARG_PREDICT.out.potential_arg )
HAMRONIZATION_DEEPARG ( ch_input_to_hamronization_deeparg, 'tsv', '1.0.2', params.arg_deeparg_db_version )
HAMRONIZATION_DEEPARG ( ch_input_to_hamronization_deeparg, 'tsv', '1.0.4', params.arg_deeparg_db_version )
ch_versions = ch_versions.mix( HAMRONIZATION_DEEPARG.out.versions )
ch_input_to_hamronization_summarize = ch_input_to_hamronization_summarize.mix( HAMRONIZATION_DEEPARG.out.tsv )

Expand Down
35 changes: 21 additions & 14 deletions tests/test_preannotated.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,29 @@ nextflow_pipeline {
{ assert path("$outputDir/arg/fargene/sample_3/fargene_analysis.log").text.contains("fARGene is done.") },

// hAMRonization
{ assert path("$outputDir/reports/hamronization_summarize/hamronization_combined_report.tsv").text.contains("NODE_5471_length_1861_cov_6.744186") },
{ assert snapshot(path("$outputDir/reports/hamronization_summarize/hamronization_combined_report.tsv")).match("hamronization") },

// argNorm
{ assert path("$outputDir/arg/argnorm/amrfinderplus/sample_1.normalized.tsv").text.contains("ARO:0000016") },
{ assert path("$outputDir/arg/argnorm/amrfinderplus/sample_2.normalized.tsv").text.contains("ARO:0000016") },
{ assert path("$outputDir/arg/argnorm/amrfinderplus/sample_3.normalized.tsv").text.contains("ARO:0000016") },

{ assert path("$outputDir/arg/argnorm/deeparg/sample_1.normalized.tsv").text.contains("ARO:3004054") },
{ assert path("$outputDir/arg/argnorm/deeparg/sample_2.normalized.tsv").text.contains("ARO") },
{ assert path("$outputDir/arg/argnorm/deeparg/sample_2.normalized.tsv").text.contains("confers_resistance_to") },
{ assert path("$outputDir/arg/argnorm/deeparg/sample_2.normalized.tsv").text.contains("resistance_to_drug_classes") },
{ assert path("$outputDir/arg/argnorm/deeparg/sample_3.normalized.tsv").text.contains("ARO:3000157") },

{ assert path("$outputDir/arg/argnorm/abricate/sample_1.normalized.tsv").text.contains("ARO:3000282") },
{ assert path("$outputDir/arg/argnorm/abricate/sample_2.normalized.tsv").text.contains("ARO:3000282") },
{ assert path("$outputDir/arg/argnorm/abricate/sample_3.normalized.tsv").text.contains("ARO:3000282") }
{ assert snapshot(
path("$outputDir/arg/argnorm/amrfinderplus/sample_1.normalized.tsv"),
path("$outputDir/arg/argnorm/amrfinderplus/sample_2.normalized.tsv"),
path("$outputDir/arg/argnorm/amrfinderplus/sample_3.normalized.tsv")
).match("argnorm_amrfinderplus") },

{ assert snapshot(
path("$outputDir/arg/argnorm/deeparg/sample_1.ARG.normalized.tsv"),
path("$outputDir/arg/argnorm/deeparg/sample_1.potential.ARG.normalized.tsv"),
path("$outputDir/arg/argnorm/deeparg/sample_2.ARG.normalized.tsv"),
path("$outputDir/arg/argnorm/deeparg/sample_2.potential.ARG.normalized.tsv"),
path("$outputDir/arg/argnorm/deeparg/sample_3.ARG.normalized.tsv"),
path("$outputDir/arg/argnorm/deeparg/sample_3.potential.ARG.normalized.tsv")
).match("argnorm_deeparg") },

{ assert snapshot(
path("$outputDir/arg/argnorm/abricate/sample_1.normalized.tsv"),
path("$outputDir/arg/argnorm/abricate/sample_2.normalized.tsv"),
path("$outputDir/arg/argnorm/abricate/sample_3.normalized.tsv")
).match("argnorm_abricate") }
)
}
}
Expand Down
151 changes: 100 additions & 51 deletions tests/test_preannotated.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,43 +1,4 @@
{
"abricate": {
"content": [
"sample_1.txt:md5,427cec26e354ac6b0ab6047ec6621202",
"sample_2.txt:md5,4c140c932a48a22bcd8ae911bda8f4c7",
"sample_3.txt:md5,d6534efe3d03173749d003bf9e624e68"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-24T12:16:20.743136"
},
"fargene": {
"content": [
"results_summary.txt:md5,2c8a073d2a7938e8aedcc097e6df2aa5",
"results_summary.txt:md5,3b86a5513e89e22a4c8b9279678ce0c0",
"results_summary.txt:md5,2c8a073d2a7938e8aedcc097e6df2aa5",
"results_summary.txt:md5,59f2e69c670d72f0c0a401e0dc90cbeb",
"results_summary.txt:md5,59f2e69c670d72f0c0a401e0dc90cbeb",
"results_summary.txt:md5,59f2e69c670d72f0c0a401e0dc90cbeb"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-24T12:16:20.849995"
},
"rgi": {
"content": [
"sample_1.txt:md5,dde77ae2dc240ee4717d8d33a92dfb66",
"sample_2.txt:md5,0e652d35ef6e9272aa194b55db609e75",
"sample_3.txt:md5,dde77ae2dc240ee4717d8d33a92dfb66"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-24T12:16:20.809033"
},
"deeparg": {
"content": [
"sample_1.align.daa.tsv:md5,0e71c37318bdc6cba792196d0455293d",
Expand All @@ -51,7 +12,7 @@
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-24T12:16:20.699516"
"timestamp": "2024-07-27T08:11:24.751995878"
},
"ampir": {
"content": [
Expand All @@ -66,20 +27,31 @@
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-24T12:16:20.560802"
"timestamp": "2024-07-27T08:11:24.436374797"
},
"ampcombi": {
"argnorm_amrfinderplus": {
"content": [
"Ampcombi_cluster.log:md5,4c78f5f134edf566f39e04e3ab7d8558",
"Ampcombi_complete.log:md5,3dabfea4303bf94bd4f5d78c5b8c83c1",
true,
true
"sample_1.normalized.tsv:md5,0a7f76ceb606ac46730a51dd57290768",
"sample_2.normalized.tsv:md5,602afce3ee0ee179855c848bd87208fe",
"sample_3.normalized.tsv:md5,d4fb8fbd890217eb4d667d7a4dd80c9b"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-27T08:11:25.55764618"
},
"argnorm_abricate": {
"content": [
"sample_1.normalized.tsv:md5,ddd8d454672c57b798f477ca32504a42",
"sample_2.normalized.tsv:md5,0323fc890a8f698ac4b0ac25f5e65964",
"sample_3.normalized.tsv:md5,f71490c27790071bd5974ecc5502cf73"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-24T12:16:20.663035"
"timestamp": "2024-07-27T08:23:32.486921338"
},
"amplify": {
"content": [
Expand All @@ -91,7 +63,22 @@
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-24T12:16:20.593242"
"timestamp": "2024-07-27T08:11:24.483855968"
},
"argnorm_deeparg": {
"content": [
"sample_1.ARG.normalized.tsv:md5,26aa409bfd0fc9096f2ac404760cc492",
"sample_1.potential.ARG.normalized.tsv:md5,d6732b4b9765bfa47e27ba673e24b6a4",
"sample_2.ARG.normalized.tsv:md5,1a19b894a7315aaae5f799e4539e6619",
"sample_2.potential.ARG.normalized.tsv:md5,b241e22f9116d8f518ba8526d52ac4dc",
"sample_3.ARG.normalized.tsv:md5,d40d387176649ce80827420fef6a0169",
"sample_3.potential.ARG.normalized.tsv:md5,f331efd21ea143c180a15ae56a5210d3"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-27T08:23:32.446555281"
},
"macrel": {
"content": [
Expand All @@ -112,10 +99,72 @@
"sample_3.macrel_log.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"meta": {
"nf-test": "0.8.4",
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-27T08:11:24.514344973"
},
"hamronization": {
"content": [
"hamronization_combined_report.tsv:md5,bded2a60a7c2cb28ec35aa5cdcb85de5"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-27T08:11:25.408635625"
},
"abricate": {
"content": [
"sample_1.txt:md5,427cec26e354ac6b0ab6047ec6621202",
"sample_2.txt:md5,4c140c932a48a22bcd8ae911bda8f4c7",
"sample_3.txt:md5,d6534efe3d03173749d003bf9e624e68"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-27T08:11:24.87794287"
},
"fargene": {
"content": [
"results_summary.txt:md5,2c8a073d2a7938e8aedcc097e6df2aa5",
"results_summary.txt:md5,3b86a5513e89e22a4c8b9279678ce0c0",
"results_summary.txt:md5,2c8a073d2a7938e8aedcc097e6df2aa5",
"results_summary.txt:md5,59f2e69c670d72f0c0a401e0dc90cbeb",
"results_summary.txt:md5,59f2e69c670d72f0c0a401e0dc90cbeb",
"results_summary.txt:md5,59f2e69c670d72f0c0a401e0dc90cbeb"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-27T08:11:25.248986515"
},
"rgi": {
"content": [
"sample_1.txt:md5,dde77ae2dc240ee4717d8d33a92dfb66",
"sample_2.txt:md5,0e652d35ef6e9272aa194b55db609e75",
"sample_3.txt:md5,dde77ae2dc240ee4717d8d33a92dfb66"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-27T08:11:25.117843821"
},
"ampcombi": {
"content": [
"Ampcombi_cluster.log:md5,4c78f5f134edf566f39e04e3ab7d8558",
"Ampcombi_complete.log:md5,3dabfea4303bf94bd4f5d78c5b8c83c1",
true,
true
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-24T20:37:52.576447033"
"timestamp": "2024-07-27T08:11:24.639509225"
},
"amrfinderplus": {
"content": [
Expand All @@ -127,6 +176,6 @@
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-24T12:16:20.777384"
"timestamp": "2024-07-27T08:11:24.994284774"
}
}
Loading