Skip to content

Commit 8e87edb

Browse files
Merge branch 'master' into boolean-parameter-to--log_skipped_fastqs
2 parents 7ca0df8 + 8667d59 commit 8e87edb

168 files changed

Lines changed: 4532 additions & 1052 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
args: ["--schemafile", "subworkflows/yaml-schema.json"]
1919
- id: check-github-workflows
2020
- repo: https://github.com/renovatebot/pre-commit-hooks
21-
rev: 37.368.10
21+
rev: 37.371.1
2222
hooks:
2323
- id: renovate-config-validator
2424
# use ruff for python files
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
3+
name: "bamtofastq10x"
4+
channels:
5+
- conda-forge
6+
- bioconda
7+
- defaults
8+
dependencies:
9+
- "bioconda::10x_bamtofastq=1.4.1"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
process BAMTOFASTQ10X {
2+
tag "$meta.id"
3+
label 'process_low'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7+
'https://depot.galaxyproject.org/singularity/10x_bamtofastq:1.4.1--hdbdd923_2':
8+
'biocontainers/10x_bamtofastq:1.4.1--hdbdd923_2' }"
9+
10+
input:
11+
tuple val(meta), path(bam)
12+
13+
output:
14+
tuple val(meta), path("*.fastq.gz"), emit: fastq
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+
bamtofastq \\
25+
$args \\
26+
$bam \\
27+
${prefix}.fastq.gz
28+
29+
cat <<-END_VERSIONS > versions.yml
30+
"${task.process}":
31+
bamtofastq10x: \$(bamtofastq --version |& sed '1!d ; s/bamtofastq //')
32+
END_VERSIONS
33+
"""
34+
35+
stub:
36+
def prefix = task.ext.prefix ?: "${meta.id}"
37+
"""
38+
touch ${prefix}.fastq.gz
39+
40+
cat <<-END_VERSIONS > versions.yml
41+
"${task.process}":
42+
bamtofastq10x: \$(bamtofastq --version |& sed '1!d ; s/bamtofastq //')
43+
END_VERSIONS
44+
"""
45+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: bamtofastq10x
2+
3+
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
4+
5+
keywords:
6+
- bam
7+
- convert
8+
- fastq
9+
- 10x
10+
11+
tools:
12+
- bamtofastq10x:
13+
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
14+
homepage: https://github.com/10XGenomics/bamtofastq
15+
documentation: https://github.com/10XGenomics/bamtofastq
16+
tool_dev_url: https://github.com/10XGenomics/bamtofastq
17+
licence: ["MIT"]
18+
input:
19+
- meta:
20+
type: map
21+
description: |
22+
Groovy Map containing sample information
23+
e.g. `[ id:'sample1', single_end:false ]`
24+
- bam:
25+
type: file
26+
description: BAM file
27+
pattern: "*.bam"
28+
output:
29+
- meta:
30+
type: map
31+
description: |
32+
Groovy Map containing sample information
33+
e.g. `[ id:'sample1', single_end:false ]`
34+
35+
- versions:
36+
type: file
37+
description: File containing software versions
38+
pattern: "versions.yml"
39+
40+
- fastq:
41+
type: file
42+
description: fastq compressed file
43+
pattern: "*.fastq.gz"
44+
45+
authors:
46+
- "@BlueBicycleBlog"
47+
maintainers:
48+
- "@BlueBicycleBlog"
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
nextflow_process {
2+
3+
name "Test Process BAMTOFASTQ10X"
4+
script "../main.nf"
5+
process "BAMTOFASTQ10X"
6+
7+
tag "modules"
8+
tag "modules_nfcore"
9+
tag "bamtofastq10x"
10+
11+
test("human - bam") {
12+
when {
13+
process {
14+
"""
15+
input[0] = Channel.of([
16+
[ id:'test' ],
17+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/10xgenomics/10x_cr12.bam', checkIfExists: true)
18+
])
19+
"""
20+
}
21+
}
22+
23+
then {
24+
assertAll(
25+
{ assert process.success },
26+
{ assert snapshot(process.out).match() }
27+
28+
)
29+
}
30+
}
31+
32+
33+
test("human - bam - stub") {
34+
35+
options "-stub"
36+
37+
when {
38+
process {
39+
"""
40+
input[0] = Channel.of([
41+
[ id:'test' ],
42+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/10xgenomics/10x_cr12.bam', checkIfExists: true)
43+
])
44+
"""
45+
}
46+
}
47+
48+
then {
49+
assertAll(
50+
{ assert process.success }
51+
)
52+
}
53+
54+
}
55+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"human - bam": {
3+
"content": [
4+
{
5+
"0": [
6+
[
7+
{
8+
"id": "test"
9+
},
10+
[
11+
[
12+
"bamtofastq_S1_L000_I1_001.fastq.gz:md5,a33682ac881de7a7453d79721b7621a0",
13+
"bamtofastq_S1_L000_R1_001.fastq.gz:md5,5ccebf77d8636d7a7cdfc59737aea79f",
14+
"bamtofastq_S1_L000_R2_001.fastq.gz:md5,2ee7c90e4307deba74065cfd00a65002"
15+
]
16+
]
17+
]
18+
],
19+
"1": [
20+
"versions.yml:md5,845cd1d09c8a3d0059da9d074a9e5436"
21+
],
22+
"fastq": [
23+
[
24+
{
25+
"id": "test"
26+
},
27+
[
28+
[
29+
"bamtofastq_S1_L000_I1_001.fastq.gz:md5,a33682ac881de7a7453d79721b7621a0",
30+
"bamtofastq_S1_L000_R1_001.fastq.gz:md5,5ccebf77d8636d7a7cdfc59737aea79f",
31+
"bamtofastq_S1_L000_R2_001.fastq.gz:md5,2ee7c90e4307deba74065cfd00a65002"
32+
]
33+
]
34+
]
35+
],
36+
"versions": [
37+
"versions.yml:md5,845cd1d09c8a3d0059da9d074a9e5436"
38+
]
39+
}
40+
],
41+
"meta": {
42+
"nf-test": "0.8.4",
43+
"nextflow": "24.04.0"
44+
},
45+
"timestamp": "2024-05-22T16:43:24.999397"
46+
}
47+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bamtofastq10x:
2+
- "modules/nf-core/bamtofastq10x/**"

modules/nf-core/bclconvert/main.nf

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ process BCLCONVERT {
88
tuple val(meta), path(samplesheet), path(run_dir)
99

1010
output:
11-
tuple val(meta), path("**_S[1-9]*_R?_00?.fastq.gz") , emit: fastq
12-
tuple val(meta), path("**_S[1-9]*_I?_00?.fastq.gz") , optional:true, emit: fastq_idx
13-
tuple val(meta), path("**Undetermined_S0*_R?_00?.fastq.gz") , optional:true, emit: undetermined
14-
tuple val(meta), path("**Undetermined_S0*_I?_00?.fastq.gz") , optional:true, emit: undetermined_idx
15-
tuple val(meta), path("Reports") , emit: reports
16-
tuple val(meta), path("Logs") , emit: logs
17-
tuple val(meta), path("InterOp/*.bin") , emit: interop
18-
path("versions.yml") , emit: versions
11+
tuple val(meta), path("**_S[1-9]*_R?_00?.fastq.gz") , emit: fastq
12+
tuple val(meta), path("**_S[1-9]*_I?_00?.fastq.gz") , optional:true, emit: fastq_idx
13+
tuple val(meta), path("**Undetermined_S0*_R?_00?.fastq.gz") , optional:true, emit: undetermined
14+
tuple val(meta), path("**Undetermined_S0*_I?_00?.fastq.gz") , optional:true, emit: undetermined_idx
15+
tuple val(meta), path("Reports") , emit: reports
16+
tuple val(meta), path("Logs") , emit: logs
17+
tuple val(meta), path("**/InterOp/*.bin", includeInputs: true), emit: interop
18+
path("versions.yml") , emit: versions
1919

2020
when:
2121
task.ext.when == null || task.ext.when
@@ -62,8 +62,6 @@ process BCLCONVERT {
6262
--bcl-input-directory ${input_dir} \\
6363
--sample-sheet ${samplesheet}
6464
65-
cp -r ${input_dir}/InterOp .
66-
6765
cat <<-END_VERSIONS > versions.yml
6866
"${task.process}":
6967
bclconvert: \$(bcl-convert -V 2>&1 | head -n 1 | sed 's/^.*Version //')
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
nextflow_process {
2+
3+
name "Test Process BISCUIT_ALIGN"
4+
script "../main.nf"
5+
process "BISCUIT_ALIGN"
6+
7+
tag "modules"
8+
tag "modules_nfcore"
9+
tag "biscuit"
10+
tag "biscuit/align"
11+
tag "biscuit/index"
12+
13+
setup {
14+
run("BISCUIT_INDEX") {
15+
script "../../index/main.nf"
16+
process {
17+
"""
18+
input[0] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
19+
"""
20+
}
21+
}
22+
}
23+
24+
test("Single-End sarscov2 test_methylated_1 [fastq_gz]") {
25+
26+
when {
27+
process {
28+
"""
29+
input[0] = [
30+
[ id:'test' ], // meta map
31+
[ file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true) ]
32+
]
33+
input[1] = BISCUIT_INDEX.out.index
34+
"""
35+
}
36+
}
37+
38+
then {
39+
assertAll(
40+
{ assert process.success },
41+
{ assert file(process.out.bam[0][1]).name == "test.bam" },
42+
{ assert file(process.out.bai[0][1]).name == "test.bam.bai" },
43+
{ assert snapshot(process.out.versions).match("single-end-versions") }
44+
)
45+
}
46+
}
47+
48+
test("Paired-End sarscov2 test_methylated_1 [fastq_gz]") {
49+
50+
when {
51+
process {
52+
"""
53+
input[0] = [
54+
[ id:'test' ], // meta map
55+
[ file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true),
56+
file(params.test_data['sarscov2']['illumina']['test_methylated_2_fastq_gz'], checkIfExists: true) ]
57+
]
58+
input[1] = BISCUIT_INDEX.out.index
59+
"""
60+
}
61+
}
62+
63+
then {
64+
assertAll(
65+
{ assert process.success },
66+
{ assert file(process.out.bam[0][1]).name == "test.bam" },
67+
{ assert file(process.out.bai[0][1]).name == "test.bam.bai" },
68+
{ assert snapshot(process.out.versions).match("paired-end-versions") }
69+
)
70+
}
71+
}
72+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"single-end-versions": {
3+
"content": [
4+
[
5+
"versions.yml:md5,0b2a8c4c438a785a890110a458399bfd"
6+
]
7+
],
8+
"meta": {
9+
"nf-test": "0.8.4",
10+
"nextflow": "24.04.1"
11+
},
12+
"timestamp": "2024-05-22T20:06:02.295706212"
13+
},
14+
"paired-end-versions": {
15+
"content": [
16+
[
17+
"versions.yml:md5,0b2a8c4c438a785a890110a458399bfd"
18+
]
19+
],
20+
"meta": {
21+
"nf-test": "0.8.4",
22+
"nextflow": "24.04.1"
23+
},
24+
"timestamp": "2024-05-22T20:06:17.879689395"
25+
}
26+
}

0 commit comments

Comments
 (0)