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

Add sylph/profile module #7118

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
daf9e8d
Add sylph/profile module and remove unnecessary pattern from sylph/sk…
sofstam Nov 28, 2024
dfdd3fc
Remove description
sofstam Nov 28, 2024
a2f1344
Update snap
sofstam Nov 28, 2024
8544ee9
Try again with linting
sofstam Nov 28, 2024
1e576e0
Merge branch 'master' into sylph_profile
sofstam Nov 28, 2024
fa0e2c1
Update snap
sofstam Nov 28, 2024
e45886d
Fix linting for meta.yaml
sofstam Nov 28, 2024
2451fcd
Update tests
sofstam Nov 28, 2024
c06f4fb
Add contains in nf-test
sofstam Dec 5, 2024
c95a100
Add contains
sofstam Dec 5, 2024
9cda43a
Merge branch 'master' into sylph_profile
mashehu Dec 5, 2024
85188bb
Merge branch 'master' into sylph_profile
sofstam Jan 8, 2025
6509880
Update modules/nf-core/sylph/profile/tests/main.nf.test
sofstam Jan 8, 2025
ecc9e18
Update modules/nf-core/sylph/profile/main.nf
sofstam Jan 8, 2025
0d5cd9b
Update modules/nf-core/sylph/profile/main.nf
sofstam Jan 8, 2025
2e1e013
Update modules/nf-core/sylph/profile/main.nf
sofstam Jan 8, 2025
114c010
Update description
sofstam Jan 8, 2025
b752de4
Remove single_end from the output
sofstam Jan 8, 2025
9a86542
Merge branch 'master' into sylph_profile
sofstam Jan 8, 2025
174b6d5
Update meta.yml file to include info if fastq/fasta files are provided
sofstam Jan 8, 2025
e5da167
Add tests
sofstam Jan 16, 2025
1cbbc12
Merge branch 'master' into sylph_profile
sofstam Jan 16, 2025
f7bc9cd
Fix test
sofstam Jan 16, 2025
bb4bb66
Fix tests
sofstam Jan 16, 2025
041ef71
Merge branch 'master' into sylph_profile
sofstam Jan 16, 2025
4d96cf3
Update modules/nf-core/sylph/profile/tests/main.nf.test
sofstam Jan 17, 2025
8139064
Update modules/nf-core/sylph/profile/main.nf
sofstam Jan 17, 2025
e924d82
Merge branch 'master' into sylph_profile
sofstam Jan 17, 2025
7cc2a9b
Merge branch 'master' into sylph_profile
sofstam Jan 21, 2025
22ae16b
Update to latest paths
sofstam Jan 21, 2025
8dcc98f
Merge branch 'master' into sylph_profile
sofstam Jan 21, 2025
70aa351
Rename variable to database
sofstam Jan 21, 2025
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
41 changes: 21 additions & 20 deletions modules/nf-core/sylph/profile/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,22 @@ nextflow_process {
process {
"""
input[0] = [ [ id:'test', single_end:true ], // meta map
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ]
]
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ]
sofstam marked this conversation as resolved.
Show resolved Hide resolved
]
input[1] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
"""
}
}

