generated from CCBR/CCBR_NextflowTemplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use collectFile to avoid filename collisions in prep_diffbind
- Loading branch information
1 parent
f09db39
commit bb9c77b
Showing
4 changed files
with
21 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,26 @@ | ||
process PREP_DIFFBIND { | ||
tag { "${metas[0].contrast}.${metas[0].tool}" } | ||
tag { "${meta.id}.${meta.contrast}.${meta.tool}" } | ||
label 'process_single' | ||
|
||
container "${params.containers.base}" | ||
|
||
input: | ||
tuple val(metas), path(bams), path(bais), path(peaks), path(ctrl_bams), path(ctrl_bais) | ||
tuple val(meta), path(bam), path(bai), path(peak), path(ctrl_bam), path(ctrl_bai) | ||
|
||
output: | ||
tuple val(new_meta), path("*.csv"), emit: csv | ||
tuple val(meta), path("*.csv"), emit: csv | ||
|
||
script: | ||
assert metas*.contrast.toSet().size() == 1 | ||
assert metas*.tool.toSet().size() == 1 | ||
new_meta = [contrast: metas[0].contrast, tool: metas[0].tool] | ||
def csv_text = [['SampleID', "Replicate", 'Condition', 'bamReads', "ControlID", "bamControl", 'Peaks', 'PeakCaller']] | ||
[metas, bams, bais, peaks] | ||
.transpose() | ||
.each { meta, bam, bai, peak -> | ||
csv_text.add([meta.id, meta.rep, meta.group, bam, meta.control, ctrlbam, peak, meta.tool]) | ||
} | ||
csv_text = csv_text*.join(',').join(System.lineSeparator) | ||
def csv_text = [ | ||
['SampleID', "Replicate", 'Condition', 'bamReads', "ControlID", "bamControl", 'Peaks', 'PeakCaller'], | ||
[meta.id, meta.rep, meta.group, bam, meta.control, ctrl_bam, peak, meta.tool] | ||
]*.join(',').join(System.lineSeparator) | ||
""" | ||
echo -ne "${csv_text}" > ${metas[0].contrast}.${metas[0].tool}.csv | ||
echo -ne "${csv_text}" > ${meta.contrast}.${meta.tool}.${meta.id}.csv | ||
""" | ||
|
||
stub: | ||
""" | ||
touch ${metas[0].contrast}.${metas[0].tool}.csv | ||
touch ${meta.contrast}.${meta.tool}.${meta.id}.csv | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters