Skip to content

Commit adfffed

Browse files
authored
Fix nextseq samplesheet parser (#17)
* Fix parsing when cloud-related sections are not included. Include BCLConvertData section in output * Bump version
1 parent 26220ef commit adfffed

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

bin/samplesheet_parser_nextseq.py

+17-13
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,18 @@ def parse_cloud_data_section(path_to_sample_sheet):
176176
break
177177
cloud_data_lines.append(line.strip().rstrip(','))
178178

179-
cloud_data_keys = [camel_to_snake(x) for x in cloud_data_lines[0].split(',')]
180-
for line in cloud_data_lines[1:]:
181-
d = {}
182-
values = line.split(',')
183-
for idx, key in enumerate(cloud_data_keys):
184-
try:
185-
d[key] = values[idx]
186-
except IndexError as e:
187-
d[key] = ""
188-
cloud_data.append(d)
189-
179+
if cloud_data_lines:
180+
cloud_data_keys = [camel_to_snake(x) for x in cloud_data_lines[0].split(',')]
181+
for line in cloud_data_lines[1:]:
182+
d = {}
183+
values = line.split(',')
184+
for idx, key in enumerate(cloud_data_keys):
185+
try:
186+
d[key] = values[idx]
187+
except IndexError as e:
188+
d[key] = ""
189+
cloud_data.append(d)
190+
190191
return cloud_data
191192

192193

@@ -203,8 +204,11 @@ def main(args):
203204
sample_sheet['reads'] = reads
204205
sample_sheet['sequencing_settings'] = sequencing_settings
205206
sample_sheet['bclconvert_settings'] = bclconvert_settings
206-
sample_sheet['cloud_settings'] = cloud_settings
207-
sample_sheet['cloud_data'] = cloud_data
207+
sample_sheet['bclconvert_data'] = bclconvert_data
208+
if cloud_settings:
209+
sample_sheet['cloud_settings'] = cloud_settings
210+
if cloud_data:
211+
sample_sheet['cloud_data'] = cloud_data
208212

209213
print(json.dumps(sample_sheet))
210214

nextflow.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ manifest {
2323
description = 'Routine Sequence QC'
2424
mainScript = 'main.nf'
2525
nextflowVersion = '>=20.01.0'
26-
version = '0.2.0'
26+
version = '0.2.1'
2727
}
2828

0 commit comments

Comments
 (0)