Molmed / checkQC

CheckQC inspects the content of an Illumina runfolder and determines if it passes a set of quality criteria
http://checkqc.readthedocs.io/
GNU General Public License v3.0
25 stars 16 forks source link

Error in code for UndeterminedPercentageHandler #98

Open maleasy opened 3 years ago

maleasy commented 3 years ago

When running checkQC on a MiSeq run, i get the following error:

Traceback (most recent call last):
  File "/home/maleasy/miniconda3/envs/checkqc/bin/checkqc", line 8, in <module>
    sys.exit(start())
  File "/home/maleasy/miniconda3/envs/checkqc/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/home/maleasy/miniconda3/envs/checkqc/lib/python3.9/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/home/maleasy/miniconda3/envs/checkqc/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/maleasy/miniconda3/envs/checkqc/lib/python3.9/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/home/maleasy/miniconda3/envs/checkqc/lib/python3.9/site-packages/checkQC/app.py", line 41, in start
    app.run()
  File "/home/maleasy/miniconda3/envs/checkqc/lib/python3.9/site-packages/checkQC/app.py", line 104, in run
    reports = self.configure_and_run()
  File "/home/maleasy/miniconda3/envs/checkqc/lib/python3.9/site-packages/checkQC/app.py", line 87, in configure_and_run
    reports = qc_engine.run()
  File "/home/maleasy/miniconda3/envs/checkqc/lib/python3.9/site-packages/checkQC/qc_engine.py", line 61, in run
    reports = self._compile_reports()
  File "/home/maleasy/miniconda3/envs/checkqc/lib/python3.9/site-packages/checkQC/qc_engine.py", line 103, in _compile_reports
    handler_report = handler.report()
  File "/home/maleasy/miniconda3/envs/checkqc/lib/python3.9/site-packages/checkQC/handlers/qc_handler.py", line 240, in report
    sorted_errors_and_warnings = sorted(errors_and_warnings, key=lambda x: x.ordering)
  File "/home/maleasy/miniconda3/envs/checkqc/lib/python3.9/site-packages/checkQC/handlers/undetermined_percentage_handler.py", line 75, in check_qc
    if self.error() != self.UNKNOWN and percentage_undetermined > compute_threshold(self.error()):
  File "/home/maleasy/miniconda3/envs/checkqc/lib/python3.9/site-packages/checkQC/handlers/undetermined_percentage_handler.py", line 66, in compute_threshold
    return value + mean_phix_per_lane[lane_nbr]
KeyError: 1

When commenting out the handler in the config file it works:

...
default_handlers:
#  - name: UndeterminedPercentageHandler
#    warning: unknown
#    error: 9 # <% Phix on lane> + < value as %>
...

Possibly related: I tried to install checkqc 3.6.5 with conda, which seemed to work, but running checkQC lead to an error

ModuleNotFoundError: No module named 'interop'

conda however says that illumina-interop is installed. I then installed checkQC with pip in a new, clean conda env, which worked, but shows the error described above.

matrulda commented 3 years ago

Thanks for reporting, @maleasy ! I think this issue is caused by interop v1.1.10 not being supported in python 3.9. Support for that python version was added in this release https://github.com/Illumina/interop/releases/tag/v1.1.18. Until we solve this issue you should be able to run CheckQC in an environment with python 3.6 installed.

maleasy commented 3 years ago

Thank you for your answer! I created a new conda env with python 3.6 and installed checkQC, which lead to the same ModuleNotFoundError for interop. Installing with pip in a python 3.6 env works (but that already worked using python 3.9). The interop version is interop-1.1.23 CheckQC still throws the same KeyError exception as before.