-
Notifications
You must be signed in to change notification settings - Fork 964
Fix fastANI module #9583
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
base: master
Are you sure you want to change the base?
Fix fastANI module #9583
Changes from all commits
cc1141a
8d54dba
fd58eb3
7269f2e
ae6a3c1
07024b8
b454c82
c0979e1
49bbc99
4162446
03ceb91
1b184c3
b2f8b66
cd935a6
e3fab37
bd45cca
b60c343
fe47276
b064fed
979d31f
86afed3
2c8c451
d9f4922
c1fb69a
7df07cd
75801b9
8c8f5fa
523e1dd
9d1c320
1c042d6
e28e09a
154f08b
349844e
d9023c5
43d6ed3
fe9795c
2b4f0d0
8d4e36f
f37e8bb
08c9c26
3945985
c762a36
09bf7ad
00098ca
3f5a987
28a3b06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,4 +4,4 @@ channels: | |
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| - bioconda::fastani=1.32 | ||
| - bioconda::fastani=1.34 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,55 +1,119 @@ | ||
| name: fastani | ||
| description: Alignment-free computation of average nucleotide Identity (ANI) | ||
| description: Alignment-free computation of Average Nucleotide Identity (ANI) | ||
| keywords: | ||
| - genome | ||
| - fasta | ||
| - ANI | ||
| tools: | ||
| - fastani: | ||
| description: FastANI is developed for fast alignment-free computation of whole-genome | ||
| Average Nucleotide Identity (ANI). | ||
| description: FastANI is developed for fast alignment-free computation of | ||
| whole-genome Average Nucleotide Identity (ANI). | ||
| homepage: https://github.com/ParBLiSS/FastANI | ||
| documentation: https://github.com/ParBLiSS/FastANI | ||
| tool_dev_url: https://github.com/ParBLiSS/FastANI | ||
| doi: 10.1038/s41467-018-07641-9 | ||
| licence: ["Apache-2.0"] | ||
| licence: | ||
| - "Apache-2.0" | ||
| identifier: biotools:fastani | ||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test', single_end:false ] | ||
| e.g. [ id:'test' ] | ||
| - query: | ||
| type: file | ||
| description: Fasta file(s) to be queried | ||
| pattern: "*.fasta" | ||
| ontologies: [] | ||
Ethan-Hetrick marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - reference: | ||
| description: Fasta file to be used as the query. If provided, ql will be | ||
| ignored. | ||
| pattern: "*.{fasta,fna,fa}" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_1929 # FASTA | ||
| - - meta2: | ||
| type: map | ||
| description: Groovy Map containing sample information for the reference | ||
| - reference: | ||
| type: file | ||
| description: Fasta file to be used as the reference. If provided, rl will | ||
| be ignored. | ||
| pattern: "*.{fasta,fna,fa}" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_1929 # FASTA | ||
| - ql: | ||
| type: file | ||
| description: File containing a list of query fasta paths. query input takes | ||
| precedence over this list if both are provided. | ||
| pattern: "*.txt" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_2330" | ||
| - rl: | ||
| type: file | ||
| description: Fasta file(s) to be used as reference for the query | ||
| pattern: "*.fasta" | ||
| ontologies: [] | ||
| description: File containing a list of reference fasta paths. reference | ||
| input takes precedence over this list if both are provided. | ||
| pattern: "*.txt" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_2330" # Textual format | ||
| output: | ||
| ani: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test', single_end:false ] | ||
| - "*.ani.txt": | ||
| e.g. [ id:'test' ] | ||
| - "*.txt": | ||
| type: file | ||
| description: Results of the query | ||
| pattern: "*.ani.txt" | ||
| ontologies: [] | ||
| description: ANI results file | ||
| pattern: "*.txt" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_2330" # Textual format | ||
| visual: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test' ] | ||
| - "*.visual": | ||
| type: file | ||
| optional: true | ||
| description: FastANI visualization output | ||
| pattern: "*.visual" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3475" # TSV | ||
| matrix: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test' ] | ||
| - "*.matrix": | ||
| type: file | ||
| optional: true | ||
| description: ANI matrix output | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3033" | ||
| versions_fastani: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - fastani: | ||
| type: string | ||
| description: The name of the tool | ||
| - fastANI --version 2>&1 | head -1 | sed "s/version\ //": | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| topics: | ||
| versions: | ||
| - versions.yml: | ||
| type: file | ||
| description: File containing software versions | ||
| pattern: "versions.yml" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3750 # YAML | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - fastani: | ||
| type: string | ||
| description: The name of the tool | ||
| - fastANI --version 2>&1 | head -1 | sed "s/version\ //": | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| authors: | ||
| - "@abhi18av" | ||
| - "@Ethan-Hetrick" | ||
| maintainers: | ||
| - "@abhi18av" | ||
| - "@Ethan-Hetrick" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,14 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process FASTANI" | ||
| script "../main.nf" | ||
| process "FASTANI" | ||
| config "./nextflow.config" | ||
| tag "modules_nfcore" | ||
| tag "modules" | ||
| tag "fastani" | ||
| script "../main.nf" | ||
| process "FASTANI" | ||
|
|
||
| test("FastANI") { | ||
| test("sarscov2 - referece vs contigs - fastANI - 1 v 1 mode") { | ||
|
|
||
| when { | ||
| process { | ||
|
|
@@ -16,13 +17,100 @@ nextflow_process { | |
| [ id:'test' ], | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) | ||
| ] | ||
| input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true) | ||
| input[1] = [ | ||
| [ id:'test2' ], | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true) | ||
| ] | ||
| input[2] = [] | ||
| input[3] = [] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll ( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| process.out.ani, | ||
| process.out.findAll { key, val -> key.startsWith("versions")} | ||
| ).match() } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| test("sarscov2 - referece vs contigs - fastANI - all vs all mode") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| def q_src = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) | ||
| def r_src = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true) | ||
|
|
||
| // stage into the nf-test execution directory | ||
| def q_stage = new File(workDir.toString(), 'query.fasta') | ||
| def r_stage = new File(workDir.toString(), 'ref.fasta') | ||
|
|
||
| // Ensures files are staged locally | ||
| q_stage.bytes = q_src.bytes | ||
| r_stage.bytes = r_src.bytes | ||
|
|
||
| // create ql/rl list files | ||
| def ql_file = new File(workDir.toString(), 'query.list') | ||
| def rl_file = new File(workDir.toString(), 'reference.list') | ||
|
|
||
| ql_file.text = | ||
| q_stage.getAbsolutePath() + System.lineSeparator() + | ||
| r_stage.getAbsolutePath() + System.lineSeparator() | ||
|
|
||
| rl_file.text = | ||
| q_stage.getAbsolutePath() + System.lineSeparator() + | ||
| r_stage.getAbsolutePath() + System.lineSeparator() | ||
|
|
||
| input[0] = [ [], [] ] | ||
| input[1] = [ [], [] ] | ||
| input[2] = file( ql_file.getAbsolutePath(), checkIfExists: true ) | ||
| input[3] = file( rl_file.getAbsolutePath(), checkIfExists: true ) | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { | ||
| def aniFile = path(process.out.ani[0][1]) | ||
| assert aniFile.exists() | ||
|
Comment on lines
+81
to
+82
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you instead of these two lines, add soemthing like this inside the |
||
| def lines = aniFile.readLines() | ||
| assert lines.size() == 4 : "Expected 4 ANI comparisons but found ${lines.size()}" | ||
|
Comment on lines
+83
to
+84
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And instead of these two, do this inside the snapshot block again: |
||
| }, | ||
| { assert snapshot(process.out.findAll { key, val -> key.startsWith("versions") }).match() } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| test("stub") { | ||
Ethan-Hetrick marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| options '-stub' | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) | ||
| ] | ||
| input[1] = [ | ||
| [ id:'test2' ], | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true) | ||
| ] | ||
| input[2] = [] | ||
| input[3] = [] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll ( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.