@@ -31,7 +31,7 @@ workflow PIPELINE_INITIALISATION {
3131 monochrome_logs // boolean: Do not use coloured log outputs
3232 nextflow_cli_args // array: List of positional nextflow CLI args
3333 outdir // string: The output directory where the results will be saved
34- input // string: Path to input samplesheet
34+ _input // string: Path to input samplesheet
3535 help // boolean: Display help message and exit
3636 help_full // boolean: Show the full help message
3737 show_hidden // boolean: Show hidden parameters in the help message
@@ -107,7 +107,7 @@ workflow PIPELINE_INITIALISATION {
107107 // Create channel from input file provided through params.input
108108 //
109109 if (params. aligner == ' cellrangermulti' ) { // the cellrangermulti sub-workflow logic needs that channels have reads separated by feature_type. Cannot merge all.
110- Channel
110+ channel
111111 .fromList(samplesheetToList(params. input, " ${ projectDir} /assets/schema_input.json" ))
112112 .map {
113113 meta, fastq_1, fastq_2 ->
@@ -118,17 +118,17 @@ workflow PIPELINE_INITIALISATION {
118118 }
119119 }
120120 .groupTuple( by : [0 ,1 ] )
121- .map{ id, type , meta, reads -> [ id, meta, reads ] }
122- .map {
123- validateInputSamplesheet(it )
121+ .map{ id, _type , meta, reads -> [ id, meta, reads ] }
122+ .map { sheet_row ->
123+ validateInputSamplesheet(sheet_row )
124124 }
125125 .map {
126126 meta, fastqs ->
127127 return [ meta, fastqs. flatten() ]
128128 }
129129 .set { ch_samplesheet }
130130 } else if (params. aligner == ' cellrangerarc' ) { // the cellrangerarc sub-workflow logic needs that channels have a meta, type, subsample, fastqs structure.
131- Channel
131+ channel
132132 .fromList(samplesheetToList(params. input, " ${ projectDir} /assets/schema_input.json" ))
133133 .map { meta, fastq_1, fastq_2 ->
134134 if (! fastq_2 || (meta. sample_type == " atac" && ! meta. fastq_barcode)) {
@@ -141,12 +141,12 @@ workflow PIPELINE_INITIALISATION {
141141 }
142142 }
143143 .groupTuple()
144- .map {
145- cellrangerarcStructure(it )
144+ .map { structure_input ->
145+ cellrangerarcStructure(structure_input )
146146 }
147147 .set { ch_samplesheet }
148148 } else {
149- Channel
149+ channel
150150 .fromList(samplesheetToList(params. input, " ${ projectDir} /assets/schema_input.json" ))
151151 .map {
152152 meta, fastq_1, fastq_2 ->
@@ -157,8 +157,8 @@ workflow PIPELINE_INITIALISATION {
157157 }
158158 }
159159 .groupTuple()
160- .map {
161- validateInputSamplesheet(it )
160+ .map { sheet_row ->
161+ validateInputSamplesheet(sheet_row )
162162 }
163163 .map {
164164 meta, fastqs ->
@@ -241,7 +241,7 @@ def validateCellrangerMultiBarcodes() {
241241 def cellranger_multi_barcodes = file(params. cellranger_multi_barcodes). splitCsv(header : true )
242242
243243 // Get unique samples from input samplesheet for cross-validation
244- def inputSamples = file(params. input). splitCsv(header : true ). collect { it . sample }. toSet()
244+ def inputSamples = file(params. input). splitCsv(header : true ). collect { row -> row . sample }. toSet()
245245
246246 // Check that at least one barcode column is provided for each row
247247 // and that each sample uses only one type of barcode
@@ -268,14 +268,14 @@ def validateCellrangerMultiBarcodes() {
268268
269269 // Validate that at least one barcode identifier is populated in each row
270270 if (rowsWithoutBarcodes) {
271- def errorDetails = rowsWithoutBarcodes. collect { " row ${ it .row} (${ it .multiplexed_sample_id} )" }. join(' , ' )
271+ def errorDetails = rowsWithoutBarcodes. collect { missing -> " row ${ missing .row} (${ missing .multiplexed_sample_id} )" }. join(' , ' )
272272 error(" Please check cellranger_multi_barcodes samplesheet -> " +
273273 " The following rows have no barcode identifiers: ${ errorDetails} . " +
274274 " Each row must have exactly one of: 'probe_barcode_ids', 'cmo_ids', or 'ocm_ids'." )
275275 }
276276
277277 // Validate that no more than one barcode identifier is populated in each row
278- def samplesWithMixedBarcodes = sampleBarcodeTypes. findAll { multiplexed_sample_id , info -> info. types. size() > 1 }
278+ def samplesWithMixedBarcodes = sampleBarcodeTypes. findAll { _multiplexed_sample_id , info -> info. types. size() > 1 }
279279 if (samplesWithMixedBarcodes) {
280280 def errorMsg = samplesWithMixedBarcodes. collect { multiplexed_sample_id , info ->
281281 " '${ multiplexed_sample_id} ' (row ${ info.row} ) uses multiple barcode types: ${ info.types.join(', ')} "
@@ -321,7 +321,7 @@ def cellrangerarcStructure(input) {
321321
322322 // Validate that the property "sample_type" is present and has valid values
323323 def valid_sample_types = [" gex" , " atac" ]
324- def sample_type_ok = metas. collect { meta -> meta. sample_type }. unique(). every { it in valid_sample_types }
324+ def sample_type_ok = metas. collect { meta -> meta. sample_type }. unique(). every { st -> st in valid_sample_types }
325325 if (! sample_type_ok) {
326326 error(" Please check input samplesheet -> The property 'sample_type' is required and can only be 'gex' or 'atac'." )
327327 }
0 commit comments