Skip to content

Commit

Permalink
Merge pull request #46 from GallVp/mdust
Browse files Browse the repository at this point in the history
Added mdust
  • Loading branch information
GallVp authored Nov 26, 2024
2 parents c30c832 + b75874e commit 8d8f3bf
Show file tree
Hide file tree
Showing 7 changed files with 233 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/AVAILABLE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/repeatmasker/repeatmasker">modules/gallvp/repeatmasker/repeatmasker</a></li>
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/plotsr">modules/gallvp/plotsr</a></li>
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/minimap2/align">modules/gallvp/minimap2/align</a></li>
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/mdust">modules/gallvp/mdust</a></li>
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/ltrretriever/ltrretriever">modules/gallvp/ltrretriever/ltrretriever</a></li>
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/ltrretriever/lai">modules/gallvp/ltrretriever/lai</a></li>
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/ltrharvest">modules/gallvp/ltrharvest</a></li>
Expand Down
5 changes: 5 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ <h1>gallvp/nxf-components</h1>
>modules/gallvp/minimap2/align</a
>
</li>
<li>
<a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/mdust"
>modules/gallvp/mdust</a
>
</li>
<li>
<a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/ltrretriever/ltrretriever"
>modules/gallvp/ltrretriever/ltrretriever</a
Expand Down
7 changes: 7 additions & 0 deletions modules/gallvp/mdust/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::mdust=2006.10.17"
50 changes: 50 additions & 0 deletions modules/gallvp/mdust/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
process MDUST {
tag "$meta.id"
label 'process_single'

// WARN: Manually update when changing Bioconda assets
conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mdust:2006.10.17--h470a237_1':
'biocontainers/mdust:2006.10.17--h470a237_1' }"

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

output:
tuple val(meta), path("*.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}"
def VERSION = '2006.10.17' // WARN: Manually update when changing Bioconda assets
if( "$fasta" == "${prefix}.fasta" ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!"
"""
mdust \\
$fasta \\
$args \\
> "${prefix}.fasta"
cat <<-END_VERSIONS > versions.yml
"${task.process}":
mdust: $VERSION
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '2006.10.17' // WARN: Manually update when changing Bioconda assets
if( "$fasta" == "${prefix}.fasta" ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!"
"""
touch ${prefix}.fasta
cat <<-END_VERSIONS > versions.yml
"${task.process}":
mdust: $VERSION
END_VERSIONS
"""
}
46 changes: 46 additions & 0 deletions modules/gallvp/mdust/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "mdust"
description: mdust from DFCI Gene Indices Software Tools
keywords:
- genomics
- gene
- filter
tools:
- "mdust":
description: ""
homepage: "https://github.com/lh3/mdust"
documentation: "https://github.com/lh3/mdust"
tool_dev_url: "https://github.com/lh3/mdust"
licence: ["The Artistic License"]
identifier: ""

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- fasta:
type: file
description: Input fasta file
pattern: "*.{fa,fsa,faa,fas,fasta}"
output:
- fasta:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*.fasta":
type: file
description: Output fasta file
pattern: "*.fasta"
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@GallVp"
maintainers:
- "@GallVp"
56 changes: 56 additions & 0 deletions modules/gallvp/mdust/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
nextflow_process {

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

tag "modules"
tag "modules_gallvp"
tag "mdust"

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

}

}
68 changes: 68 additions & 0 deletions modules/gallvp/mdust/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"sarscov2 - fasta - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.fasta:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,049b6354208f3470a1713aa90aed5e6e"
],
"fasta": [
[
{
"id": "test"
},
"test.fasta:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,049b6354208f3470a1713aa90aed5e6e"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.1"
},
"timestamp": "2024-11-25T17:04:59.601616"
},
"sarscov2 - fasta": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.fasta:md5,483f4a5dfe60171c86ee9b7e6dff908b"
]
],
"1": [
"versions.yml:md5,049b6354208f3470a1713aa90aed5e6e"
],
"fasta": [
[
{
"id": "test"
},
"test.fasta:md5,483f4a5dfe60171c86ee9b7e6dff908b"
]
],
"versions": [
"versions.yml:md5,049b6354208f3470a1713aa90aed5e6e"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.1"
},
"timestamp": "2024-11-25T17:04:16.863703"
}
}

0 comments on commit 8d8f3bf

Please sign in to comment.