Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
09a0768
tests
eduard-watchmaker Oct 15, 2025
eb5e9a1
tests
eduard-watchmaker Oct 15, 2025
410f815
confs
eduard-watchmaker Oct 15, 2025
9fed518
confs
eduard-watchmaker Oct 15, 2025
bfe4c92
confs
eduard-watchmaker Oct 15, 2025
e378261
confs
eduard-watchmaker Oct 15, 2025
ddec51c
confs
eduard-watchmaker Oct 15, 2025
a814a98
confs
eduard-watchmaker Oct 15, 2025
64cb5fb
confs
eduard-watchmaker Oct 15, 2025
0d25fb6
gpu
eduard-watchmaker Oct 15, 2025
1d4e368
gpu
eduard-watchmaker Oct 15, 2025
346c924
last snap
Oct 15, 2025
1135a44
snap
eduard-watchmaker Oct 15, 2025
89553aa
rm snap
Oct 15, 2025
1b94c68
snap
eduard-watchmaker Oct 15, 2025
4fc5292
removed snapshot
eduard-watchmaker Oct 15, 2025
e789607
Merge branch 'new_align_dedup_bwamem' of github.com:nf-core/modules i…
eduard-watchmaker Oct 15, 2025
4d386e2
new snap
Oct 15, 2025
e96bf5e
Merge branch 'new_align_dedup_bwamem' of github.com:nf-core/modules i…
eduard-watchmaker Oct 15, 2025
bd582bd
lint
eduard-watchmaker Oct 15, 2025
387bee6
lint
eduard-watchmaker Oct 15, 2025
96267d4
channel
eduard-watchmaker Oct 15, 2025
72deafb
channel
eduard-watchmaker Oct 15, 2025
cc687b0
channel
eduard-watchmaker Oct 15, 2025
dfb3163
snap test
eduard-watchmaker Oct 15, 2025
a5eb4ba
last snapshot
Oct 15, 2025
8066ff9
last lint
eduard-watchmaker Oct 15, 2025
29c5767
gpu snap
Oct 15, 2025
8c6dc7d
Merge branch 'master' into new_align_dedup_bwamem
eduard-watchmaker Oct 16, 2025
b7491fa
Merge branch 'master' into new_align_dedup_bwamem
eduard-watchmaker Oct 17, 2025
40c3b95
Merge branch 'master' into new_align_dedup_bwamem
eduard-watchmaker Oct 20, 2025
d4247ea
PR feedback
eduard-watchmaker Oct 20, 2025
def28fc
Merge branch 'new_align_dedup_bwamem' of github.com:nf-core/modules i…
eduard-watchmaker Oct 20, 2025
d08254b
samtools sort prefix
eduard-watchmaker Oct 20, 2025
486af86
samtools sort prefix
eduard-watchmaker Oct 20, 2025
c6e37a2
samtools sort prefix
eduard-watchmaker Oct 20, 2025
73279d0
samtools sort prefix
eduard-watchmaker Oct 20, 2025
3e28150
samtools sort prefix
eduard-watchmaker Oct 20, 2025
8fb8884
samtools sort prefix
eduard-watchmaker Oct 20, 2025
2d15776
new snap
Oct 20, 2025
3f95612
new snap
Oct 20, 2025
1a62f20
Update subworkflows/nf-core/fastq_align_dedup_bwamem/meta.yml
eduard-watchmaker Oct 21, 2025
54e69d3
changed tests again
eduard-watchmaker Oct 21, 2025
8d93435
new cpu snapshot
Oct 21, 2025
ecc24de
Merge branch 'master' into new_align_dedup_bwamem
eduard-watchmaker Oct 21, 2025
df90876
low memory to fq2bam
eduard-watchmaker Oct 21, 2025
2cc3841
conf revert
eduard-watchmaker Oct 21, 2025
f502775
rm nftest utils line and add lowmem to fq2bam
eduard-watchmaker Oct 21, 2025
4f75db5
revert lowmem to fq2bam
eduard-watchmaker Oct 21, 2025
f63895c
index file
eduard-watchmaker Oct 21, 2025
6e39c51
path to index
eduard-watchmaker Oct 21, 2025
dfd3339
path to index
eduard-watchmaker Oct 21, 2025
d844298
revert nft utils
eduard-watchmaker Oct 21, 2025
f9e083c
test
eduard-watchmaker Oct 21, 2025
2466b40
test
eduard-watchmaker Oct 21, 2025
e028f2c
removed parabricks
eduard-watchmaker Oct 23, 2025
336ec28
new snapshot
Oct 23, 2025
4137153
Merge branch 'master' into new_align_dedup_bwamem
eduard-watchmaker Oct 23, 2025
93ce7bb
revert test data fw2bam
eduard-watchmaker Oct 23, 2025
81ce2f1
Merge branch 'new_align_dedup_bwamem' of github.com:nf-core/modules i…
eduard-watchmaker Oct 23, 2025
c978768
revert test data fw2bam
eduard-watchmaker Oct 23, 2025
42fd557
Merge branch 'master' into new_align_dedup_bwamem
eduard-watchmaker Oct 23, 2025
a04aad1
Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
eduard-watchmaker Oct 24, 2025
95ca65b
Update subworkflows/nf-core/fastq_align_dedup_bwamem/main.nf
eduard-watchmaker Oct 24, 2025
fa439e4
Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
eduard-watchmaker Oct 24, 2025
157c25a
Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
eduard-watchmaker Oct 24, 2025
ba77a08
Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
eduard-watchmaker Oct 24, 2025
3dda2ee
Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
eduard-watchmaker Oct 24, 2025
eb145ea
Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
eduard-watchmaker Oct 24, 2025
ff3be92
Update subworkflows/nf-core/fastq_align_dedup_bwamem/nextflow.config
eduard-watchmaker Oct 24, 2025
fe03a14
Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
eduard-watchmaker Oct 24, 2025
98f6e24
Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
eduard-watchmaker Oct 24, 2025
b99c6f2
Update subworkflows/nf-core/fastq_align_dedup_bwamem/tests/main.nf.test
eduard-watchmaker Oct 24, 2025
f578b99
added new tag at test
eduard-watchmaker Oct 24, 2025
9237960
added new tag at test
eduard-watchmaker Oct 24, 2025
6b84e16
new snapshot
Oct 24, 2025
acf88ba
Merge branch 'master' into new_align_dedup_bwamem
eduard-watchmaker Oct 27, 2025
1954238
Merge branch 'master' into new_align_dedup_bwamem
eduard-watchmaker Oct 27, 2025
fff2c7f
Merge branch 'master' into new_align_dedup_bwamem
eduard-watchmaker Oct 28, 2025
94b7c6d
Merge branch 'master' into new_align_dedup_bwamem
eduard-watchmaker Oct 29, 2025
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
90 changes: 90 additions & 0 deletions subworkflows/nf-core/fastq_align_dedup_bwamem/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
include { FASTQ_ALIGN_BWA } from '../fastq_align_bwa/main'
include { PICARD_ADDORREPLACEREADGROUPS } from '../../../modules/nf-core/picard/addorreplacereadgroups/main'
include { PICARD_MARKDUPLICATES } from '../../../modules/nf-core/picard/markduplicates/main'
include { SAMTOOLS_INDEX } from '../../../modules/nf-core/samtools/index/main'

