-
Notifications
You must be signed in to change notification settings - Fork 719
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added agat/spfilterfeaturefromkilllist (#5771)
* Added agat/spfilterfeaturefromkilllist * Added AGAT config * Included test with agat config
- Loading branch information
Showing
6 changed files
with
331 additions
and
3 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
modules/nf-core/agat/spfilterfeaturefromkilllist/environment.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_spfilterfeaturefromkilllist" | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- "bioconda::agat=1.4.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
process AGAT_SPFILTERFEATUREFROMKILLLIST { | ||
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(gff) | ||
path kill_list | ||
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_param = config ? "--config $config" : '' | ||
if( "$gff" == "${prefix}.gff" ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" | ||
""" | ||
agat_sp_filter_feature_from_kill_list.pl \\ | ||
--gff $gff \\ | ||
--kill_list $kill_list \\ | ||
$config_param \\ | ||
$args \\ | ||
--output "${prefix}.gff" | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
agat: \$(agat_sp_filter_feature_from_kill_list.pl -h | sed -n 's/.*(AGAT) - Version: \\(.*\\) .*/\\1/p') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
if( "$gff" == "${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_filter_feature_from_kill_list.pl -h | sed -n 's/.*(AGAT) - Version: \\(.*\\) .*/\\1/p') | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
name: "agat_spfilterfeaturefromkilllist" | ||
description: | | ||
The script aims to remove features based on a kill list. The default behaviour is to look at the features's ID. | ||
If the feature has an ID (case insensitive) listed among the kill list it will be removed. /!\ Removing a level1 | ||
or level2 feature will automatically remove all linked subfeatures, and removing all children of a feature will | ||
automatically remove this feature too. | ||
keywords: | ||
- genomics | ||
- gff | ||
- remove | ||
- 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_filter_feature_from_kill_list.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 ]` | ||
- gff: | ||
type: file | ||
description: Input GFF3 file that will be read | ||
pattern: "*.{gff,gff3}" | ||
- kill_list: | ||
type: file | ||
description: Kill list. One value per line. | ||
pattern: "*.txt" | ||
- 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" |
104 changes: 104 additions & 0 deletions
104
modules/nf-core/agat/spfilterfeaturefromkilllist/tests/main.nf.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
nextflow_process { | ||
|
||
name "Test Process AGAT_SPFILTERFEATUREFROMKILLLIST" | ||
script "../main.nf" | ||
process "AGAT_SPFILTERFEATUREFROMKILLLIST" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "agat" | ||
tag "agat/spfilterfeaturefromkilllist" | ||
|
||
test("sarscov2 - gff3") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3', checkIfExists: true) | ||
] | ||
def kill_list = "unknown_transcript_1" | ||
def kill_list_file = new File('kill.list.txt') | ||
kill_list_file.text = kill_list | ||
input[1] = kill_list_file.toPath() | ||
input[2] = [] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("sarscov2 - gff3 - config") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3', checkIfExists: true) | ||
] | ||
def kill_list = "unknown_transcript_1" | ||
def kill_list_file = new File('kill.list.txt') | ||
kill_list_file.text = kill_list | ||
input[1] = kill_list_file.toPath() | ||
input[2] = file(params.modules_testdata_base_path + 'generic/config/agat_config.yaml', checkIfExists: true) | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("sarscov2 - gff3 - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3', checkIfExists: true) | ||
] | ||
def kill_list = "unknown_transcript_1" | ||
def kill_list_file = new File('kill.list.txt') | ||
kill_list_file.text = kill_list | ||
input[1] = kill_list_file.toPath() | ||
input[2] = [] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
101 changes: 101 additions & 0 deletions
101
modules/nf-core/agat/spfilterfeaturefromkilllist/tests/main.nf.test.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
{ | ||
"sarscov2 - gff3 - config": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.gff:md5,df19e1b84ba6f691d20c72b397c88abf" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,e2962240799182aee69421c746be183a" | ||
], | ||
"gff": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.gff:md5,df19e1b84ba6f691d20c72b397c88abf" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,e2962240799182aee69421c746be183a" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "24.04.2" | ||
}, | ||
"timestamp": "2024-07-03T15:32:54.707393" | ||
}, | ||
"sarscov2 - gff3 - stub": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.gff:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,e2962240799182aee69421c746be183a" | ||
], | ||
"gff": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.gff:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,e2962240799182aee69421c746be183a" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "24.04.2" | ||
}, | ||
"timestamp": "2024-07-03T15:32:59.888053" | ||
}, | ||
"sarscov2 - gff3": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.gff:md5,df19e1b84ba6f691d20c72b397c88abf" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,e2962240799182aee69421c746be183a" | ||
], | ||
"gff": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.gff:md5,df19e1b84ba6f691d20c72b397c88abf" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,e2962240799182aee69421c746be183a" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "24.04.2" | ||
}, | ||
"timestamp": "2024-07-03T15:32:47.772624" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters