Arthur
09/29/2025, 1:56 PMMaxime Garcia
09/29/2025, 1:58 PMArthur
09/29/2025, 2:11 PMArthur
09/30/2025, 1:37 AMMaxime Garcia
09/30/2025, 5:18 AMMahesh Binzer-Panchal
09/30/2025, 6:43 AMArthur
09/30/2025, 6:53 AMtap or set and complained that the values I put in them were variables that were not declaredMahesh Binzer-Panchal
09/30/2025, 6:57 AMtap recently in an example and it was fineArthur
09/30/2025, 7:02 AMdef make_samplesheet(input, projDir){
Channel
.fromList(
samplesheetToList(input, "${projDir}/assets/schema_input.json")
)
.tap{ ch_samplesheet_intermediate }
.dump(tag:'samplesheet_raw', pretty:true)
.map{ meta, samples ->
validateSampleFileTypes(meta, samples)
}
.collect()
.map{ errs -> error("Validation errors:\n ${errs.join('\n')}\n") }
.set{ ch_errors }
// This join allows us to prevent the pipeline from proceeding
// until all samples have been validated
ch_samplesheet_intermediate
.join( ch_errors, remainder:true )
.map{ sval -> sval[0..-2] }
.set{ ch_samplesheet }
return ch_samplesheet
}Arthur
09/30/2025, 7:02 AMset and tap variables have e.g. ch_errors is not defined as an errorMahesh Binzer-Panchal
09/30/2025, 7:09 AMdef make_samplesheet(input, projDir){
def ch_samplesheet_intermediate = Channel.fromList(
samplesheetToList(input, "${projDir}/assets/schema_input.json")
)
def ch_errors = ch_samplesheet_intermediate
.dump(tag:'samplesheet_raw', pretty:true)
.map{ meta, samples ->
validateSampleFileTypes(meta, samples)
}
.collect()
.map{ errs -> error("Validation errors:\n ${errs.join('\n')}\n") }
// This join allows us to prevent the pipeline from proceeding
// until all samples have been validated
def ch_samplesheet = ch_samplesheet_intermediate
.join( ch_errors, remainder:true )
.map{ sval -> sval[0..-2] }
ch_samplesheet
}Arthur
09/30/2025, 7:10 AMtap is somewhat annoying but hey hoMahesh Binzer-Panchal
09/30/2025, 7:11 AMtap and set anyway because the syntax above is preferred, possibly because of scopingArthur
09/30/2025, 7:12 AMset but then it is (was?) used quite extensively in docs and across nf-core so I sort of got used to itMaxime Garcia
09/30/2025, 7:12 AMMaxime Garcia
09/30/2025, 7:12 AMNiklas Schandry
09/30/2025, 12:18 PMArthur
09/30/2025, 12:19 PMArthur
09/30/2025, 12:19 PMArthur
09/30/2025, 12:30 PMNiklas Schandry
09/30/2025, 2:24 PMMaxime Garcia
09/30/2025, 2:28 PM