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 meta to bowtie build #3848

Merged
merged 37 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e41c0d6
Add meta to bowtie build
SPPearce Sep 20, 2023
40e871b
Merge branch 'master' into bowtie_build_meta
SPPearce Sep 21, 2023
fa5f4e4
Swap fastq ngscheckmate tests
SPPearce Sep 21, 2023
e30a6e0
Merge branch 'master' into bowtie_build_meta
SPPearce Oct 17, 2023
a0652a6
Merge branch 'master' into bowtie_build_meta
SPPearce Oct 19, 2023
3583d39
Merge branch 'master' into bowtie_build_meta
SPPearce May 3, 2024
04d6f0e
Swap to nf-test
SPPearce May 3, 2024
be8fc54
Remove spurious changes to bowtie2
SPPearce May 3, 2024
4aea567
Actually revert bowtie2
SPPearce May 3, 2024
95216f7
Add the rest of bowtie2
SPPearce May 3, 2024
af4cce4
Again
SPPearce May 3, 2024
7962029
Merge branch 'master' into bowtie_build_meta
SPPearce May 8, 2024
09bfe04
Merge branch 'master' into bowtie_build_meta
SPPearce May 13, 2024
59f9329
Merge branch 'master' into bowtie_build_meta
SPPearce May 22, 2024
5abb827
Fix merge conflict
SPPearce Jun 17, 2024
0dadefd
Revert bowtie2 changes
SPPearce Jun 17, 2024
1a14233
Swap to meta.id as prefix
SPPearce Jun 17, 2024
7481003
Swap bowtie align to nftest
SPPearce Jun 18, 2024
9041630
Update tests
SPPearce Jun 18, 2024
d1ff319
Merge branch 'master' into bowtie_build_meta
SPPearce Jun 18, 2024
f91050e
Use nft-bam
SPPearce Jun 18, 2024
16b496e
Update modules/nf-core/bowtie/build/tests/main.nf.test
SPPearce Jun 18, 2024
27a2513
Swap to testdata path
SPPearce Jun 18, 2024
8239f23
Update modules/nf-core/ngscheckmate/patterngenerator/main.nf
SPPearce Jun 18, 2024
789c3a6
Swap index finding to $
SPPearce Jun 18, 2024
d2f839b
Merge branch 'master' into bowtie_build_meta
SPPearce Jun 18, 2024
ecb2187
Merge branch 'master' into bowtie_build_meta
SPPearce Jun 19, 2024
c999e1d
Fix vafncm test
SPPearce Jun 25, 2024
ee6b12a
Update meta
SPPearce Jun 25, 2024
5380f26
Merge branch 'master' into bowtie_build_meta
SPPearce Jun 25, 2024
3507b85
Remove bam header md5sum
SPPearce Jun 25, 2024
3455f71
Merge branch 'master' into bowtie_build_meta
SPPearce Jun 25, 2024
fe1ca34
Update fastq test
SPPearce Jun 26, 2024
3d1759a
Merge branch 'master' into bowtie_build_meta
SPPearce Jun 26, 2024
81175d6
Update paired bam test
SPPearce Jun 26, 2024
5f3ed48
Delete modules/nf-core/bowtie/align/tests/nextflow.config
SPPearce Jun 27, 2024
88174bc
Merge branch 'master' into bowtie_build_meta
SPPearce Jun 27, 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
30 changes: 25 additions & 5 deletions modules/nf-core/bowtie/align/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ process BOWTIE_ALIGN {

input:
tuple val(meta), path(reads)
path index
tuple val(meta2), path(index)

output:
tuple val(meta), path('*.bam'), emit: bam
tuple val(meta), path('*.out'), emit: log
path "versions.yml" , emit: versions
tuple val(meta), path('*fastq.gz'), optional:true, emit: fastq
tuple val(meta), path('*.bam') , emit: bam
tuple val(meta), path('*.out') , emit: log
tuple val(meta), path('*fastq.gz') , emit: fastq, optional : true
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand Down Expand Up @@ -53,4 +53,24 @@ process BOWTIE_ALIGN {
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
def unaligned = params.save_unaligned ?
meta.single_end ? "echo '' | gzip > ${prefix}.unmapped.fastq.gz" :
"echo '' | gzip > ${prefix}.unmapped_1.fastq.gz; echo '' | gzip > ${prefix}.unmapped_2.fastq.gz"
: ''
"""
touch ${prefix}.bam
touch ${prefix}.out
$unaligned

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


}
18 changes: 14 additions & 4 deletions modules/nf-core/bowtie/align/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ input:
description: |
List of input FastQ files of size 1 and 2 for single-end and paired-end data,
respectively.
- meta2:
type: map
description: |
Groovy Map containing genome information
e.g. [ id:'sarscov2' ]
- index:
type: file
description: Bowtie genome index files
Expand All @@ -36,14 +41,19 @@ output:
type: file
description: Output BAM file containing read alignments
pattern: "*.{bam}"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- fastq:
type: file
description: Unaligned FastQ files
pattern: "*.fastq.gz"
- log:
type: file
description: Log file
pattern: "*.log"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@kevinmenden"
maintainers:
Expand Down
126 changes: 126 additions & 0 deletions modules/nf-core/bowtie/align/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "bowtie"
tag "bowtie/align"
tag "bowtie/build"


setup {
run("BOWTIE_BUILD") {
script "../../../bowtie/build/main.nf"
process {
"""
input[0] = [[ id:'sarscov2' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ]
"""
}
}
}

test("sarscov2 - single_end") {

when {
process {
"""
input[0] = [ [id:"test", single_end:true],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
]
input[1] = BOWTIE_BUILD.out.index
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions,
process.out.bam.collect { bam(it[1]).getHeaderMD5() },
process.out.bam.collect { bam(it[1]).getReadsMD5() },
process.out.log
).match() }
)
}

}

test("sarscov2 - single_end - stub") {

options "-stub"

when {
process {
"""
input[0] = [ [id:"test", single_end:true],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
]
input[1] = BOWTIE_BUILD.out.index
"""
}
}

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

}

test("sarscov2 - paired_end") {

when {
process {
"""
input[0] = [ [id:"test", single_end:false],
[file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)]
]
input[1] = BOWTIE_BUILD.out.index
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions,
process.out.bam.collect { bam(it[1]).getHeaderMD5() },
process.out.bam.collect { bam(it[1]).getReadsMD5() },
process.out.log
).match() }
)
}

}

test("sarscov2 - paired_end - stub") {

options "-stub"
when {
process {
"""
input[0] = [ [id:"test", single_end:false],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
]
input[1] = BOWTIE_BUILD.out.index
"""
}
}

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

}

}
Loading
Loading