Skip to content

Commit

Permalink
Make ids unique
Browse files Browse the repository at this point in the history
  • Loading branch information
Aratz committed Sep 3, 2024
1 parent 8a43efa commit 38e39a9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,17 @@ workflow PIPELINE_INITIALISATION {
def tags = meta.tags ? meta.tags.tokenize(":") : []
def updated_meta = meta + [ id:meta.sample, tags:tags ]
if (!fastq_2) {
return [ updated_meta.id, updated_meta + [ single_end:true ], [ fastq_1 ] ]
return [
updated_meta.id + fastq_1.toString().replaceAll('/', '_'),
updated_meta + [ single_end:true ],
[ fastq_1 ]
]
} else {
return [ updated_meta.id, updated_meta + [ single_end:false ], [ fastq_1, fastq_2 ] ]
return [
updated_meta.id + fastq_1.toString().replaceAll('/', '_') + '_' + fastq_2.toString().replaceAll('/', '_'),
updated_meta + [ single_end:false ],
[ fastq_1, fastq_2 ]
]
}
}
.groupTuple()
Expand Down

0 comments on commit 38e39a9

Please sign in to comment.