Clinical-Genomics / demultiplexing

To keep scripts associated with execution of the Illumina demultiplexing pipeline
5 stars 0 forks source link

WIP Allow custom columns in the sample sheet when adding demultiplexing stats to the cgstats database. #97

Closed barrystokman closed 4 years ago

barrystokman commented 4 years ago

When parsing the sample sheet I want demultiplexing to be able to handle custom columns, added by the customer so that the demultiplexing stats get added to the database.

Problem description:

The customer wants to add custom columns to the sample sheet. This is allowed according to the bcl2fastq manual, but our own software errors out, because the columns it parses are set.

Stacktrace when the customer adds columns Well and UDI:

Traceback (most recent call last):
  File "/home/hiseq.clinical/miniconda2/envs/prod/bin/cgstats", line 11, in <module>
    load_entry_point('cgstats==1.5.1', 'console_scripts', 'cgstats')()
  File "/home/hiseq.clinical/miniconda2/envs/prod/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/hiseq.clinical/miniconda2/envs/prod/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/hiseq.clinical/miniconda2/envs/prod/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/hiseq.clinical/miniconda2/envs/prod/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/hiseq.clinical/miniconda2/envs/prod/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/hiseq.clinical/miniconda2/envs/prod/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/hiseq.clinical/miniconda2/envs/prod/lib/python3.6/site-packages/cgstats/db/cli.py", line 166, in add
    novaseqparse.add(manager, demux_dir, unaligned)
  File "/home/hiseq.clinical/miniconda2/envs/prod/lib/python3.6/site-packages/cgstats/db/novaseqparse.py", line 215, in add
    new_supportparams = gather_supportparams(demux_dir, unaligned_dir)
  File "/home/hiseq.clinical/miniconda2/envs/prod/lib/python3.6/site-packages/cgstats/db/novaseqparse.py", line 77, in gather_supportparams
    rs['sampleconfig'] = Samplesheet(samplesheet_path).raw()
  File "/home/hiseq.clinical/miniconda2/envs/prod/lib/python3.6/site-packages/demux/utils/samplesheet.py", line 88, in __init__
    self.parse(samplesheet_path)
  File "/home/hiseq.clinical/miniconda2/envs/prod/lib/python3.6/site-packages/demux/utils/samplesheet.py", line 132, in parse
    header = self._get_data_header()
  File "/home/hiseq.clinical/miniconda2/envs/prod/lib/python3.6/site-packages/demux/utils/samplesheet.py", line 93, in _get_data_header
    header = [header_map_r[k] for k in header_r]
  File "/home/hiseq.clinical/miniconda2/envs/prod/lib/python3.6/site-packages/demux/utils/samplesheet.py", line 93, in <listcomp>
    header = [header_map_r[k] for k in header_r]
KeyError: 'Well'

Suggested solution:

Requirements:

barrystokman commented 4 years ago

We will not use custom columns for Fluffy, issue closed.