-
Notifications
You must be signed in to change notification settings - Fork 741
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
base: master
Are you sure you want to change the base?
Add sylph/profile module #7118
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested to be a bit more specific about the created csv :)
"versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" | ||
], | ||
[ | ||
false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it expected that the contains check always leads to the string not being contained?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The string should be contained. Looking into it.
{ assert process.success }, | ||
{ assert snapshot( | ||
process.out.versions, | ||
process.out.profile_out.collect { file(it[1]).readLines().contains("complete genome") }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MAybe you can assert the file a bit better using: https://github.com/lukfor/nft-csv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean to count the columns of the output file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anything that makes sense - counting columns or asserting column header both seems fine to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated this now.
@sofstam , do you need a hand to get this finished off? |
@SPPearce Was on holidays, looking at the comments now :) |
Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com>
Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com>
Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com>
Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com>
{ 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 |
There was a problem hiding this comment.
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.
{ 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:
{ 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() } |
One of my comments may have been related to some previous code, can't see the comment on my phone |
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out.versions).match("versions_single") }, | ||
{ assert output_content.size() > 1 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there not a specific file or contents to test for here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update this test so there's a specific file to test please?
Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>
Co-authored-by: Mahesh Binzer-Panchal <mahesh.binzer-panchal@nbis.se>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some questions about the assertions. Looks good to me otherwise :)
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match("stub_output") } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ assert snapshot(process.out).match("stub_output") } | |
{ assert snapshot(process.out).match() } |
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out.versions).match("versions_single") }, | ||
{ assert process.out.profile_out.get(0).size() > 1 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to bring this assertion into the snapshot? Can we maybe assert the headers of the tsv or something similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe like @SPPearce suggested:
{ assert snapshot(
process.out.versions,
file(output_content).readLines()[0..4]
).match() }
@@ -35,7 +35,6 @@ output: | |||
description: | | |||
Groovy Map containing sample information | |||
e.g. [ id:'test', single_end:false ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g. [ id:'test', single_end:false ] | |
e.g. [ id:'test'] |
PR checklist
Moves the local module
sylph/profile
to nf-core modules. Closes nf-core/seqinspector#65Removes unnecessary pattern from
sylph/sketch
meta file.versions.yml
file.label
nf-core modules test <MODULE> --profile docker
nf-core modules test <MODULE> --profile singularity
nf-core modules test <MODULE> --profile conda
nf-core subworkflows test <SUBWORKFLOW> --profile docker
nf-core subworkflows test <SUBWORKFLOW> --profile singularity
nf-core subworkflows test <SUBWORKFLOW> --profile conda