Skip to content

Commit

Permalink
Merge pull request #12 from GallVp/gxf_fasta_agat_spaddintrons_spextr…
Browse files Browse the repository at this point in the history
…actsequences

Added gxf_fasta_agat_spaddintrons_spextractsequences
  • Loading branch information
GallVp committed Jul 25, 2024
2 parents 7c3185d + 80dea06 commit edeb006
Show file tree
Hide file tree
Showing 20 changed files with 891 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/AVAILABLE.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<li><a href="https://github.com/gallvp/nxf-components/tree/main/subworkflows/gallvp/gxf_fasta_agat_spaddintrons_spextractsequences">subworkflows/gallvp/gxf_fasta_agat_spaddintrons_spextractsequences</a></li>
<li><a href="https://github.com/gallvp/nxf-components/tree/main/subworkflows/gallvp/fasta_ltrretriever_lai">subworkflows/gallvp/fasta_ltrretriever_lai</a></li>
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/tesorter">modules/gallvp/tesorter</a></li>
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/syri">modules/gallvp/syri</a></li>
Expand All @@ -14,3 +15,5 @@
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/cat/cat">modules/gallvp/cat/cat</a></li>
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/braker3">modules/gallvp/braker3</a></li>
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/annosine">modules/gallvp/annosine</a></li>
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/agat/spextractsequences">modules/gallvp/agat/spextractsequences</a></li>
<li><a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/agat/spaddintrons">modules/gallvp/agat/spaddintrons</a></li>
16 changes: 16 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ <h1>gallvp/nxf-components</h1>
<input type="text" id="searchInput" onkeyup="myFunction()" placeholder="Search.." />

<ul id="modulesList">
<li>
<a
href="https://github.com/gallvp/nxf-components/tree/main/subworkflows/gallvp/gxf_fasta_agat_spaddintrons_spextractsequences"
>subworkflows/gallvp/gxf_fasta_agat_spaddintrons_spextractsequences</a
>
</li>
<li>
<a href="https://github.com/gallvp/nxf-components/tree/main/subworkflows/gallvp/fasta_ltrretriever_lai"
>subworkflows/gallvp/fasta_ltrretriever_lai</a
Expand Down Expand Up @@ -167,6 +173,16 @@ <h1>gallvp/nxf-components</h1>
>modules/gallvp/annosine</a
>
</li>
<li>
<a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/agat/spextractsequences"
>modules/gallvp/agat/spextractsequences</a
>
</li>
<li>
<a href="https://github.com/gallvp/nxf-components/tree/main/modules/gallvp/agat/spaddintrons"
>modules/gallvp/agat/spaddintrons</a
>
</li>
</ul>
</body>
</html>
9 changes: 9 additions & 0 deletions modules/gallvp/agat/spaddintrons/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: "agat_spaddintrons"
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- "bioconda::agat=1.4.0"
50 changes: 50 additions & 0 deletions modules/gallvp/agat/spaddintrons/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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.4.0--pl5321hdfd78af_0' :
'biocontainers/agat:1.4.0--pl5321hdfd78af_0' }"

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