then {
def output_content = process.out.profile_out.get(0)

assertAll(
{ assert process.success },
{ assert snapshot(
process.out.versions,
process.out.profile_out.collect { file(it[1]).readLines().contains("complete genome") },
).match()
}
{ assert snapshot(process.out.versions).match("versions_single") },
{ assert output_content.size() > 1 }, // Ensure there's at least a header and one data line
{ assert output_content[0] == "Sample_file\tGenome_file\tTaxonomic_abundance\tSequence_abundance\tAdjusted_ANI\tEff_cov\tANI_5-95_percentile\tEff_lambda\tLambda_5-95_percentile\tMedian_cov\tMean_cov_geq1\tContainment_ind\tNaive_ANI\tkmers_reassigned\tContig_name" },
{ assert snapshot(output_content.take(5).join("\n")).match("profile_out_content_single") } // Snapshot first 5 lines
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can probably just do this. You don't need to name the snapshots if you only have one per test.

Suggested change
{ assert snapshot(process.out.versions).match("versions_single") },
{ assert output_content.size() > 1 }, // Ensure there's at least a header and one data line
{ assert output_content[0] == "Sample_file\tGenome_file\tTaxonomic_abundance\tSequence_abundance\tAdjusted_ANI\tEff_cov\tANI_5-95_percentile\tEff_lambda\tLambda_5-95_percentile\tMedian_cov\tMean_cov_geq1\tContainment_ind\tNaive_ANI\tkmers_reassigned\tContig_name" },
{ assert snapshot(output_content.take(5).join("\n")).match("profile_out_content_single") } // Snapshot first 5 lines
{ assert snapshot(
process.out.versions,
output_content.take(5).join("\n")
).match() },
{ assert output_content.size() > 1 }, // Ensure there's at least a header and one data line
{ assert output_content[0] == "Sample_file\tGenome_file\tTaxonomic_abundance\tSequence_abundance\tAdjusted_ANI\tEff_cov\tANI_5-95_percentile\tEff_lambda\tLambda_5-95_percentile\tMedian_cov\tMean_cov_geq1\tContainment_ind\tNaive_ANI\tkmers_reassigned\tContig_name" }

Or you could probably do:

Suggested change
{ assert snapshot(process.out.versions).match("versions_single") },
{ assert output_content.size() > 1 }, // Ensure there's at least a header and one data line
{ assert output_content[0] == "Sample_file\tGenome_file\tTaxonomic_abundance\tSequence_abundance\tAdjusted_ANI\tEff_cov\tANI_5-95_percentile\tEff_lambda\tLambda_5-95_percentile\tMedian_cov\tMean_cov_geq1\tContainment_ind\tNaive_ANI\tkmers_reassigned\tContig_name" },
{ assert snapshot(output_content.take(5).join("\n")).match("profile_out_content_single") } // Snapshot first 5 lines
{ assert snapshot(
process.out.versions,
file(output_content).readLines()[0..4]
).match() }

)
}
}
Expand All @@ -36,37 +37,37 @@ nextflow_process {
process {
"""
input[0] = [ [ id:'test', single_end:false ], // meta map
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ]
]
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ]
]
input[1] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
"""
}
}

then {
def output_content = process.out.profile_out.get(0)

assertAll(
{ assert process.success },
{ assert snapshot(
process.out.versions,
process.out.profile_out.collect { file(it[1]).readLines().contains("complete genome") },
).match()
}
{ assert snapshot(process.out.versions).match("versions_single") },
{ assert output_content.size() > 1 },
{ assert output_content[0] == "Sample_file\tGenome_file\tTaxonomic_abundance\tSequence_abundance\tAdjusted_ANI\tEff_cov\tANI_5-95_percentile\tEff_lambda\tLambda_5-95_percentile\tMedian_cov\tMean_cov_geq1\tContainment_ind\tNaive_ANI\tkmers_reassigned\tContig_name" },
{ assert snapshot(output_content.take(5).join("\n")).match("profile_out_content_single") }
)
}
}

test("sarscov2 illumina paired-end [fastq_gz]-stub") {

options "-stub"

when {
process {
"""
input[0] = [ [ id:'test', single_end:false ], // meta map
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ]
]
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ]
]
input[1] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
"""
}
Expand All @@ -75,7 +76,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(process.out).match("stub_output") }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ assert snapshot(process.out).match("stub_output") }
{ assert snapshot(process.out).match() }

)
}
}
Expand Down
72 changes: 36 additions & 36 deletions modules/nf-core/sylph/profile/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
{
"versions": {
"profile_out_content_single": {
"content": [
[
"versions.yml:md5,7b5a545483277cc0ff9189f8891e737f"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.1"
},
"timestamp": "2024-12-05T10:06:07.353254"
},
"sarscov2 illumina paired-end [fastq_gz]": {
"content": [
[
"versions.yml:md5,7b5a545483277cc0ff9189f8891e737f"
],
[
false
]
"[id:test, single_end:true]\n/home/proj/development/microbial/metagenomics/sofia_workspace/modules/.nf-test/tests/5f8cb80030335bc960ea6404fcc62669/work/82/d6e72642a5909bdb55cf209aa17d3b/test.tsv"
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.1"
"nextflow": "24.10.3"
},
"timestamp": "2024-12-05T10:31:09.774052"
"timestamp": "2025-01-16T11:39:43.181166"
},
"sarscov2 illumina single-end [fastq_gz]": {
"versions_single": {
"content": [
[
"versions.yml:md5,7b5a545483277cc0ff9189f8891e737f"
],
[
false
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.1"
"nextflow": "24.10.3"
},
"timestamp": "2024-12-05T10:29:46.733197"
"timestamp": "2025-01-16T11:39:43.160031"
},
"sarscov2 illumina paired-end [fastq_gz]-stub": {
"stub_output": {
"content": [
[
"versions.yml:md5,7b5a545483277cc0ff9189f8891e737f"
],
[
false
]
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,7b5a545483277cc0ff9189f8891e737f"
],
"profile_out": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,7b5a545483277cc0ff9189f8891e737f"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.1"
"nextflow": "24.10.3"
},
"timestamp": "2024-12-05T10:31:16.953204"
"timestamp": "2025-01-16T11:40:02.918227"
}
}
Loading