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

New module: regtools junction extract #7033

Merged
merged 21 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fee031a
initial commit
abartlett004 Nov 19, 2024
41fee1b
Merge branch 'master' into regtools
lpantano Nov 20, 2024
127a0ee
Merge branch 'master' into regtools
lpantano Nov 20, 2024
a0ca177
Update modules/nf-core/regtools/junctionsextract/main.nf
abartlett004 Nov 20, 2024
f2828aa
Update modules/nf-core/regtools/junctionsextract/main.nf
abartlett004 Nov 20, 2024
b69d334
Update modules/nf-core/regtools/junctionsextract/tests/main.nf.test
abartlett004 Nov 20, 2024
a6d4cc5
more recent fill file path
abartlett004 Nov 20, 2024
bc556c7
merge with remote master
abartlett004 Nov 20, 2024
8960d90
Update modules/nf-core/regtools/junctionsextract/main.nf
abartlett004 Nov 20, 2024
25a1f86
Update modules/nf-core/regtools/junctionsextract/tests/main.nf.test
abartlett004 Nov 20, 2024
7e30e85
Update modules/nf-core/regtools/junctionsextract/tests/main.nf.test
abartlett004 Nov 20, 2024
874f79c
update snapshot to include out not out.junc
abartlett004 Nov 20, 2024
94c38c3
Merge branch 'master' into regtools
abartlett004 Nov 20, 2024
213e52b
Update modules/nf-core/regtools/junctionsextract/environment.yml
abartlett004 Nov 20, 2024
cb8a955
Update modules/nf-core/regtools/junctionsextract/main.nf
abartlett004 Nov 20, 2024
bbe3ebe
Update modules/nf-core/regtools/junctionsextract/main.nf
abartlett004 Nov 20, 2024
7f83705
fix meta.yml
abartlett004 Nov 20, 2024
f970dad
Merge branch 'master' into regtools
lpantano Nov 20, 2024
a7559cb
Merge branch 'master' into regtools
lpantano Nov 20, 2024
f75790e
test: Add versions check
edmundmiller Nov 20, 2024
3a185f6
fix: Update regtools version extraction regex in junctionsextract module
edmundmiller Nov 20, 2024
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
6 changes: 6 additions & 0 deletions modules/nf-core/regtools/junctionsextract/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::regtools=0.5.0"
lpantano marked this conversation as resolved.
Show resolved Hide resolved
45 changes: 45 additions & 0 deletions modules/nf-core/regtools/junctionsextract/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
process REGTOOLS_JUNCTIONSEXTRACT {
tag "$meta.id"
label 'process_low'

conda "bioconda::regtools=0.5.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/b6/b6c0653189b95b22e16038f61ade205a865857f54eeae9ba0184490a1834f7c9/data' :
'community.wave.seqera.io/library/regtools:0.5.0--b9a260c4c898354a' }"

input:
tuple val(meta), path(bam), path(bai)

output:
tuple val(meta), path("*.junc"), emit: junc
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}"
"""
regtools junctions extract \\
$args \\
-o ${prefix}.junc \\
$bam

cat <<-END_VERSIONS > versions.yml
"${task.process}":
regtools: \$(regtools --version 2>&1 | sed 's/^.*regtools //; s/ .*\$//')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.junc

cat <<-END_VERSIONS > versions.yml
"${task.process}":
regtools: \$(regtools --version 2>&1 | sed 's/^.*regtools //; s/ .*\$//')
END_VERSIONS
"""
}
55 changes: 55 additions & 0 deletions modules/nf-core/regtools/junctionsextract/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: "regtools_junctionsextract"
description: Extract exon-exon junctions from an RNAseq BAM file. The output is a
BED file in the BED12 format.
keywords:
- regtools
- leafcutter
- RNA-seq
- splicing
tools:
- "regtools":
description: "RegTools is a set of tools that integrate DNA-seq and RNA-seq data
to help interpret mutations in a regulatory and splicing context."
homepage: "https://regtools.readthedocs.io/en/latest/"
documentation: "https://regtools.readthedocs.io/en/latest/#usage"
tool_dev_url: "https://github.com/griffithlab/regtools"
licence: ["MIT"]
identifier: biotools:regtools

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- bam:
type: file
description: Sorted BAM file
pattern: "*.{bam}"
- bai:
type: file
description: Index to sorted BAM file
pattern: "*.{bai}"

output:
- junc:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- "*.junc":
type: file
description: |
BED12 file containing exon-exon "regtools_junctionsextract"
pattern: "*.{junc}"
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@abartlett004"
maintainers:
- "@abartlett004"
62 changes: 62 additions & 0 deletions modules/nf-core/regtools/junctionsextract/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
nextflow_process {

name "Test Process REGTOOLS_JUNCTIONSEXTRACT"
script "../main.nf"
process "REGTOOLS_JUNCTIONSEXTRACT"

tag "modules"
tag "modules_nfcore"
tag "regtools"
tag "regtools/junctionsextract"

test("homo_sapiens - bam-bai") {

when {
process {
"""

input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test.rna.paired_end.sorted.chr6.bam", checkIfExists: true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test.rna.paired_end.sorted.chr6.bam.bai", checkIfExists: true)
]
"""
}
}

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

}

test("homo_sapiens - bam-bai - stub") {

options "-stub"

when {
process {
"""

input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test.rna.paired_end.sorted.chr6.bam", checkIfExists: true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test.rna.paired_end.sorted.chr6.bam.bai", checkIfExists: true)
]
"""
}
}

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

}

}
72 changes: 72 additions & 0 deletions modules/nf-core/regtools/junctionsextract/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"homo_sapiens - bam-bai - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.junc:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,b2432b2a81fb72994ef780a8e979d853"
],
"junc": [
[
{
"id": "test",
"single_end": false
},
"test.junc:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,b2432b2a81fb72994ef780a8e979d853"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.1"
},
"timestamp": "2024-11-20T11:29:52.982213"
},
"homo_sapiens - bam-bai": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.junc:md5,c0ccba2d76e9cb1588ba6d2e18c0742c"
]
],
"1": [
"versions.yml:md5,b2432b2a81fb72994ef780a8e979d853"
],
"junc": [
[
{
"id": "test",
"single_end": false
},
"test.junc:md5,c0ccba2d76e9cb1588ba6d2e18c0742c"
]
],
"versions": [
"versions.yml:md5,b2432b2a81fb72994ef780a8e979d853"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.1"
},
"timestamp": "2024-11-20T11:29:48.572345"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/regtools/junctionsextract/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
regtools/junctionsextract:
- "modules/nf-core/regtools/junctionsextract/**"
Loading