workflow FASTQ_ALIGN_DEDUP_BWAMEM {

take:
ch_reads // channel: [ val(meta), [ reads ] ]
ch_fasta // channel: [ val(meta), [ fasta ] ]
ch_fasta_index // channel: [ val(meta), [ fasta index ] ]
ch_bwamem_index // channel: [ val(meta), [ bwam index ] ]
skip_deduplication // boolean: whether to deduplicate alignments
use_gpu // boolean: whether to use GPU or CPU for bwamem alignment

main:

ch_alignment = Channel.empty()
ch_alignment_index = Channel.empty()
ch_flagstat = Channel.empty()
ch_stats = Channel.empty()
ch_picard_metrics = Channel.empty()
ch_multiqc_files = Channel.empty()
ch_versions = Channel.empty()

FASTQ_ALIGN_BWA (
ch_reads,
ch_bwamem_index,
true, // val_sort_bam hardcoded to true
ch_fasta
)
ch_alignment = ch_alignment.mix(FASTQ_ALIGN_BWA.out.bam)
ch_alignment_index = ch_alignment.mix(FASTQ_ALIGN_BWA.out.bai)
ch_stats = ch_alignment.mix(FASTQ_ALIGN_BWA.out.stats) // channel: [ val(meta), path(stats) ]
ch_flagstat = ch_alignment.mix(FASTQ_ALIGN_BWA.out.flagstat) // channel: [ val(meta), path(flagstat) ]
ch_idxstats = ch_alignment.mix(FASTQ_ALIGN_BWA.out.idxstats) // channel: [ val(meta), path(idxstats) ]
ch_versions = ch_versions.mix(FASTQ_ALIGN_BWA.out.versions.first())

if (!skip_deduplication) {
/*
* Run Picard AddOrReplaceReadGroups to add read group (RG) to reads in bam file
*/
PICARD_ADDORREPLACEREADGROUPS (
ch_alignment,
ch_fasta,
ch_fasta_index
)
ch_versions = ch_versions.mix(PICARD_ADDORREPLACEREADGROUPS.out.versions.first())

/*
* Run Picard MarkDuplicates with the --REMOVE_DUPLICATES true flag
*/

PICARD_MARKDUPLICATES (
PICARD_ADDORREPLACEREADGROUPS.out.bam,
ch_fasta,
ch_fasta_index
)
ch_versions = ch_versions.mix(PICARD_MARKDUPLICATES.out.versions.first())

/*
* Run samtools index on deduplicated alignment
*/
SAMTOOLS_INDEX (
PICARD_MARKDUPLICATES.out.bam
)
ch_alignment = PICARD_MARKDUPLICATES.out.bam
ch_alignment_index = SAMTOOLS_INDEX.out.bai
ch_picard_metrics = PICARD_MARKDUPLICATES.out.metrics
ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first())
}

/*
* Collect MultiQC inputs
*/
ch_multiqc_files = ch_picard_metrics.collect{ meta, metrics -> metrics }
.mix(ch_flagstat.collect{ meta, flagstat -> flagstat })
.mix(ch_stats.collect{ meta, stats -> stats })
.mix(ch_idxstats.collect{ meta, stats -> stats })

emit:
bam = ch_alignment // channel: [ val(meta), [ bam ] ]
bai = ch_alignment_index // channel: [ val(meta), [ bai ] ]
samtools_flagstat = ch_flagstat // channel: [ val(meta), [ flagstat ] ]
samtools_stats = ch_stats // channel: [ val(meta), [ stats ] ]
samtools_index_stats = ch_idxstats // channel: [ val(meta), [ idxstats ] ]
picard_metrics = ch_picard_metrics // channel: [ val(meta), [ metrics ] ]
multiqc = ch_multiqc_files // channel: [ *{html,txt} ]
versions = ch_versions // channel: [ versions.yml ]
}
96 changes: 96 additions & 0 deletions subworkflows/nf-core/fastq_align_dedup_bwamem/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json
name: "fastq_align_dedup_bwamem"
description: Performs alignment of DNA or TAPS-treated reads using bwamem, sort and deduplicate
keywords:
- bwamem
- alignment
- map
- 5mC
- methylseq
- DNA
- fastq
- bam
components:
- samtools/index
- picard/addorreplacereadgroups
- picard/markduplicates
- fastq_align_bwa
input:
- ch_reads:
description: |
List of input FastQ files of size 1 and 2 for single-end and paired-end data,
respectively.
Structure: [ val(meta), [ path(reads) ] ]
pattern: "*.{fastq,fastq.gz}"
- ch_fasta:
type: file
description: |
Structure: [ val(meta), path(fasta) ]
pattern: "*.{fa,fa.gz}"
- ch_fasta_index:
type: file
description: |
Structure: [ val(meta), path(fasta index) ]
- ch_bwamem_index:
type: directory
description: |
Bwa-mem genome index files
Structure: [ val(meta), path(index) ]
pattern: "Bwa-memIndex"
- skip_deduplication:
type: boolean
description: |
Skip deduplication of aligned reads
output:
- bam:
type: file
description: |
Channel containing BAM files
Structure: [ val(meta), path(bam) ]
pattern: "*.bam"
- bai:
type: file
description: |
Channel containing indexed BAM (BAI) files
Structure: [ val(meta), path(bai) ]
pattern: "*.bai"
- samtools_flagstat:
type: file
description: |
File containing samtools flagstat output
Structure: [ val(meta), path(flagstat) ]
pattern: "*.flagstat"
- samtools_idxstats:
type: file
description: |
File containing samtools idxstats output
Structure: [ val(meta), path(idxstats) ]
pattern: "*.idxstats"
- samtools_stats:
type: file
description: |
File containing samtools stats output
Structure: [ val(meta), path(stats) ]
pattern: "*.{stats}"
- picard_metrics:
type: file
description: |
Duplicate metrics file generated by picard
Structure: [ val(meta), path(metrics) ]
pattern: "*.{metrics.txt}"
- multiqc:
type: file
description: |
Channel containing MultiQC report aggregating results across samples.
Structure: [ val(meta), path(multiqc_report.html) ]
pattern: "*.html"
- versions:
type: file
description: |
File containing software versions
Structure: [ path(versions.yml) ]
pattern: "versions.yml"
authors:
- "@eduard-watchmaker"
maintainers:
- "@eduard-watchmaker"
14 changes: 14 additions & 0 deletions subworkflows/nf-core/fastq_align_dedup_bwamem/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// IMPORTANT: This config file should be included to ensure that the subworkflow works properly.
process {
withName: 'SAMTOOLS_SORT' {
ext.prefix = { "${meta.id}.sorted" }
}
withName: 'PICARD_MARKDUPLICATES' {
ext.args = "--ASSUME_SORTED true --REMOVE_DUPLICATES true --VALIDATION_STRINGENCY LENIENT --PROGRAM_RECORD_ID 'null' --TMP_DIR tmp"
ext.prefix = { "${meta.id}.deduped.sorted" }
}
withName: 'PICARD_ADDORREPLACEREADGROUPS' {
ext.args = "--RGID 1 --RGLB lib1 --RGPL illumina --RGPU unit1 --RGSM sample1"
ext.prefix = { "${meta.id}.RG.sorted" }
}
}
Loading
Loading