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 agat/spaddintrons #4650

Merged
merged 19 commits into from
Dec 27, 2023
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
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/**"