Skip to content
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

Merged
merged 64 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
daf9e8d
Add sylph/profile module and remove unnecessary pattern from sylph/sk…
sofstam Nov 28, 2024
dfdd3fc
Remove description
sofstam Nov 28, 2024
a2f1344
Update snap
sofstam Nov 28, 2024
8544ee9
Try again with linting
sofstam Nov 28, 2024
1e576e0
Merge branch 'master' into sylph_profile
sofstam Nov 28, 2024
fa0e2c1
Update snap
sofstam Nov 28, 2024
e45886d
Fix linting for meta.yaml
sofstam Nov 28, 2024
2451fcd
Update tests
sofstam Nov 28, 2024
c06f4fb
Add contains in nf-test
sofstam Dec 5, 2024
c95a100
Add contains
sofstam Dec 5, 2024
9cda43a
Merge branch 'master' into sylph_profile
mashehu Dec 5, 2024
85188bb
Merge branch 'master' into sylph_profile
sofstam Jan 8, 2025
6509880
Update modules/nf-core/sylph/profile/tests/main.nf.test
sofstam Jan 8, 2025
ecc9e18
Update modules/nf-core/sylph/profile/main.nf
sofstam Jan 8, 2025
0d5cd9b
Update modules/nf-core/sylph/profile/main.nf
sofstam Jan 8, 2025
2e1e013
Update modules/nf-core/sylph/profile/main.nf
sofstam Jan 8, 2025
114c010
Update description
sofstam Jan 8, 2025
b752de4
Remove single_end from the output
sofstam Jan 8, 2025
9a86542
Merge branch 'master' into sylph_profile
sofstam Jan 8, 2025
174b6d5
Update meta.yml file to include info if fastq/fasta files are provided
sofstam Jan 8, 2025
e5da167
Add tests
sofstam Jan 16, 2025
1cbbc12
Merge branch 'master' into sylph_profile
sofstam Jan 16, 2025
f7bc9cd
Fix test
sofstam Jan 16, 2025
bb4bb66
Fix tests
sofstam Jan 16, 2025
041ef71
Merge branch 'master' into sylph_profile
sofstam Jan 16, 2025
4d96cf3
Update modules/nf-core/sylph/profile/tests/main.nf.test
sofstam Jan 17, 2025
8139064
Update modules/nf-core/sylph/profile/main.nf
sofstam Jan 17, 2025
e924d82
Merge branch 'master' into sylph_profile
sofstam Jan 17, 2025
7cc2a9b
Merge branch 'master' into sylph_profile
sofstam Jan 21, 2025
22ae16b
Update to latest paths
sofstam Jan 21, 2025
8dcc98f
Merge branch 'master' into sylph_profile
sofstam Jan 21, 2025
70aa351
Rename variable to database
sofstam Jan 21, 2025
7fbceea
Update modules/nf-core/sylph/profile/tests/main.nf.test
sofstam Jan 23, 2025
efc1300
Update modules/nf-core/sylph/sketch/meta.yml
sofstam Jan 23, 2025
50d6a4c
Merge branch 'master' into sylph_profile
sofstam Jan 23, 2025
daec43b
Apply review suggestions
sofstam Jan 23, 2025
4a63e29
Merge branch 'sylph_profile' of https://github.com/sofstam/modules in…
sofstam Jan 23, 2025
d4203f2
Merge branch 'master' into sylph_profile
sofstam Jan 23, 2025
d951f22
Update snap
sofstam Jan 23, 2025
4d3151d
Snapshot
sofstam Jan 23, 2025
39d9e97
Test snap
sofstam Jan 23, 2025
705a3b6
Update snapshot to pass the tests
sofstam Jan 23, 2025
ba1dcb4
Remove test_2.fastq.gz from single_end test
sofstam Jan 23, 2025
5321586
Merge branch 'master' into sylph_profile
sofstam Jan 23, 2025
1ae0bbc
Merge branch 'master' into sylph_profile
sofstam Jan 24, 2025
caf6742
Update modules/nf-core/sylph/profile/tests/main.nf.test
sofstam Jan 24, 2025
b9ac2c6
Update modules/nf-core/sylph/profile/tests/main.nf.test
sofstam Jan 24, 2025
ad3cdec
Update snapshot
sofstam Jan 24, 2025
fa33541
Merge branch 'master' into sylph_profile
sofstam Jan 24, 2025
7d92086
Merge branch 'master' into sylph_profile
sofstam Jan 24, 2025
ebaa721
Add threads
sofstam Jan 24, 2025
5bc3be3
Merge branch 'sylph_profile' of https://github.com/sofstam/modules in…
sofstam Jan 24, 2025
f3a56e5
Update modules/nf-core/sylph/profile/main.nf
sofstam Jan 24, 2025
6f19bd7
Update modules/nf-core/sylph/profile/meta.yml
sofstam Jan 24, 2025
9242a4e
Update modules/nf-core/sylph/profile/tests/main.nf.test
sofstam Jan 24, 2025
f8d82e3
Update modules/nf-core/sylph/profile/main.nf
sofstam Jan 24, 2025
82801ea
Update modules/nf-core/sylph/profile/tests/main.nf.test
sofstam Jan 24, 2025
4c14732
Update modules/nf-core/sylph/profile/main.nf
sofstam Jan 24, 2025
8b07088
Merge branch 'master' into sylph_profile
sofstam Jan 27, 2025
2f9db79
add better debugging
mashehu Jan 27, 2025
e9ab510
Update tests
sofstam Jan 27, 2025
7776ef6
Update snapshot
sofstam Jan 27, 2025
bef433f
Merge branch 'master' into sylph_profile
sofstam Jan 28, 2025
5c97ce1
Merge branch 'master' into sylph_profile
sofstam Jan 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/actions/get-shards/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ outputs:
total_shards:
description: "Total number of shards"
value: ${{ steps.shards.outputs.total_shards }}

