Skip to content

Commit 0461b3e

Browse files
abartlett004lpantanoSPPearceedmundmiller
authored
New module: regtools junction extract (#7033)
* initial commit * Update modules/nf-core/regtools/junctionsextract/main.nf Co-authored-by: Simon Pearce <[email protected]> * Update modules/nf-core/regtools/junctionsextract/main.nf Co-authored-by: Simon Pearce <[email protected]> * Update modules/nf-core/regtools/junctionsextract/tests/main.nf.test Co-authored-by: Simon Pearce <[email protected]> * more recent fill file path * Update modules/nf-core/regtools/junctionsextract/main.nf Co-authored-by: Simon Pearce <[email protected]> * Update modules/nf-core/regtools/junctionsextract/tests/main.nf.test Co-authored-by: Simon Pearce <[email protected]> * Update modules/nf-core/regtools/junctionsextract/tests/main.nf.test Co-authored-by: Simon Pearce <[email protected]> * update snapshot to include out not out.junc * Update modules/nf-core/regtools/junctionsextract/environment.yml Co-authored-by: Edmund Miller <[email protected]> * Update modules/nf-core/regtools/junctionsextract/main.nf Co-authored-by: Edmund Miller <[email protected]> * Update modules/nf-core/regtools/junctionsextract/main.nf Co-authored-by: Edmund Miller <[email protected]> * fix meta.yml * test: Add versions check * fix: Update regtools version extraction regex in junctionsextract module --------- Co-authored-by: Lorena Pantano <[email protected]> Co-authored-by: Simon Pearce <[email protected]> Co-authored-by: Edmund Miller <[email protected]> Co-authored-by: Edmund Miller <[email protected]>
1 parent 3ceae3a commit 0461b3e

File tree

6 files changed

+257
-0
lines changed

6 files changed

+257
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
2+
channels:
3+
- conda-forge
4+
- bioconda
5+
dependencies:
6+
- "bioconda::regtools=0.5.0"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
process REGTOOLS_JUNCTIONSEXTRACT {
2+
tag "$meta.id"
3+
label 'process_low'
4+
5+
conda "bioconda::regtools=0.5.0"
6+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7+
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/b6/b6c0653189b95b22e16038f61ade205a865857f54eeae9ba0184490a1834f7c9/data' :
8+
'community.wave.seqera.io/library/regtools:0.5.0--b9a260c4c898354a' }"
9+
10+
input:
11+
tuple val(meta), path(bam), path(bai)
12+
13+
output:
14+
tuple val(meta), path("*.junc"), emit: junc
15+
path "versions.yml", emit: versions
16+
17+
when:
18+
task.ext.when == null || task.ext.when
19+
20+
script:
21+
def args = task.ext.args ?: ''
22+
def prefix = task.ext.prefix ?: "${meta.id}"
23+
"""
24+
regtools junctions extract \\
25+
$args \\
26+
-o ${prefix}.junc \\
27+
$bam
28+
29+
cat <<-END_VERSIONS > versions.yml
30+
"${task.process}":
31+
regtools: \$(regtools --version 2>&1 | grep "Version:" | sed 's/Version:\t//')
32+
END_VERSIONS
33+
"""
34+
35+
stub:
36+
def prefix = task.ext.prefix ?: "${meta.id}"
37+
"""
38+
touch ${prefix}.junc
39+
40+
cat <<-END_VERSIONS > versions.yml
41+
"${task.process}":
42+
regtools: \$(regtools --version 2>&1 | grep "Version:" | sed 's/Version:\t//')
43+
END_VERSIONS
44+
"""
45+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
2+
name: "regtools_junctionsextract"
3+
description: Extract exon-exon junctions from an RNAseq BAM file. The output is a
4+
BED file in the BED12 format.
5+
keywords:
6+
- regtools
7+
- leafcutter
8+
- RNA-seq
9+
- splicing
10+
tools:
11+
- "regtools":
12+
description: "RegTools is a set of tools that integrate DNA-seq and RNA-seq data
13+
to help interpret mutations in a regulatory and splicing context."
14+
homepage: "https://regtools.readthedocs.io/en/latest/"
15+
documentation: "https://regtools.readthedocs.io/en/latest/#usage"
16+
tool_dev_url: "https://github.com/griffithlab/regtools"
17+
licence: ["MIT"]
18+
identifier: biotools:regtools
19+
20+
input:
21+
- - meta:
22+
type: map
23+
description: |
24+
Groovy Map containing sample information
25+
e.g. `[ id:'sample1', single_end:false ]`
26+
- bam:
27+
type: file
28+
description: Sorted BAM file
29+
pattern: "*.{bam}"
30+
- bai:
31+
type: file
32+
description: Index to sorted BAM file
33+
pattern: "*.{bai}"
34+
35+
output:
36+
- junc:
37+
- meta:
38+
type: map
39+
description: |
40+
Groovy Map containing sample information
41+
e.g. `[ id:'sample1', single_end:false ]`
42+
- "*.junc":
43+
type: file
44+
description: |
45+
BED12 file containing exon-exon "regtools_junctionsextract"
46+
pattern: "*.{junc}"
47+
- versions:
48+
- versions.yml:
49+
type: file
50+
description: File containing software versions
51+
pattern: "versions.yml"
52+
authors:
53+
- "@abartlett004"
54+
maintainers:
55+
- "@abartlett004"
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
nextflow_process {
2+
3+
name "Test Process REGTOOLS_JUNCTIONSEXTRACT"
4+
script "../main.nf"
5+
process "REGTOOLS_JUNCTIONSEXTRACT"
6+
7+
tag "modules"
8+
tag "modules_nfcore"
9+
tag "regtools"
10+
tag "regtools/junctionsextract"
11+
12+
test("homo_sapiens - bam-bai") {
13+
14+
when {
15+
process {
16+
"""
17+
18+
input[0] = [
19+
[ id:'test', single_end:false ], // meta map
20+
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test.rna.paired_end.sorted.chr6.bam", checkIfExists: true),
21+
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test.rna.paired_end.sorted.chr6.bam.bai", checkIfExists: true)
22+
]
23+
"""
24+
}
25+
}
26+
27+
then {
28+
assertAll(
29+
{ assert process.success },
30+
{ assert snapshot(process.out).match() }
31+
)
32+
}
33+
34+
}
35+
36+
test("homo_sapiens - bam-bai - stub") {
37+
38+
options "-stub"
39+
40+
when {
41+
process {
42+
"""
43+
44+
input[0] = [
45+
[ id:'test', single_end:false ], // meta map
46+
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test.rna.paired_end.sorted.chr6.bam", checkIfExists: true),
47+
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test.rna.paired_end.sorted.chr6.bam.bai", checkIfExists: true)
48+
]
49+
"""
50+
}
51+
}
52+
53+
then {
54+
assertAll(
55+
{ assert process.success },
56+
{ assert snapshot(process.out).match() },
57+
{ assert snapshot(path(process.out.versions.get(0)).yaml).match("versions") }
58+
)
59+
}
60+
61+
}
62+
63+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"homo_sapiens - bam-bai - stub": {
3+
"content": [
4+
{
5+
"0": [
6+
[
7+
{
8+
"id": "test",
9+
"single_end": false
10+
},
11+
"test.junc:md5,d41d8cd98f00b204e9800998ecf8427e"
12+
]
13+
],
14+
"1": [
15+
"versions.yml:md5,b8a1d662548217fc4607214fb7b4f42c"
16+
],
17+
"junc": [
18+
[
19+
{
20+
"id": "test",
21+
"single_end": false
22+
},
23+
"test.junc:md5,d41d8cd98f00b204e9800998ecf8427e"
24+
]
25+
],
26+
"versions": [
27+
"versions.yml:md5,b8a1d662548217fc4607214fb7b4f42c"
28+
]
29+
}
30+
],
31+
"meta": {
32+
"nf-test": "0.9.2",
33+
"nextflow": "24.10.1"
34+
},
35+
"timestamp": "2024-11-20T13:29:27.373772"
36+
},
37+
"versions": {
38+
"content": [
39+
{
40+
"REGTOOLS_JUNCTIONSEXTRACT": {
41+
"regtools": "0.5.0"
42+
}
43+
}
44+
],
45+
"meta": {
46+
"nf-test": "0.9.2",
47+
"nextflow": "24.10.1"
48+
},
49+
"timestamp": "2024-11-20T13:29:27.448238"
50+
},
51+
"homo_sapiens - bam-bai": {
52+
"content": [
53+
{
54+
"0": [
55+
[
56+
{
57+
"id": "test",
58+
"single_end": false
59+
},
60+
"test.junc:md5,c0ccba2d76e9cb1588ba6d2e18c0742c"
61+
]
62+
],
63+
"1": [
64+
"versions.yml:md5,b8a1d662548217fc4607214fb7b4f42c"
65+
],
66+
"junc": [
67+
[
68+
{
69+
"id": "test",
70+
"single_end": false
71+
},
72+
"test.junc:md5,c0ccba2d76e9cb1588ba6d2e18c0742c"
73+
]
74+
],
75+
"versions": [
76+
"versions.yml:md5,b8a1d662548217fc4607214fb7b4f42c"
77+
]
78+
}
79+
],
80+
"meta": {
81+
"nf-test": "0.9.2",
82+
"nextflow": "24.10.1"
83+
},
84+
"timestamp": "2024-11-20T13:29:23.165022"
85+
}
86+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
regtools/junctionsextract:
2+
- "modules/nf-core/regtools/junctionsextract/**"

0 commit comments

Comments
 (0)