Skip to content

Commit

Permalink
add agat/spaddintrons (#4650)
Browse files Browse the repository at this point in the history
* add agat/spaddintrons

* fix linting error with prettier

* fix modules linting error in meta.yml

* Update modules/nf-core/agat/spaddintrons/meta.yml

Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com>

* Update modules/nf-core/agat/spaddintrons/main.nf

Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com>

* Update modules/nf-core/agat/spaddintrons/environment.yml

Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com>

* Update modules/nf-core/agat/spaddintrons/environment.yml

Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com>

* Update modules/nf-core/agat/spaddintrons/meta.yml

Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com>

* Update modules/nf-core/agat/spaddintrons/meta.yml

Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com>

* add meta map

* add meta to output and update snapshot

* add logic to use meta.id in determining output file name

* Update modules/nf-core/agat/spaddintrons/tests/main.nf.test

Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com>

* fix logic for output file name in stub

* remove trailing whitespace

* fix snapshot

---------

Co-authored-by: Anne Marie Noronha <anoronh4@users.noreply.github.com>
Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com>
Co-authored-by: Sateesh <perisateesh@gmail.com>
  • Loading branch information
4 people authored Dec 27, 2023
1 parent 7105ae1 commit 6898156
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/nf-core/agat/spaddintrons/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: agat_spaddintrons
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- "bioconda::agat=1.2.0"
51 changes: 51 additions & 0 deletions modules/nf-core/agat/spaddintrons/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
process AGAT_SPADDINTRONS {
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/agat:1.2.0--pl5321hdfd78af_0':
'biocontainers/agat:1.2.0--pl5321hdfd78af_0' }"

input:
tuple val(meta), path(gff)
path config

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

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

script:
def args = task.ext.args ?: ''
def config_param = config ? "--config $config" : ""
def prefix = meta.id ?: gff.getBaseName()
output = "${prefix}.intron.gff"
"""
agat_sp_add_introns.pl \\
--gff $gff \\
$config_param \\
--out $output \\
$args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
agat: \$(agat_sp_add_introns.pl --help | sed '3!d; s/.*v//')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = meta.id ?: gff.getBaseName()
output = "${prefix}.intron.gff"
"""
touch ${output}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
agat: \$(agat_sp_add_introns.pl --help | sed '3!d; s/.*v//')
END_VERSIONS
"""
}
43 changes: 43 additions & 0 deletions modules/nf-core/agat/spaddintrons/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: agat_spaddintrons
description: Add intron features to gtf/gff file without intron features.
keywords:
- gtf
- gff
- introns
tools:
- agat:
description: "Another Gff Analysis Toolkit (AGAT). Suite of tools to handle gene annotations in any GTF/GFF format."
homepage: "https://agat.readthedocs.io/en/latest/"
documentation: "https://agat.readthedocs.io/en/latest/"
tool_dev_url: "https://github.com/NBISweden/AGAT"
licence: ["GPL v3"]

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- gff:
type: file
description: Input gtf/gff file
pattern: "*.{gff,gff3,gtf}"
- config:
type: file
description: Optional input agat config file
pattern: "*.{yaml,yml}"

output:
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- gff:
type: file
description: Output gff3 file with introns
pattern: "*.gff"

authors:
- "@anoronh4"
maintainers:
- "@anoronh4"
61 changes: 61 additions & 0 deletions modules/nf-core/agat/spaddintrons/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "agat"
tag "agat/spaddintrons"

test("homo_sapiens - gtf") {

when {
process {
"""
input[0] = [
[ id:'test' ],
file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)
]
input[1] = []
"""
}
}

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

}

test("homo_sapiens - gtf - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test' ],
file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)
]
input[1] = []
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.gff.collect { file(it[1]).getName() } +
process.out.versions ).match() }
)
}

}

}
40 changes: 40 additions & 0 deletions modules/nf-core/agat/spaddintrons/tests/main.nf.test.snap

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/agat/spaddintrons/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
agat/spaddintrons:
- "modules/nf-core/agat/spaddintrons/**"

0 comments on commit 6898156

Please sign in to comment.