zanglab / bart2

bart2 package
BSD 3-Clause "New" or "Revised" License
8 stars 3 forks source link

Unable to run commandline version of Bart2 #8

Open ReneRanzinger opened 3 months ago

ReneRanzinger commented 3 months ago

When running the program I am getting

> bart2 geneset -i hg38_example.genelist.txt -s hg38 --outdir bart2_output
/usr/bin/bart2:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __import__('pkg_resources').run_script('bart2==2.1', 'bart2')
Traceback (most recent call last):
  File "/usr/bin/bart2", line 4, in <module>
    __import__('pkg_resources').run_script('bart2==2.1', 'bart2')
  File "/usr/lib/python3.12/site-packages/pkg_resources/__init__.py", line 691, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3.12/site-packages/pkg_resources/__init__.py", line 1530, in run_script
    exec(code, namespace, namespace)
  File "/usr/lib/python3.12/site-packages/bart2-2.1-py3.12.egg/EGG-INFO/scripts/bart2", line 26, in <module>
    from bart2.main import bart
  File "/usr/lib/python3.12/site-packages/bart2-2.1-py3.12.egg/bart2/main.py", line 7, in <module>
    from bart2 import OptValidator, ReadCount, RPRegress, EnhancerIdentifier, AUCcalc, StatTest, score_on_UDHS, WriteFile
  File "/usr/lib/python3.12/site-packages/bart2-2.1-py3.12.egg/bart2/RPRegress.py", line 6, in <module>
    import tables
  File "/usr/lib/python3.12/site-packages/tables-3.9.2-py3.12-linux-x86_64.egg/tables/__init__.py", line 44, in <module>
    from .utilsextension import get_hdf5_version as _get_hdf5_version
  File "tables/utilsextension.pyx", line 1, in init tables.utilsextension
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

Installation and run

Setup conda environment:

conda create -n bart_env312 python numpy pandas scipy tables scikit-learn matplotlib
conda activate bart_env312
mkdir -p /mnt/sda2/Manjaro/bart2/python3.12/site-packages
export PYTHONPATH=/mnt/sda2/Manjaro/bart2/python3.12/site-packages/:$PYTHONPATH 
python setup.py install --prefix /mnt/sda2/Manjaro/bart2/python3.12/site-packages

There seems to be no error during installation: setup_output.txt

After this I run the command above with the example file from the webpage.

marvinquiet commented 3 months ago

Dear @ReneRanzinger,

Sorry for the late reply and thank you for your interest in our pipeline. We do notice that our web version has been down for a while and we were trying to bring it back, however, it takes longer time than we expected. We will try our best to bring it back ASAP.

As for the problem you encountered when running bart2, I believe it is the version incompatibility. Since bart2 was built in 2019, we used a lower version of numpy. I found this answer might be helpful: https://stackoverflow.com/questions/40845304/runtimewarning-numpy-dtype-size-changed-may-indicate-binary-incompatibility. Would you mind trying it out?

Sorry for the inconvenience.

Sincerely, Wenjing

ReneRanzinger commented 3 months ago

@marvinquiet thank you for your response. I tried to follow the instructions on the stackoverflow but that will install a even newer version of numpy (2.0.1). For the dependencies list in the README.md

setuptools
numpy
pandas
scipy
tables
scikit-learn
matplotlib

can you please add the recommended version numbers? I think I can force configure the anaconda environment with these versions. But since there are inter-dependencies between the different python libraries it would be hard to find a numpy version AND the corresponding versions of the other packages.