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 crabs/insilicopcr module from readsimulator #6583

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions modules/nf-core/crabs/insilicopcr/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
channels:
- conda-forge
- bioconda
dependencies:
- bioconda::crabs=1.0.6
46 changes: 46 additions & 0 deletions modules/nf-core/crabs/insilicopcr/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
process CRABS_INSILICOPCR {
tag "$meta.id"
label 'process_medium'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'oras://community.wave.seqera.io/library/crabs:1.0.6--a95c7815a4a67eb2':
'community.wave.seqera.io/library/crabs:1.0.6--462aa28d85ee454e' }"

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

output:
tuple val(meta), path("*.{fa,fasta}"), emit: fasta
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}"
"""
crabs --in-silico-pcr \\
--input $fasta \\
--output ${prefix}.crabs.fa \\
--threads ${task.cpus} \\
$args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
crabs: \$(crabs --version | sed -e 's/crabs v//g')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.fa

cat <<-END_VERSIONS > versions.yml
"${task.process}":
crabs: \$(crabs --version | sed -e 's/crabs v//g')
END_VERSIONS
"""
}
53 changes: 53 additions & 0 deletions modules/nf-core/crabs/insilicopcr/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: crabs_insilicopcr
description: CRABS extracts the amplicon region of the primer set by conducting an
in silico PCR.
keywords:
- insilico
- PCR
- amplicon
- sequencing
tools:
- crabs:
description: |
Crabs (Creating Reference databases for Amplicon-Based Sequencing)
is a program to download and curate reference databases
for eDNA metabarcoding analyses
homepage: https://github.com/gjeunen/reference_database_creator
documentation: https://github.com/gjeunen/reference_database_creator?tab=readme-ov-file#running-crabs
tool_dev_url: https://github.com/gjeunen/reference_database_creator
doi: 10.1111/1755-0998.13741
licence: ["MIT License"]
identifier: ""

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- fasta:
type: file
description: Sequence to conduct in silico PCR on
pattern: "*.{fa,fasta}"
output:
- fasta:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*.{fa,fasta}":
type: file
description: Reverse complemented amplified Sequence
pattern: "*.{fa,fasta}"
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@famosab"
- "@a4000"
maintainers:
- "@famosab"
- "@a4000"
66 changes: 66 additions & 0 deletions modules/nf-core/crabs/insilicopcr/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
nextflow_process {

name "Test Process CRABS_INSILICOPCR"
script "../main.nf"
process "CRABS_INSILICOPCR"
config "./nextflow.config"

tag "modules"
tag "modules_nfcore"
tag "crabs"
tag "crabs/insilicopcr"

test("sarscov2 - fasta") {

when {
params {
module_args = '--forward "GTCGGTAAAACTCGTGCCAGC" --reverse "CATAGTGGGGTATCTAATCCCAGTTTG"'
}
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.versions,
file(process.out.fasta[0][1]).name,
).match()
}
)
}

}

test("sarscov2 - 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() }
)
}

}

}
48 changes: 48 additions & 0 deletions modules/nf-core/crabs/insilicopcr/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"sarscov2 - fasta - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.fa:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,7698551e7ac06a8f18b3ca861d0ec81d"
],
"fasta": [
[
{
"id": "test"
},
"test.fa:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,7698551e7ac06a8f18b3ca861d0ec81d"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-25T12:47:20.344112"
},
"sarscov2 - fasta": {
"content": [
[
"versions.yml:md5,688cca24ee493f8c07e5e069e20fea10"
],
"test.crabs.fa"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-05T15:22:12.207826"
}
}
7 changes: 7 additions & 0 deletions modules/nf-core/crabs/insilicopcr/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
process {

withName: CRABS_INSILICOPCR {
ext.args = params.module_args
}

}
2 changes: 2 additions & 0 deletions modules/nf-core/crabs/insilicopcr/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
crabs/insilicopcr:
- "modules/nf-core/crabs/insilicopcr/**"
Loading