Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkqc: InterOp is not installed in docker image #46558

Open
matrulda opened this issue Mar 19, 2024 · 6 comments
Open

checkqc: InterOp is not installed in docker image #46558

matrulda opened this issue Mar 19, 2024 · 6 comments

Comments

@matrulda
Copy link
Contributor

matrulda commented Mar 19, 2024

Regarding checkqc version: 4.0.1 build 0

Hi!

I need some help with troubleshooting the docker image created for checkqc. When trying to use it, I get the following error when trying to process a run folder:

  Traceback (most recent call last):
  File "/usr/local/bin/checkqc", line 10, in <module>
    sys.exit(start())
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/checkQC/app.py", line 41, in start
    app.run()
  File "/usr/local/lib/python3.10/site-packages/checkQC/app.py", line 104, in run
    reports = self.configure_and_run()
  File "/usr/local/lib/python3.10/site-packages/checkQC/app.py", line 87, in configure_and_run
    reports = qc_engine.run()
  File "/usr/local/lib/python3.10/site-packages/checkQC/qc_engine.py", line 56, in run
    self._create_handlers()
  File "/usr/local/lib/python3.10/site-packages/checkQC/qc_engine.py", line 69, in _create_handlers
    create_subclass_instance(clazz_config["name"], clazz_config))
  File "/usr/local/lib/python3.10/site-packages/checkQC/handlers/qc_handler_factory.py", line 32, in create_subclass_instance
    importlib.import_module(modname)
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/local/lib/python3.10/site-packages/checkQC/handlers/error_rate_handler.py", line 3, in <module>
    from checkQC.parsers.interop_parser import InteropParser
  File "/usr/local/lib/python3.10/site-packages/checkQC/parsers/interop_parser.py", line 4, in <module>
    from interop import py_interop_run_metrics, py_interop_run, py_interop_summary
ModuleNotFoundError: No module named 'interop'

It looks like the InterOp module is not installed. The conda package and singularity image does not have this issue. I am not able get the bioconda-utils to work (bioconda/bioconda-utils#929) so I'm not sure what happens during the build process for the docker image. I would very much appreciate help with this since it is blocking me from completing the CheckQC module for nf-core: nf-core/modules#4158

Do you have any ideas, @cbrueffer?

Steps to reproduce error:

docker pull quay.io/biocontainers/checkqc:4.0.1--pyhdfd78af_0
git clone https://github.com/Molmed/checkQC.git
docker run -v $PWD:$PWD <docker image ID> checkqc $PWD/checkQC/tests/resources/170726_D00118_0303_BCB1TVANXX/
@matrulda
Copy link
Contributor Author

I think this issue is caused by the way illumina-interop is installed:

CheckQC need the interop module to be available at /usr/local/lib/python3.10/site-packages/, this could be achieved by installing the interop package with pip.

@matrulda
Copy link
Contributor Author

As a sidenote: This also affects the singularity and conda build. I just didn't notice since singularity was "clever" enough to import the module from my local machine:

singularity shell checkqc\:4.0.1--pyhdfd78af_0
Singularity> python
Python 3.10.13 | packaged by conda-forge | (main, Dec 23 2023, 15:36:39) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import interop
>>> print(interop.__file__)
/home/matilda/.local/lib/python3.10/site-packages/interop/__init__.py

@mahesh-panchal
Copy link
Contributor

mahesh-panchal commented Mar 19, 2024

Ah, seems you got there.
Add export PYTHONNOUSERSITE=1 when testing so it doesn't pick up local modules.
This is in the nf-core configs too: https://github.com/nf-core/tools/blob/9eac5e9b33a4b86a5228e950a8c8fd16765f4a85/nf_core/pipeline-template/nextflow.config#L211

@matrulda
Copy link
Contributor Author

Hmm, I think I'm gonna need help with this one. The interop package on PyPI does not have a source distribution, so I'm unsure how to properly set this up.

@alneberg Made me aware of the fact that conda skeleton pypi checkqc actually generates a template that uses interop instead of illumina-interop on this line:

- illumina-interop >=1.2.4
so perhaps that is the issue after all.

@cbrueffer
Copy link
Member

Hi @matrulda, you're right, illumina-interop doesn't install the Python bindings. I looked at this last year (#40431), but didn't finish it up. I'll look into this later today. The template using the name interop is just because that's the name of the Python module; the recipe name is irrelevant for the problem.

@matrulda
Copy link
Contributor Author

Ah great, thank you very much @cbrueffer 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants