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

Added repeatmodeler/builddatabase #5416

Merged
merged 3 commits into from
Apr 25, 2024
Merged
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
9 changes: 9 additions & 0 deletions modules/nf-core/repeatmodeler/builddatabase/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
name: "repeatmodeler_builddatabase"
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- "bioconda::repeatmodeler=2.0.5"
50 changes: 50 additions & 0 deletions modules/nf-core/repeatmodeler/builddatabase/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
process REPEATMODELER_BUILDDATABASE {
tag "$meta.id"
label 'process_single'

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

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

output:
tuple val(meta), path("${prefix}.*") , emit: db
path "versions.yml" , emit: versions

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

script:
prefix = task.ext.prefix ?: "${meta.id}"
"""
BuildDatabase \\
-name $prefix \\
$fasta

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

stub:
prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.nhr
touch ${prefix}.nin
touch ${prefix}.njs
touch ${prefix}.nnd
touch ${prefix}.nni
touch ${prefix}.nog
touch ${prefix}.nsq
touch ${prefix}.translation

cat <<-END_VERSIONS > versions.yml
"${task.process}":
repeatmodeler: \$(RepeatModeler --version | sed 's/RepeatModeler version //')
END_VERSIONS
"""
}
44 changes: 44 additions & 0 deletions modules/nf-core/repeatmodeler/builddatabase/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "repeatmodeler_builddatabase"
description: Create a database for RepeatModeler
keywords:
- genomics
- fasta
- repeat
tools:
- "repeatmodeler":
description: "RepeatModeler is a de-novo repeat family identification and modeling package."
homepage: "https://github.com/Dfam-consortium/RepeatModeler"
documentation: "https://github.com/Dfam-consortium/RepeatModeler"
tool_dev_url: "https://github.com/Dfam-consortium/RepeatModeler"
licence: ["Open Software License v2.1"]

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- fasta:
type: file
description: Fasta file
pattern: "*.{fasta,fsa,fa}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- db:
type: file
description: Database files for repeatmodeler
pattern: "`${prefix}.*`"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@GallVp"
maintainers:
- "@GallVp"
60 changes: 60 additions & 0 deletions modules/nf-core/repeatmodeler/builddatabase/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "repeatmodeler"
tag "repeatmodeler/builddatabase"

test("sarscov2-genome_fasta") {

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

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions).match("versions") },
{ assert snapshot(process.out.db[0][1].collect { file(it).name }.sort().toString()).match("db") },
{ assert snapshot(process.out.db[0][1].findAll { ! ( "$it"[-3..-1] in [ 'nin', 'njs' ] ) } ).match("stable_md5") }
)
}

}

test("sarscov2-genome_fasta-stub") {

options "-stub"

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

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

}

}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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