output:
tuple val(meta), path("*.gff") , emit: gff
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 config_arg = config ? "-c $config" : ''
if( "$gxf" == "${prefix}.gff" ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!"
"""
agat_sp_add_introns.pl \\
$args \\
-g $gxf \\
$config_arg \\
-o ${prefix}.gff
cat <<-END_VERSIONS > versions.yml
"${task.process}":
agat: \$(agat_sp_add_introns.pl -h | sed -n 's/.*(AGAT) - Version: \\(.*\\) .*/\\1/p')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
if( "$gxf" == "${prefix}.gff" ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!"
"""
touch ${prefix}.gff
cat <<-END_VERSIONS > versions.yml
"${task.process}":
agat: \$(agat_sp_add_introns.pl -h | sed -n 's/.*(AGAT) - Version: \\(.*\\) .*/\\1/p')
END_VERSIONS
"""
}
55 changes: 55 additions & 0 deletions modules/gallvp/agat/spaddintrons/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "agat_spaddintrons"
description: |
The script aims to add intron features to gtf/gff file without intron features.
keywords:
- genomics
- gff
- gtf
- add
- intron
- feature
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/tools/agat_sp_add_introns.html"
tool_dev_url: "https://github.com/NBISweden/AGAT"
doi: "10.5281/zenodo.3552717"
licence: ["GPL v3"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- gxf:
type: file
description: Input GFF3/GTF file
pattern: "*.{gff,gff3,gtf}"
- config:
type: file
description: |
Input agat config file. By default AGAT takes as input agat_config.yaml file from the working directory if any, otherwise it takes the orignal agat_config.yaml shipped with AGAT. To get the agat_config.yaml locally type: "agat config --expose". The --config option gives you the possibility to use your own AGAT config file (located elsewhere or named differently).
pattern: "*.yaml"

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

authors:
- "@GallVp"
maintainers:
- "@GallVp"
61 changes: 61 additions & 0 deletions modules/gallvp/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_gallvp"
tag "agat"
tag "agat/spaddintrons"

test("homo_sapiens - genome - gtf") {


when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr1/genome.gtf', checkIfExists: true)
]
input[1] = []
"""
}
}

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

}

test("homo_sapiens - genome - gtf - stub") {

options '-stub'

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr1/genome.gtf', checkIfExists: true)
]
input[1] = []
"""
}
}

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

}

}
72 changes: 72 additions & 0 deletions modules/gallvp/agat/spaddintrons/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"homo_sapiens - genome - gtf - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.gff:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,480dfe983a8b4469c1dff8b7a08d855d"
],
"gff": [
[
{
"id": "test",
"single_end": false
},
"test.gff:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,480dfe983a8b4469c1dff8b7a08d855d"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-24T16:22:13.888389"
},
"homo_sapiens - genome - gtf": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.gff:md5,a798830c6ad0a27b1564b98e1a1fc3aa"
]
],
"1": [
"versions.yml:md5,480dfe983a8b4469c1dff8b7a08d855d"
],
"gff": [
[
{
"id": "test",
"single_end": false
},
"test.gff:md5,a798830c6ad0a27b1564b98e1a1fc3aa"
]
],
"versions": [
"versions.yml:md5,480dfe983a8b4469c1dff8b7a08d855d"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-24T15:21:51.693488"
}
}
2 changes: 2 additions & 0 deletions modules/gallvp/agat/spaddintrons/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
agat/spaddintrons:
- "modules/pfr/agat/spaddintrons/**"
9 changes: 9 additions & 0 deletions modules/gallvp/agat/spextractsequences/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: "agat_spextractsequences"
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::agat=1.4.0
52 changes: 52 additions & 0 deletions modules/gallvp/agat/spextractsequences/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
process AGAT_SPEXTRACTSEQUENCES {
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.4.0--pl5321hdfd78af_0' :
'biocontainers/agat:1.4.0--pl5321hdfd78af_0' }"

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

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 config_arg = config ? "-c $config" : ''
if( "$fasta" == "${prefix}.fasta" ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!"
"""
agat_sp_extract_sequences.pl \\
$args \\
-g $gxf \\
-f $fasta \\
$config_arg \\
-o ${prefix}.fasta
cat <<-END_VERSIONS > versions.yml
"${task.process}":
agat: \$(agat_sp_extract_sequences.pl -h | sed -n 's/.*(AGAT) - Version: \\(.*\\) .*/\\1/p')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
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}":
agat: \$(agat_sp_extract_sequences.pl -h | sed -n 's/.*(AGAT) - Version: \\(.*\\) .*/\\1/p')
END_VERSIONS
"""
}
Loading

0 comments on commit edeb006

Please sign in to comment.