Skip to content

Commit ca957b7

Browse files
committed
Combine all the intersected files into one output file.
1 parent 06c2e8e commit ca957b7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

main.nf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ process intersect_files {
231231
set file(bed1), file(bed2) from intersect_input
232232
val nbeds from count_beds
233233
output:
234-
file "combined*.bed" into intersections
234+
file "combined_masked.bed" into intersections
235235

236236
publishDir params.outdir, mode: 'copy'
237237

@@ -259,6 +259,12 @@ process intersect_files {
259259
| sort -k1,1V -k2,2n > combined_masked_\${WORD,,}.bed
260260
done
261261
262+
cat <( grep -v -w 'DEL\\|INS\\|DUP' $bed1 ) \
263+
<( grep -v -w 'DEL\\|INS\\|DUP' $bed2 ) \
264+
| sort -k1,1V -k2,2n > combined_masked_OTHER.bed
265+
266+
sort -k1,1V -k2,2n combined_masked_*.bed >> combined_masked.bed
267+
262268
set -e # Restore exit-settings
263269
"""
264270
}

0 commit comments

Comments
 (0)