Skip to content

Commit

Permalink
refactor: use simple names and extension globbing
Browse files Browse the repository at this point in the history
  • Loading branch information
znorgaard committed Sep 23, 2024
1 parent ac04dd9 commit 5cdae0a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 41 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Enhancements & fixes

.
- [PR #79](https://github.com/nf-core/fastquorum/pull/79) - Publish aligned consensus bai file

## [[1.0.1]](https://github.com/nf-core/fastquorum/releases/tag/1.0.1) -- 2024-09-10

Expand Down
59 changes: 19 additions & 40 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -56,30 +56,23 @@ process {
]
}

withName: '.*FASTQTOBAM' {
withName: 'FASTQTOBAM' {
publishDir = [
path: { "${params.outdir}/preprocessing/fastqtobam/${meta.id}" },
mode: params.publish_dir_mode,
pattern: '*.unmapped.bam'
]
}

withName: '.*ALIGN_RAW_BAM' {
withName: 'ALIGN_RAW_BAM' {
publishDir = [
[
path: { "${params.outdir}/preprocessing/align_raw_bam/${meta.id}" },
mode: params.publish_dir_mode,
pattern: '*.mapped.bam'
],
[
path: { "${params.outdir}/preprocessing/align_raw_bam/${meta.id}" },
mode: params.publish_dir_mode,
pattern: '*.mapped.bam.bai'
]
path: { "${params.outdir}/preprocessing/align_raw_bam/${meta.id}" },
mode: params.publish_dir_mode,
pattern: '*.mapped.{bam, bam.bai}'
]
}

withName: '.*MERGE_BAM' {
withName: 'MERGE_BAM' {
ext.args = '--template-coordinate'
publishDir = [
path: { "${params.outdir}/preprocessing/merged/${meta.id}" },
Expand All @@ -89,7 +82,7 @@ process {
}

/* This can be removed when https://github.com/samtools/samtools/pull/2062 is merged */
withName: '.*SORTBAM' {
withName: 'SORTBAM' {
ext.args = '--sort-order TemplateCoordinate'
ext.prefix = { "${meta.id}.sorted" }
publishDir = [
Expand All @@ -99,7 +92,7 @@ process {
]
}

withName: '.*GROUPREADSBYUMI' {
withName: 'GROUPREADSBYUMI' {
publishDir = [
[
path: { "${params.outdir}/grouping/groupreadsbyumi/${meta.id}" },
Expand All @@ -115,54 +108,40 @@ process {
}

if (params.duplex_seq) {
withName: '.*COLLECTDUPLEXSEQMETRICS' {
withName: 'COLLECTDUPLEXSEQMETRICS' {
publishDir = [
[
path: { "${params.outdir}/metrics/duplex_seq/${meta.id}" },
mode: params.publish_dir_mode,
pattern: '*duplex_seq_metrics*.txt'
],
[
path: { "${params.outdir}/metrics/duplex_seq/${meta.id}" },
mode: params.publish_dir_mode,
pattern: '*duplex_seq_metrics*.pdf'
]
path: { "${params.outdir}/metrics/duplex_seq/${meta.id}" },
mode: params.publish_dir_mode,
pattern: '*duplex_seq_metrics*.{txt, pdf}'
]
}
}

withName: '.*CALLDDUPLEXCONSENSUSREADS|.*CALLMOLECULARCONSENSUSREADS' {
withName: 'CALLDDUPLEXCONSENSUSREADS|CALLMOLECULARCONSENSUSREADS' {
publishDir = [
path: { "${params.outdir}/consensus_calling/called/${meta.id}" },
mode: params.publish_dir_mode,
pattern: '*.cons.unmapped.bam'
]
}

withName: '.*CALLANDFILTERDUPLEXCONSENSUSREADS|.*CALLANDFILTERMOLECULARCONSENSUSREADS|.*FILTERCONSENSUSREADS' {
withName: 'CALLANDFILTERDUPLEXCONSENSUSREADS|CALLANDFILTERMOLECULARCONSENSUSREADS|FILTERCONSENSUSREADS' {
publishDir = [
[
path: { "${params.outdir}/consensus_filtering/filtered/${meta.id}" },
mode: params.publish_dir_mode,
pattern: '*.cons.filtered.bam'
],
[
path: { "${params.outdir}/consensus_filtering/filtered/${meta.id}" },
mode: params.publish_dir_mode,
pattern: '*.cons.filtered.bam.bai'
]
path: { "${params.outdir}/consensus_filtering/filtered/${meta.id}" },
mode: params.publish_dir_mode,
pattern: '*.cons.filtered.{bam, bam.bai}'
]
}

withName:'FILTERCONSENSUSREADS' {
memory = { check_max( 12.GB * task.attempt, 'memory' ) }
}

withName: '.*ALIGN_CONSENSUS_BAM' {
withName: 'ALIGN_CONSENSUS_BAM' {
publishDir = [
path: { "${params.outdir}/filtering/align_consensus_bam/${meta.id}" },
mode: params.publish_dir_mode,
pattern: '*.mapped.bam'
pattern: '*.mapped.{bam, bam.bai}'
]
}

Expand Down

0 comments on commit 5cdae0a

Please sign in to comment.