Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 9 additions & 0 deletions modules/nf-core/bamtofastq10x/environment.yml
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: "bamtofastq10x"
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- "bioconda::10x_bamtofastq=1.4.1"
45 changes: 45 additions & 0 deletions modules/nf-core/bamtofastq10x/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
process BAMTOFASTQ10X {
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/10x_bamtofastq:1.4.1--hdbdd923_2':
'biocontainers/10x_bamtofastq:1.4.1--hdbdd923_2' }"

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

output:
tuple val(meta), path("*.fastq.gz"), emit: fastq
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}"
"""
bamtofastq \\
$args \\
$bam \\
${prefix}.fastq.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
bamtofastq10x: \$(bamtofastq --version |& sed '1!d ; s/bamtofastq //')
END_VERSIONS
"""

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

cat <<-END_VERSIONS > versions.yml
"${task.process}":
bamtofastq10x: \$(bamtofastq --version |& sed '1!d ; s/bamtofastq //')
END_VERSIONS
"""
}
48 changes: 48 additions & 0 deletions modules/nf-core/bamtofastq10x/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: bamtofastq10x

description: Tool for converting 10x BAMs produced by Cell Ranger, Space Ranger, Cell Ranger ATAC, Cell Ranger DNA, and Long Ranger back to FASTQ files that can be used as inputs to re-run analysis

keywords:
- bam
- convert
- fastq
- 10x

tools:
- bamtofastq10x:
description: Tool for converting 10x BAMs produced by Cell Ranger, Space Ranger, Cell Ranger ATAC, Cell Ranger DNA, and Long Ranger back to FASTQ files that can be used as inputs to re-run analysis
homepage: https://github.com/10XGenomics/bamtofastq
documentation: https://github.com/10XGenomics/bamtofastq
tool_dev_url: https://github.com/10XGenomics/bamtofastq
licence: ["MIT"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- bam:
type: file
description: BAM file
pattern: "*.bam"
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"

- fastq:
type: file
description: fastq compressed file
pattern: "*.fastq.gz"

authors:
- "@BlueBicycleBlog"
maintainers:
- "@BlueBicycleBlog"
55 changes: 55 additions & 0 deletions modules/nf-core/bamtofastq10x/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "bamtofastq10x"

test("human - bam") {
when {
process {
"""
input[0] = Channel.of([
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/10xgenomics/10x_cr12.bam', checkIfExists: true)
])
"""
}
}

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

)
}
}


test("human - bam - stub") {

options "-stub"

when {
process {
"""
input[0] = Channel.of([
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/10xgenomics/10x_cr12.bam', checkIfExists: true)
])
"""
}
}

then {
assertAll(
{ assert process.success }
)
}

}
}
47 changes: 47 additions & 0 deletions modules/nf-core/bamtofastq10x/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"human - bam": {
"content": [
{
"0": [
[
{
"id": "test"
},
[
[
"bamtofastq_S1_L000_I1_001.fastq.gz:md5,a33682ac881de7a7453d79721b7621a0",
"bamtofastq_S1_L000_R1_001.fastq.gz:md5,5ccebf77d8636d7a7cdfc59737aea79f",
"bamtofastq_S1_L000_R2_001.fastq.gz:md5,2ee7c90e4307deba74065cfd00a65002"
]
]
]
],
"1": [
"versions.yml:md5,845cd1d09c8a3d0059da9d074a9e5436"
],
"fastq": [
[
{
"id": "test"
},
[
[
"bamtofastq_S1_L000_I1_001.fastq.gz:md5,a33682ac881de7a7453d79721b7621a0",
"bamtofastq_S1_L000_R1_001.fastq.gz:md5,5ccebf77d8636d7a7cdfc59737aea79f",
"bamtofastq_S1_L000_R2_001.fastq.gz:md5,2ee7c90e4307deba74065cfd00a65002"
]
]
]
],
"versions": [
"versions.yml:md5,845cd1d09c8a3d0059da9d074a9e5436"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.0"
},
"timestamp": "2024-05-22T16:43:24.999397"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/bamtofastq10x/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bamtofastq10x:
- "modules/nf-core/bamtofastq10x/**"