-
Notifications
You must be signed in to change notification settings - Fork 688
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 skani round 2 #5539
Open
CarsonJM
wants to merge
3
commits into
nf-core:master
Choose a base branch
from
CarsonJM:add-skani
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add skani round 2 #5539
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: "skani_dist" | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- "bioconda::skani=0.2.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
process SKANI_DIST { | ||
tag "$meta.id" | ||
label 'process_high' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/skani:0.2.1--h4ac6f70_0': | ||
'biocontainers/skani:0.2.1--h4ac6f70_0' }" | ||
|
||
input: | ||
tuple val(meta) , path(query) | ||
tuple val(meta2), path(reference) | ||
|
||
output: | ||
tuple val(meta), path("${prefix}.tsv") , emit: dist | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
prefix = task.ext.prefix ?: "${meta.id}_${meta2.id}" | ||
""" | ||
skani \\ | ||
dist \\ | ||
-q ${query} \\ | ||
-r ${reference} \\ | ||
-o ${prefix}.tsv \\ | ||
-t ${task.cpus} \\ | ||
${args} | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
skani: \$(skani --version 2>&1 | sed 's/^.*skani //; s/ .*\$//') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch ${prefix}.tsv | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
skani: \$(skani --version 2>&1 | sed 's/^.*skani //; s/ .*\$//') | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: "skani_dist" | ||
description: Simple ANI calculation between reference and query genomes. | ||
keywords: | ||
- skani | ||
- metagenomics | ||
- genome | ||
- alignment | ||
- sketch | ||
- distance | ||
- dist | ||
tools: | ||
- "skani": | ||
description: "skani is a fast and robust tool for calculating ANI between metagenome assembled genomes and contigs." | ||
homepage: "https://github.com/bluenote-1577/skani" | ||
documentation: "https://github.com/bluenote-1577/skani/wiki" | ||
tool_dev_url: "https://github.com/bluenote-1577/skani" | ||
doi: "10.1038/s41592-023-02018-3" | ||
licence: ["MIT"] | ||
|
||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1' ]` | ||
- query: | ||
type: file | ||
description: | | ||
FASTA/skani sketch file to be used as query. | ||
pattern: "*.{fasta,fasta.gz,fa,fa.gz,fna,fna.gz,sketch}" | ||
- reference: | ||
type: file | ||
description: | | ||
FASTA/skani sketch file to be used as reference. | ||
pattern: "*.{fasta,fasta.gz,fa,fa.gz,fna,fna.gz,sketch}" | ||
|
||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1' ]` | ||
- dist: | ||
type: file | ||
description: | | ||
TSV file containing ANI and AF between query and reference as calculated by skani. | ||
pattern: "*.tsv" | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
|
||
authors: | ||
- "@CarsonJM" | ||
maintainers: | ||
- "@CarsonJM" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
nextflow_process { | ||
|
||
name "Test Process SKANI_DIST" | ||
script "../main.nf" | ||
process "SKANI_DIST" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "skani" | ||
tag "skani/dist" | ||
|
||
// Dependencies | ||
tag "skani/sketch" | ||
|
||
setup { | ||
run("SKANI_SKETCH", alias: "SKANI_SKETCH1") { | ||
script "../../sketch/main.nf" | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id: 'test' ], | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta.gz", checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
run("SKANI_SKETCH", alias: "SKANI_SKETCH2") { | ||
script "../../sketch/main.nf" | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id: 'test2' ], | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fasta/contigs.fasta", checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
} | ||
|
||
test("fasta.gz + fasta") { | ||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], // meta map | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta.gz", checkIfExists: true) | ||
] | ||
input[1] = [ | ||
[ id:'test2' ], // meta map | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fasta/contigs.fasta", checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
|
||
test("fasta.gz + fastq - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], // meta map | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.fasta.gz", checkIfExists: true) | ||
] | ||
input[1] = [ | ||
[ id:'test2' ], // meta map | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fasta/contigs.fasta", checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
|
||
test("sketch + sketch") { | ||
when { | ||
process { | ||
""" | ||
input[0] = SKANI_SKETCH1.out.sketch | ||
input[1] = SKANI_SKETCH2.out.sketch | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
|
||
test("sketch + sketch - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = SKANI_SKETCH1.out.sketch | ||
input[1] = SKANI_SKETCH2.out.sketch | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
{ | ||
"sketch + sketch": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test_test2.tsv:md5,1ec6d25df7952408655bcdd7ec123600" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,a8a2d2137a0a871bbd99d861ca4db12f" | ||
], | ||
"dist": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test_test2.tsv:md5,1ec6d25df7952408655bcdd7ec123600" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,a8a2d2137a0a871bbd99d861ca4db12f" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-04-18T19:13:41.612024778" | ||
}, | ||
"fasta.gz + fasta": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test_test2.tsv:md5,1ec6d25df7952408655bcdd7ec123600" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,a8a2d2137a0a871bbd99d861ca4db12f" | ||
], | ||
"dist": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test_test2.tsv:md5,1ec6d25df7952408655bcdd7ec123600" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,a8a2d2137a0a871bbd99d861ca4db12f" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-04-18T19:13:15.692205997" | ||
}, | ||
"sketch + sketch - stub": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,a8a2d2137a0a871bbd99d861ca4db12f" | ||
], | ||
"dist": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,a8a2d2137a0a871bbd99d861ca4db12f" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-04-18T19:13:53.29278095" | ||
}, | ||
"fasta.gz + fastq - stub": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,a8a2d2137a0a871bbd99d861ca4db12f" | ||
], | ||
"dist": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,a8a2d2137a0a871bbd99d861ca4db12f" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-04-18T19:13:29.440772434" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
skani/dist: | ||
- "modules/nf-core/skani/dist/**" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: "skani_search" | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- "bioconda::skani=0.2.1" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 you add
meta2
here too?