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

add alignmentSieve #6693

Merged
merged 17 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
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/deeptools/alignmentsieve/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channels:
- conda-forge
- bioconda
dependencies:
- bioconda::deeptools=3.5.5
- bioconda::samtools=1.20
49 changes: 49 additions & 0 deletions modules/nf-core/deeptools/alignmentsieve/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
process DEEPTOOLS_ALIGNMENTSIEVE {
tag "$meta.id"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-eb9e7907c7a753917c1e4d7a64384c047429618a:41defd13a6f2ce014549fcc05d0b051f655777f9-0':
'biocontainers/mulled-v2-eb9e7907c7a753917c1e4d7a64384c047429618a:41defd13a6f2ce014549fcc05d0b051f655777f9-0' }"

input:
tuple val(meta), path(input), path(input_index)

output:
tuple val(meta), path("*_as.bam") , emit: bam
path "versions.yml" , emit: versions
path "*_log.txt" , emit: logs

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
alignmentSieve \\
$args \\
-b $input \\
-o ${prefix}_as.bam \\
--filterMetrics ${prefix}_log.txt \\
--numberOfProcessors $task.cpus

cat <<-END_VERSIONS > versions.yml
"${task.process}":
deeptools: \$(alignmentSieve --version | sed -e "s/alignmentSieve //g")
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}_as.bam
touch ${prefix}_log.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
deeptools: \$(alignmentSieve --version | sed -e "s/alignmentSieve //g")
END_VERSIONS
"""
}
60 changes: 60 additions & 0 deletions modules/nf-core/deeptools/alignmentsieve/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: deeptools_alignmentSieve
description: This tool filters alignments in a BAM/CRAM file according the the specified parameters.
keywords:
- filter
lpantano marked this conversation as resolved.
Show resolved Hide resolved
- shift
- ATACshift
tools:
- deeptools:
description: A set of user-friendly tools for normalization and visualzation of
deep-sequencing data
homepage: https://deeptools.readthedocs.io/en/develop/content/tools/alignmentSieve.html
documentation: https://deeptools.readthedocs.io/en/develop/content/tools/alignmentSieve.html
tool_dev_url: https://github.com/deeptools/deepTools/
doi: "10.1093/nar/gkw257"
licence: ["GPL v3"]
identifier: biotools:deeptools
input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- input:
type: file
description: BAM file
pattern: "*.{bam}"
- input_index:
type: file
description: BAM index file
pattern: "*.{bai}"
output:
- bam:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*_as.bam":
type: file
description: BAM file
pattern: "*.bam"
- logs:
- "*_log.txt":
type: file
description: TXT file
pattern: "*.txt"
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@FriederikeHanssen"
- "@SusiJo"
lpantano marked this conversation as resolved.
Show resolved Hide resolved
- "@JoseEspinosa"
lpantano marked this conversation as resolved.
Show resolved Hide resolved
- "@lpantano"
maintainers:
- "@FriederikeHanssen"
- "@SusiJo"
- "@JoseEspinosa"
lpantano marked this conversation as resolved.
Show resolved Hide resolved
60 changes: 60 additions & 0 deletions modules/nf-core/deeptools/alignmentsieve/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "deeptools"
tag "deeptools/alignmentsieve"

test("homo_sampiens - bam") {

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

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.logs,
bam(process.out.bam[0][1]).getReadsMD5(),
process.out.versions)
.match()
}
)
}
}
test("homo_sampiens - bam - 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.paired_end.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}
}
58 changes: 58 additions & 0 deletions modules/nf-core/deeptools/alignmentsieve/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"homo_sampiens - bam": {
"content": [
[
"test_log.txt:md5,39f97a6a2ff83330d5c93411113df63a"
],
[
"versions.yml:md5,baf8080ab016b89a27483809252bc803"
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-25T10:58:14.345921"
},
"homo_sampiens - bam - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test_as.bam:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,baf8080ab016b89a27483809252bc803"
],
"2": [
"test_log.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"bam": [
[
{
"id": "test",
"single_end": false
},
"test_as.bam:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"logs": [
"test_log.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"versions": [
"versions.yml:md5,baf8080ab016b89a27483809252bc803"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-25T10:58:18.482513"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/deeptools/alignmentsieve/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
deeptools/bamcoverage:
- "modules/nf-core/deeptools/alignmentsieve/**"
Loading