-
Notifications
You must be signed in to change notification settings - Fork 956
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
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 |
|---|---|---|
|
|
@@ -4,47 +4,43 @@ process FASTANI { | |
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
| 'https://depot.galaxyproject.org/singularity/fastani:1.32--he1c1bb9_0' : | ||
| 'biocontainers/fastani:1.32--he1c1bb9_0' }" | ||
| 'https://depot.galaxyproject.org/singularity/fastani:1.34--hb66fcc3_7' : | ||
| 'biocontainers/fastani:1.34--hb66fcc3_7' }" | ||
|
|
||
| input: | ||
| tuple val(meta), path(query) | ||
| path reference | ||
| tuple val(meta), path(query) | ||
| tuple val(meta2), path(reference) | ||
| path(ql) | ||
| path(rl) | ||
|
|
||
| output: | ||
| tuple val(meta), path("*.ani.txt"), emit: ani | ||
| path "versions.yml" , emit: versions | ||
| tuple val(meta), path("*.txt") , emit: ani | ||
| tuple val(meta), path("*.visual"), optional:true, emit: visual | ||
| tuple val(meta), path("*.matrix"), optional:true, emit: matrix | ||
| tuple val("${task.process}"), val("fastani"), eval('fastANI --version'), topic: versions, emit: versions_fastani | ||
|
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. you'll need to add the old |
||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
|
|
||
| if (meta.batch_input) { | ||
| """ | ||
| fastANI \\ | ||
| -ql $query \\ | ||
| -rl $reference \\ | ||
| -o ${prefix}.ani.txt | ||
|
|
||
| cat <<-END_VERSIONS > versions.yml | ||
| "${task.process}": | ||
| fastani: \$(fastANI --version 2>&1 | sed 's/version//;') | ||
| END_VERSIONS | ||
| """ | ||
| } else { | ||
| """ | ||
| fastANI \\ | ||
| -q $query \\ | ||
| -r $reference \\ | ||
| -o ${prefix}.ani.txt | ||
|
|
||
| cat <<-END_VERSIONS > versions.yml | ||
| "${task.process}": | ||
| fastani: \$(fastANI --version 2>&1 | sed 's/version//;') | ||
| END_VERSIONS | ||
| """ | ||
| } | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: ( meta.id ?: 'all' ) | ||
| def prefix2 = task.ext.prefix2 ?: ( meta2.id ?: 'all' ) | ||
| def input_query = query ? "-q ${query}": "--ql ${ql}" | ||
Ethan-Hetrick marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| def input_reference = reference ? "-r ${reference}": "--rl ${rl}" | ||
Ethan-Hetrick marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| """ | ||
| fastANI \\ | ||
| $input_query \\ | ||
| $input_reference \\ | ||
| --threads $task.cpus \\ | ||
| -o ${prefix}.txt | ||
| """ | ||
|
|
||
| stub: | ||
| def prefix = task.ext.prefix ?: ( meta.id ?: 'all') | ||
| """ | ||
| touch ${prefix}.visual | ||
| touch ${prefix}.txt | ||
| touch ${prefix}.matrix | ||
| """ | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,8 +6,8 @@ nextflow_process { | |
| tag "fastani" | ||
Ethan-Hetrick marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| script "../main.nf" | ||
| process "FASTANI" | ||
|
|
||
| test("FastANI") { | ||
| config "./nextflow.config" | ||
| test("sarscov2 - referece vs contigs - fastANI - 1 v 1 mode") { | ||
|
|
||
| when { | ||
| process { | ||
|
|
@@ -16,14 +16,90 @@ 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 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() | ||
|
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. But isnt |
||
| rl_file.text = 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 }, | ||
| { assert snapshot( | ||
| process.out.ani, | ||
| 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 snapshot(process.out).match() } | ||
| ) | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.