runs:
using: "composite"
steps:
Expand All @@ -26,22 +25,24 @@ runs:
with:
version: ${{ env.NFT_VER }}
install-pdiff: true

- name: Get number of shards
id: shards
shell: bash
run: |

# Prepare tag parameter if tags are provided
TAGS=$([ -n "${{ inputs.tags }}" ] && echo "--tag ${{ inputs.tags }}" || echo "")
# Run nf-test with dynamic tag parameter

# Run nf-test with dynamic parameter
nftest_output=$(nf-test test \
--dry-run \
--profile docker \
${TAGS} \
--filter process,workflow \
${{ inputs.paths }})

${{ inputs.paths }}) || {
echo "nf-test command failed with exit code $?"
echo "Full output: $nftest_output"
exit 1
}
echo "nf-test dry-run output: $nftest_output"

# Default values for shard and total_shards
Expand Down
7 changes: 7 additions & 0 deletions modules/nf-core/sylph/profile/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::sylph=0.7.0"
49 changes: 49 additions & 0 deletions modules/nf-core/sylph/profile/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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 \\
famosab marked this conversation as resolved.
Show resolved Hide resolved
-t $task.cpus \\
$args \\
$reads \\
$database\\
-o ${prefix}.tsv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
sylph: \$(sylph -V | awk '{print \$2}')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
sofstam marked this conversation as resolved.
Show resolved Hide resolved
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
"""

}
51 changes: 51 additions & 0 deletions modules/nf-core/sylph/profile/meta.yml
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: file
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"
80 changes: 80 additions & 0 deletions modules/nf-core/sylph/profile/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
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)
]
]
input[1] = file(params.modules_testdata_base_path +'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
"""
}
}

then {
assert process.success
assert snapshot(
process.out.versions,
file(process.out.profile_out[0][1]).readLines()[0]
).match()
}
}

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 {
assert process.success
assert snapshot(
process.out.versions,
file(process.out.profile_out[0][1]).readLines()[0]
).match()
}
}

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 {
assert process.success
assert snapshot(process.out).match()
}
}
}
61 changes: 61 additions & 0 deletions modules/nf-core/sylph/profile/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"sarscov2 illumina paired-end [fastq_gz]": {
"content": [
[
"versions.yml:md5,7b5a545483277cc0ff9189f8891e737f"
],
"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"
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.4"
},
"timestamp": "2025-01-27T15:47:59.374481624"
},
"sarscov2 illumina single-end [fastq_gz]": {
"content": [
[
"versions.yml:md5,7b5a545483277cc0ff9189f8891e737f"
],
"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"
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.4"
},
"timestamp": "2025-01-27T15:47:53.556942841"
},
"sarscov2 illumina paired-end [fastq_gz]-stub": {
"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.4"
},
"timestamp": "2025-01-27T15:48:04.991824868"
}
}
3 changes: 1 addition & 2 deletions modules/nf-core/sylph/sketch/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ output:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
pattern: "my_sketches/*.sylsp"
e.g. [ id:'test']
- my_sketches/*.sylsp:
type: map
description: |
Expand Down
Loading