-
Notifications
You must be signed in to change notification settings - Fork 749
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add gt2bed main.nf * add meta.yml file * bug fixes and add tests * run prettier on yml files * replace meta.yml * prettier formatting * Update modules/nf-core/bedops/gtf2bed/main.nf Co-authored-by: Maxime U Garcia <[email protected]> * Swap to nftest * Update snap --------- Co-authored-by: Maxime U Garcia <[email protected]> Co-authored-by: Maxime U Garcia <[email protected]> Co-authored-by: Simon Pearce <[email protected]>
- Loading branch information
1 parent
47cf4c9
commit bdca0f1
Showing
6 changed files
with
220 additions
and
0 deletions.
There are no files selected for viewing
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,7 @@ | ||
name: "bedops_gtf2bed" | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- "bioconda::bedops=2.4.41" |
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,49 @@ | ||
process BEDOPS_GTF2BED { | ||
tag "$gtf" | ||
label 'process_low' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/bedops:2.4.41--h4ac6f70_2': | ||
'biocontainers/bedops:2.4.41--h4ac6f70_2' }" | ||
|
||
input: | ||
tuple val(meta), path(gtf) | ||
|
||
output: | ||
tuple val(meta), path('*.bed'), emit: bed | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${gtf.baseName}" | ||
|
||
""" | ||
cat \\ | ||
$gtf \\ | ||
| gtf2bed \\ | ||
$args \\ | ||
--attribute-key=exon_id \\ | ||
> ${prefix}.bed | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
gtf2bed: \$(bedops --version | grep version | awk ' { print \$2 } ') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def prefix = task.ext.prefix ?: "${gtf.baseName}" | ||
""" | ||
touch ${prefix}.bed | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
gtf2bed: \$(bedops --version | grep version | awk ' { print \$2 } ') | ||
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,38 @@ | ||
name: "bedops_gtf2bed" | ||
description: Convert gtf format to bed format | ||
keywords: | ||
- gtf | ||
- bed | ||
- conversion | ||
tools: | ||
- gtf2bed: | ||
description: The gtf2bed script converts 1-based, closed [start, end] Gene Transfer Format v2.2 (GTF2.2) to sorted, 0-based, half-open [start-1, end) extended BED-formatted data. | ||
homepage: https://bedops.readthedocs.io/en/latest/content/reference/file-management/conversion/gtf2bed.html | ||
documentation: https://bedops.readthedocs.io/en/latest/content/reference/file-management/conversion/gtf2bed.html | ||
tool_dev_url: https://github.com/bedops/bedops | ||
doi: 10.1093/bioinformatics/bts277 | ||
licence: ["GPL v2"] | ||
|
||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- gtf: | ||
type: file | ||
description: A reference file in GTF format | ||
pattern: "*.{gtf,gtf.gz}" | ||
|
||
output: | ||
- bed: | ||
type: file | ||
description: A reference file in BED format | ||
pattern: "*.{bed}" | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
authors: | ||
- "@davidecarlson" |
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,56 @@ | ||
nextflow_process { | ||
|
||
name "Test Process BEDOPS_GTF2BED" | ||
script "../main.nf" | ||
process "BEDOPS_GTF2BED" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "bedops" | ||
tag "bedops/gtf2bed" | ||
|
||
test("homo sapiens") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [[ id:'test' ], // meta map | ||
file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("homo sapiens - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [[ id:'test' ], // meta map | ||
file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
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,68 @@ | ||
{ | ||
"homo sapiens": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"genome.bed:md5,783257789b0c59a1a5391f7f2b9ac08a" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,fb301f89b7f040eedb8ea7edaaf05187" | ||
], | ||
"bed": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"genome.bed:md5,783257789b0c59a1a5391f7f2b9ac08a" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,fb301f89b7f040eedb8ea7edaaf05187" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-05-13T15:45:25.277799374" | ||
}, | ||
"homo sapiens - stub": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"genome.bed:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,fb301f89b7f040eedb8ea7edaaf05187" | ||
], | ||
"bed": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"genome.bed:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,fb301f89b7f040eedb8ea7edaaf05187" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-05-13T15:45:34.937117692" | ||
} | ||
} |
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,2 @@ | ||
bedops/gtf2bed: | ||
- "modules/nf-core/bedops/gtf2bed/**" |