Skip to content

Commit

Permalink
Merge pull request #26 from GallVp/repeatmasker/rmOutToGFF3
Browse files Browse the repository at this point in the history
Added repeatmasker/rmouttogff3
  • Loading branch information
GallVp committed Aug 7, 2024
2 parents ba7be9f + 217873d commit f313b15
Show file tree
Hide file tree
Showing 7 changed files with 254 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 @@ -9,6 +9,7 @@
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/seqkit/seq">modules/gallvp/seqkit/seq</a></li>
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/samtools/faidx">modules/gallvp/samtools/faidx</a></li>
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/samblaster">modules/gallvp/samblaster</a></li>
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/repeatmasker/rmouttogff3">modules/gallvp/repeatmasker/rmouttogff3</a></li>
<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>
Expand Down
5 changes: 5 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ <h1>gallvp/nxf-components</h1>
>modules/gallvp/samblaster</a
>
</li>
<li>
<a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/repeatmasker/rmouttogff3"
>modules/gallvp/repeatmasker/rmouttogff3</a
>
</li>
<li>
<a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/repeatmasker/repeatmasker"
>modules/gallvp/repeatmasker/repeatmasker</a
Expand Down
9 changes: 9 additions & 0 deletions modules/gallvp/repeatmasker/rmouttogff3/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: "repeatmasker_rmouttogff3"
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- "bioconda::repeatmasker=4.1.5"
48 changes: 48 additions & 0 deletions modules/gallvp/repeatmasker/rmouttogff3/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
process REPEATMASKER_RMOUTTOGFF3 {
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/repeatmasker:4.1.5--pl5321hdfd78af_0':
'biocontainers/repeatmasker:4.1.5--pl5321hdfd78af_0' }"

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

output:
tuple val(meta), path("*.gff3") , emit: gff3
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}"

"""
rm_path=\$(dirname \$(realpath \$(which RepeatMasker)))
PERL5LIB=\$rm_path rmOutToGFF3.pl \\
$out \\
> ${prefix}.gff3
cat <<-END_VERSIONS > versions.yml
"${task.process}":
repeatmasker: \$(RepeatMasker -v | sed 's/RepeatMasker version //1')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.gff3
cat <<-END_VERSIONS > versions.yml
"${task.process}":
repeatmasker: \$(RepeatMasker -v | sed 's/RepeatMasker version //1')
END_VERSIONS
"""
}
51 changes: 51 additions & 0 deletions modules/gallvp/repeatmasker/rmouttogff3/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "repeatmasker_rmouttogff3"
description: A utility script to assist to convert old RepeatMasker *.out files to version 3 gff files.
keywords:
- sort
- example
- genomics
tools:
- repeatmasker:
description: |
RepeatMasker is a program that screens DNA sequences for interspersed
repeats and low complexity DNA sequences
homepage: "https://www.repeatmasker.org/"
documentation: "https://www.repeatmasker.org/webrepeatmaskerhelp.html"
tool_dev_url: "https://github.com/rmhubley/RepeatMasker"
licence: ["Open Software License v. 2.1"]

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- out:
type: file
description: RepeatMasker out file
pattern: "*.out"

output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"

- gff3:
type: file
description: Sorted BAM/CRAM/SAM file
pattern: "*.gff3"

authors:
- "@GallVp"
maintainers:
- "@GallVp"
68 changes: 68 additions & 0 deletions modules/gallvp/repeatmasker/rmouttogff3/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
nextflow_process {

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

tag "modules"
tag "modules_gallvp"
tag "repeatmasker"
tag "repeatmasker/rmouttogff3"
tag "repeatmasker/repeatmasker"

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

test("sarscov2 - genome - fasta - repeatmasker - out") {

when {
process {
"""
input[0] = REPEATMASKER_REPEATMASKER.out.out
"""
}
}

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

}

test("sarscov2 - genome - fasta - repeatmasker - out - stub") {

options "-stub"

when {
process {
"""
input[0] = input[0] = REPEATMASKER_REPEATMASKER.out.out
"""
}
}

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

}

}
72 changes: 72 additions & 0 deletions modules/gallvp/repeatmasker/rmouttogff3/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"sarscov2 - genome - fasta - repeatmasker - out - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.gff3:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,d6620b9419b24f5807b1335468594601"
],
"gff3": [
[
{
"id": "test",
"single_end": false
},
"test.gff3:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,d6620b9419b24f5807b1335468594601"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.3"
},
"timestamp": "2024-08-07T12:41:49.415629"
},
"sarscov2 - genome - fasta - repeatmasker - out": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.gff3:md5,5c991b62d99cf84149c1d1e90efa4f99"
]
],
"1": [
"versions.yml:md5,d6620b9419b24f5807b1335468594601"
],
"gff3": [
[
{
"id": "test",
"single_end": false
},
"test.gff3:md5,5c991b62d99cf84149c1d1e90efa4f99"
]
],
"versions": [
"versions.yml:md5,d6620b9419b24f5807b1335468594601"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.3"
},
"timestamp": "2024-08-07T12:42:58.865985"
}
}

0 comments on commit f313b15

Please sign in to comment.