Skip to content

Commit

Permalink
fasta_binning_concoct subworkflow: do not fail on join (#5824)
Browse files Browse the repository at this point in the history
* fix: do not fail on mismatch for samples not binned with concoct

* Migrate to pytest

* Improved Harshil alignment

---------

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
  • Loading branch information
maxibor and jfy133 authored Jun 25, 2024
1 parent baa30ac commit 373d3e2
Show file tree
Hide file tree
Showing 7 changed files with 270 additions and 84 deletions.
2 changes: 1 addition & 1 deletion subworkflows/nf-core/fasta_binning_concoct/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ workflow FASTA_BINNING_CONCOCT {
ch_versions = ch_versions.mix( CONCOCT_MERGECUTUPCLUSTERING.out.versions.first())

ch_mergecutupclustering_for_extractfastabins = ch_fasta
.join(CONCOCT_MERGECUTUPCLUSTERING.out.csv, failOnMismatch: true)
.join(CONCOCT_MERGECUTUPCLUSTERING.out.csv, failOnMismatch: false)

CONCOCT_EXTRACTFASTABINS ( ch_mergecutupclustering_for_extractfastabins )
ch_versions = ch_versions.mix(CONCOCT_EXTRACTFASTABINS.out.versions.first())
Expand Down
46 changes: 46 additions & 0 deletions subworkflows/nf-core/fasta_binning_concoct/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
nextflow_workflow {

name "Test Subworkflow FASTA_BINNING_CONCOCT"
script "../main.nf"
workflow "FASTA_BINNING_CONCOCT"

tag "subworkflows"
tag "subworkflows_nfcore"
tag "subworkflows/fasta_binning_concoct"

tag "concoct"
tag "concoct/cutupfasta"
tag "concoct/concoctcoveragetable"
tag "concoct/concoct"
tag "concoct/mergecutupclustering"
tag "concoct/extractfastabins"


test("sarscov2 - genome - fasta") {

when {
workflow {
"""
input[0] = Channel.of(
[[ id: 'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)],
[[ id: 'test2'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]
)
input[1] = Channel.of(
[[ id: 'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam.bai', checkIfExists: true)],
[[ id: 'test2'], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true)]
)
"""
}
}

then {
assertAll(
{ assert workflow.success},
{ assert snapshot(workflow.out).match()}
)
}
}
}
223 changes: 223 additions & 0 deletions subworkflows/nf-core/fasta_binning_concoct/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
{
"sarscov2 - genome - fasta": {
"content": [
{
"0": [
[
{
"id": "test2"
},
"test2.tsv:md5,3e0e31b009b3f4b4345df615a70a2835"
],
[
{
"id": "test"
},
"test.tsv:md5,12b125c66c7e353fe206203d203f90be"
]
],
"1": [
[
{
"id": "test2"
},
"test2_original_data_gt1000.csv:md5,afe4845db494e8c3d74c11950056c6b9"
],
[
{
"id": "test"
},
"test_original_data_gt1000.csv:md5,5800a76203ca027b87ab14d323958ce2"
]
],
"2": [
[
{
"id": "test2"
},
"test2_clustering_gt1000.csv:md5,8cb3e6901075bf07966d08e1816762ce"
],
[
{
"id": "test"
},
"test_clustering_gt1000.csv:md5,8cb3e6901075bf07966d08e1816762ce"
]
],
"3": [
[
{
"id": "test2"
},
"test2_PCA_components_data_gt1000.csv:md5,e935179f138edd7f4db6c8cd1fd90d48"
],
[
{
"id": "test"
},
"test_PCA_components_data_gt1000.csv:md5,b4cae93ee69a00b366ab8d7c4e0d6191"
]
],
"4": [
[
{
"id": "test2"
},
"test2_PCA_transformed_data_gt1000.csv:md5,7e39ef9d66adb948e75faa1c9a4d1542"
],
[
{
"id": "test"
},
"test_PCA_transformed_data_gt1000.csv:md5,107ff5473b8b0479ede9043fc425e5ea"
]
],
"5": [
[
{
"id": "test2"
},
"test2.csv:md5,ac57fce859cd28f5d18e1f4bbe056a35"
],
[
{
"id": "test"
},
"test.csv:md5,ac57fce859cd28f5d18e1f4bbe056a35"
]
],
"6": [
[
{
"id": "test2"
},
"test2_3.fa.gz:md5,483f4a5dfe60171c86ee9b7e6dff908b"
],
[
{
"id": "test"
},
"test_3.fa.gz:md5,483f4a5dfe60171c86ee9b7e6dff908b"
]
],
"7": [
"versions.yml:md5,02b573fc121beb734320d0e115ae4457",
"versions.yml:md5,4bc65b076c9549a3e935fbc16d7d33fe",
"versions.yml:md5,add0cb757a41623b081a19fad811b97e",
"versions.yml:md5,c8571a624e787edcad507c36c9dab06f",
"versions.yml:md5,f45abcb3924ba6847dea4997c62a7916"
],
"bins": [
[
{
"id": "test2"
},
"test2_3.fa.gz:md5,483f4a5dfe60171c86ee9b7e6dff908b"
],
[
{
"id": "test"
},
"test_3.fa.gz:md5,483f4a5dfe60171c86ee9b7e6dff908b"
]
],
"cluster_table": [
[
{
"id": "test2"
},
"test2.csv:md5,ac57fce859cd28f5d18e1f4bbe056a35"
],
[
{
"id": "test"
},
"test.csv:md5,ac57fce859cd28f5d18e1f4bbe056a35"
]
],
"coverage_table": [
[
{
"id": "test2"
},
"test2.tsv:md5,3e0e31b009b3f4b4345df615a70a2835"
],
[
{
"id": "test"
},
"test.tsv:md5,12b125c66c7e353fe206203d203f90be"
]
],
"original_csv": [
[
{
"id": "test2"
},
"test2_original_data_gt1000.csv:md5,afe4845db494e8c3d74c11950056c6b9"
],
[
{
"id": "test"
},
"test_original_data_gt1000.csv:md5,5800a76203ca027b87ab14d323958ce2"
]
],
"pca_original": [
[
{
"id": "test2"
},
"test2_PCA_components_data_gt1000.csv:md5,e935179f138edd7f4db6c8cd1fd90d48"
],
[
{
"id": "test"
},
"test_PCA_components_data_gt1000.csv:md5,b4cae93ee69a00b366ab8d7c4e0d6191"
]
],
"pca_transformed": [
[
{
"id": "test2"
},
"test2_PCA_transformed_data_gt1000.csv:md5,7e39ef9d66adb948e75faa1c9a4d1542"
],
[
{
"id": "test"
},
"test_PCA_transformed_data_gt1000.csv:md5,107ff5473b8b0479ede9043fc425e5ea"
]
],
"raw_clustering_csv": [
[
{
"id": "test2"
},
"test2_clustering_gt1000.csv:md5,8cb3e6901075bf07966d08e1816762ce"
],
[
{
"id": "test"
},
"test_clustering_gt1000.csv:md5,8cb3e6901075bf07966d08e1816762ce"
]
],
"versions": [
"versions.yml:md5,02b573fc121beb734320d0e115ae4457",
"versions.yml:md5,4bc65b076c9549a3e935fbc16d7d33fe",
"versions.yml:md5,add0cb757a41623b081a19fad811b97e",
"versions.yml:md5,c8571a624e787edcad507c36c9dab06f",
"versions.yml:md5,f45abcb3924ba6847dea4997c62a7916"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-25T18:40:35.774932002"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1663,9 +1663,6 @@ subworkflows/bam_variant_calling_sort_freebayes_bcftools:
subworkflows/bed_scatter_bedtools:
- subworkflows/nf-core/bed_scatter_bedtools/**
- tests/subworkflows/nf-core/bed_scatter_bedtools/**
subworkflows/fasta_binning_concoct:
- subworkflows/nf-core/fasta_binning_concoct/**
- tests/subworkflows/nf-core/fasta_binning_concoct/**
subworkflows/fasta_clean_fcs:
- subworkflows/nf-core/fasta_clean_fcs/**
- tests/subworkflows/nf-core/fasta_clean_fcs/**
Expand Down
19 changes: 0 additions & 19 deletions tests/subworkflows/nf-core/fasta_binning_concoct/main.nf

This file was deleted.

This file was deleted.

56 changes: 0 additions & 56 deletions tests/subworkflows/nf-core/fasta_binning_concoct/test.yml

This file was deleted.

0 comments on commit 373d3e2

Please sign in to comment.