Skip to content

Commit

Permalink
Merge branch 'master' into regressive
Browse files Browse the repository at this point in the history
  • Loading branch information
luisas authored Oct 18, 2024
2 parents 3978c8d + 74ac535 commit 04e1060
Show file tree
Hide file tree
Showing 21 changed files with 645 additions and 38 deletions.
7 changes: 7 additions & 0 deletions modules/nf-core/elprep/fastatoelfasta/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::elprep=5.1.3"
50 changes: 50 additions & 0 deletions modules/nf-core/elprep/fastatoelfasta/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
process ELPREP_FASTATOELFASTA {
tag "$meta.id"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/elprep:5.1.3--he881be0_1':
'biocontainers/elprep:5.1.3--he881be0_1' }"

input:
tuple val(meta), path(fasta)

output:
tuple val(meta), path("*.elfasta") , emit: elfasta
tuple val(meta), path("logs/elprep/elprep*"), emit: log
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
elprep fasta-to-elfasta \\
$fasta \\
${prefix}.elfasta \\
--log-path ./
cat <<-END_VERSIONS > versions.yml
"${task.process}":
elprep: \$(elprep 2>&1 | head -n2 | tail -n1 |sed 's/^.*version //;s/ compiled.*\$//')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
def timestamp = "${java.time.OffsetDateTime.now().format(java.time.format.DateTimeFormatter.ISO_DATE_TIME)}"

"""
mkdir -p logs/elprep
touch ${prefix}.elfasta
touch logs/elprep/elprep-${timestamp}.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
elprep: \$(elprep 2>&1 | head -n2 | tail -n1 |sed 's/^.*version //;s/ compiled.*\$//')
END_VERSIONS
"""
}
55 changes: 55 additions & 0 deletions modules/nf-core/elprep/fastatoelfasta/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "elprep_fastatoelfasta"
description: Convert a file in FASTA format to the ELFASTA format
keywords:
- fasta
- elfasta
- elprep
tools:
- "elprep":
description: "elPrep is a high-performance tool for preparing .sam/.bam files
for variant calling in sequencing pipelines. It can be used as a drop-in replacement
for SAMtools/Picard/GATK4."
homepage: "https://github.com/ExaScience/elprep"
documentation: "https://github.com/ExaScience/elprep"
tool_dev_url: "https://github.com/ExaScience/elprep"
doi: "10.1371/journal.pone.0244471"
licence: ["AGPL v3"]
identifier: biotools:elprep

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- fasta:
type: file
description: FASTA file
pattern: "*.{fasta,fa,fna}"
output:
- elfasta:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
pattern: "*.elfasta"
- "*.elfasta":
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
pattern: "*.elfasta"
- log:
- meta: {}
- logs/elprep/elprep*: {}
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@nvnieuwk"
maintainers:
- "@nvnieuwk"
66 changes: 66 additions & 0 deletions modules/nf-core/elprep/fastatoelfasta/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
nextflow_process {

name "Test Process ELPREP_FASTATOELFASTA"
script "../main.nf"
process "ELPREP_FASTATOELFASTA"

tag "modules"
tag "modules_nfcore"
tag "elprep"
tag "elprep/fastatoelfasta"

test("sarscov2 - fasta") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true),
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.elfasta,
process.out.log.collect { [it[0], file(it[1]).exists()] },
process.out.versions
).match() }
)
}

}

test("sarscov2 - fasta - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true),
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.elfasta,
process.out.log.collect { [it[0], file(it[1]).exists()] },
process.out.versions
).match() }
)
}

}

}
62 changes: 62 additions & 0 deletions modules/nf-core/elprep/fastatoelfasta/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"sarscov2 - fasta - stub": {
"content": [
[
[
{
"id": "test",
"single_end": false
},
"test.elfasta:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
[
[
{
"id": "test",
"single_end": false
},
true
]
],
[
"versions.yml:md5,bf313ed1289a8969464c5593b0ff67be"
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-18T14:29:50.861439255"
},
"sarscov2 - fasta": {
"content": [
[
[
{
"id": "test",
"single_end": false
},
"test.elfasta:md5,09a6f76bed84ee211ef0d962e26c77f1"
]
],
[
[
{
"id": "test",
"single_end": false
},
true
]
],
[
"versions.yml:md5,bf313ed1289a8969464c5593b0ff67be"
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-18T14:25:24.238816922"
}
}
4 changes: 3 additions & 1 deletion modules/nf-core/pangolin/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::pangolin=4.2
- bioconda::pangolin-data=1.30
- bioconda::pangolin=4.3
- bioconda::snakemake=7.30.1
6 changes: 4 additions & 2 deletions modules/nf-core/pangolin/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process PANGOLIN {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/pangolin:4.2--pyhdfd78af_1' :
'biocontainers/pangolin:4.2--pyhdfd78af_1' }"
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/bb/bb7bac48e43a9cd6274e1f99c761a5785b74f6d8a55313ee634aaffbe87c1869/data' :
'community.wave.seqera.io/library/pangolin-data_pangolin_snakemake:5bbc297f7502ff33' }"

input:
tuple val(meta), path(fasta)
Expand All @@ -21,6 +21,8 @@ process PANGOLIN {
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
export XDG_CACHE_HOME=/tmp/.cache
pangolin \\
$fasta\\
--outfile ${prefix}.pangolin.csv \\
Expand Down
8 changes: 4 additions & 4 deletions modules/nf-core/pangolin/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keywords:
- pangolin
- lineage
tools:
- star:
- pangolin:
description: |
Phylogenetic Assignment of Named Global Outbreak LINeages
homepage: https://github.com/cov-lineages/pangolin#pangolearn-description
Expand All @@ -24,9 +24,9 @@ input:
output:
- report:
- meta:
type: file
description: Pangolin lineage report
pattern: "*.{csv}"
type: map
description: |
Groovy Map containing sample information
- "*.csv":
type: file
description: Pangolin lineage report
Expand Down
57 changes: 57 additions & 0 deletions modules/nf-core/pangolin/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
nextflow_process {

name "Test Process PANGOLIN"
script "../main.nf"
process "PANGOLIN"

tag "modules"
tag "modules_nfcore"
tag "pangolin"

test("sarscov2 genome [fasta]") {

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
[ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

test("sarscov2 genome [fasta] - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
[ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

}
Loading

0 comments on commit 04e1060

Please sign in to comment.