PharmGKB / PharmCAT

The Pharmacogenomic Clinical Annotation Tool
Mozilla Public License 2.0
120 stars 39 forks source link

VCF preprocessor not working in docker #97

Closed pjvolders closed 1 year ago

pjvolders commented 2 years ago

Bug

The VCF preprocessor script crashes when executed from the docker container. I have tried using the latest public docker image and building a new docker image from the main branch in the GitHub repository

Traceback (most recent call last):
  File "/pharmcat/./PharmCAT_VCF_Preprocess.py", line 219, in <module>
    run(args)
  File "/pharmcat/./PharmCAT_VCF_Preprocess.py", line 141, in run
    vcf_pgx_regions = util.extract_regions_from_single_file(bcftools_path, tabix_path, input_vcf,
  File "/pharmcat/vcf_preprocess_utilities.py", line 241, in extract_regions_from_single_file
    df_ref_pgx_pos = allel.vcf_to_dataframe(pgx_vcf)
  File "/usr/local/lib/python3.10/site-packages/allel/io/vcf_read.py", line 1842, in vcf_to_dataframe
    import pandas
  File "/usr/local/lib/python3.10/site-packages/pandas/__init__.py", line 29, in <module>
    from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
  File "/usr/local/lib/python3.10/site-packages/pandas/_libs/__init__.py", line 13, in <module>
    from pandas._libs.interval import Interval
  File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
docker run --rm -v "$PWD":/pharmcat/data pgkb/pharmcat python3 ./PharmCAT_VCF_Preprocess.py --input_vcf data/output.fixed.vcf.gz

(Note: I am using python3 ./PharmCAT_VCF_Preprocess.py here because the python file is not executable in the current public docker container)

pjvolders commented 2 years ago

Update: I managed to get it running by changing the first line of the Dockerfile to

FROM python:3.9
markwoon commented 2 years ago

This has been fixed in the development branch.

We'll push out a new release soon.

BinglanLi commented 2 years ago

I should also test and update the compatibility between different version of numpy and python3.

markwoon commented 1 year ago

Fixed in latest relase.