smshuai / DriverPower

DriverPower
GNU General Public License v3.0
25 stars 4 forks source link

package incompatibilities #15

Open t-silvers opened 4 years ago

t-silvers commented 4 years ago

Hi, I'm running into package incompatibilities when running your setup. See below for environment script and error messages.

Script (dp.yml):

name: dp
channels:
  - conda-forge
  - bioconda
  - defaults
dependencies:
  - pytables
  - xgboost
  - pybedtools
  - pip:
    - driverpower
$ conda env create -f dp.yml
Collecting package metadata (repodata.json): done
Solving environment: done

Downloading and Extracting Packages
scipy-1.4.1          | 18.9 MB   | ##################################################################################################################################################################################################################################### | 100%
mock-3.0.5           | 44 KB     | ##################################################################################################################################################################################################################################### | 100%
python-dateutil-2.8. | 220 KB    | ##################################################################################################################################################################################################################################### | 100%
pytables-3.6.1       | 1.5 MB    | ##################################################################################################################################################################################################################################### | 100%
python-3.7.6         | 52.9 MB   | ##################################################################################################################################################################################################################################### | 100%
setuptools-46.1.3    | 634 KB    | ##################################################################################################################################################################################################################################### | 100%
xgboost-1.0.2        | 11 KB     | ##################################################################################################################################################################################################################################### | 100%
blosc-1.18.1         | 893 KB    | ##################################################################################################################################################################################################################################### | 100%
python_abi-3.7       | 4 KB      | ##################################################################################################################################################################################################################################### | 100%
hdf5-1.10.5          | 3.1 MB    | ##################################################################################################################################################################################################################################### | 100%
libcurl-7.69.1       | 573 KB    | ##################################################################################################################################################################################################################################### | 100%
certifi-2020.4.5.1   | 151 KB    | ##################################################################################################################################################################################################################################### | 100%
py-xgboost-1.0.2     | 94 KB     | ##################################################################################################################################################################################################################################### | 100%
numpy-1.18.1         | 5.2 MB    | ##################################################################################################################################################################################################################################### | 100%
pybedtools-0.8.1     | 12.1 MB   | ##################################################################################################################################################################################################################################### | 100%
curl-7.69.1          | 137 KB    | ##################################################################################################################################################################################################################################### | 100%
numexpr-2.7.1        | 197 KB    | ##################################################################################################################################################################################################################################### | 100%
pysam-0.15.4         | 2.6 MB    | ##################################################################################################################################################################################################################################### | 100%
pandas-1.0.3         | 11.1 MB   | ##################################################################################################################################################################################################################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Ran pip subprocess with arguments:
['./envs/dp3/bin/python', '-m', 'pip', 'install', '-U', '-r', './envs/condaenv.4fuvbm5n.requirements.txt']
Pip subprocess output:
Collecting driverpower
  Using cached DriverPower-1.0.2-py3-none-any.whl (14 kB)
Requirement already satisfied, skipping upgrade: pandas>=0.18.1 in ./envs/dp3/lib/python3.7/site-packages (from driverpower->-r ./envs/condaenv.4fuvbm5n.requirement
s.txt (line 1)) (1.0.3)
Collecting statsmodels>=0.6.1
  Using cached statsmodels-0.11.1-cp37-cp37m-manylinux1_x86_64.whl (8.7 MB)
Requirement already satisfied, skipping upgrade: scikit-learn>=0.18 in ./envs/dp3/lib/python3.7/site-packages (from driverpower->-r ./envs/condaenv.4fuvbm5n.require
ments.txt (line 1)) (0.22.2.post1)
Requirement already satisfied, skipping upgrade: scipy>=0.18.1 in ./envs/dp3/lib/python3.7/site-packages (from driverpower->-r ./envs/condaenv.4fuvbm5n.requirements
.txt (line 1)) (1.4.1)
Collecting xgboost>=0.6a
  Using cached xgboost-1.0.2-py3-none-manylinux1_x86_64.whl (109.7 MB)

Pip subprocess error:
ERROR: Could not find a version that satisfies the requirement pytables>=3.4.4 (from driverpower->-r ./envs/condaenv.4fuvbm5n.requirements.txt (line 1)) (from versions: none)
ERROR: No matching distribution found for pytables>=3.4.4 (from driverpower->-r ./envs/condaenv.4fuvbm5n.requirements.txt (line 1))
t-silvers commented 4 years ago

For now, I've installed minus setup install_requires and found one problem so far. linear_model.RandomizedLasso was deprecated in scikit-learn=0.19.2 and removed in the current release. https://scikit-learn.org/stable/whats_new/v0.19.html

andreyurch commented 4 years ago

I have the same problem with pytables.

pip install driverpower --user Collecting driverpower Using cached DriverPower-1.0.2-py3-none-any.whl (14 kB) Requirement already satisfied: pybedtools>=0.7.10 in /mnt/beegfs/userdata/a_iurchenko/APP/anaconda3/lib/python3.7/site-packages (from driverpower) (0.8.1) Requirement already satisfied: scikit-learn>=0.18 in /mnt/beegfs/userdata/a_iurchenko/APP/anaconda3/lib/python3.7/site-packages (from driverpower) (0.22.1) Requirement already satisfied: scipy>=0.18.1 in /mnt/beegfs/userdata/a_iurchenko/APP/anaconda3/lib/python3.7/site-packages (from driverpower) (1.4.1) Collecting xgboost>=0.6a Downloading xgboost-1.0.2-py3-none-manylinux1_x86_64.whl (109.7 MB) |████████████████████████████████| 109.7 MB 10 kB/s Requirement already satisfied: statsmodels>=0.6.1 in /mnt/beegfs/userdata/a_iurchenko/APP/anaconda3/lib/python3.7/site-packages (from driverpower) (0.11.0) ERROR: Could not find a version that satisfies the requirement pytables>=3.4.4 (from driverpower) (from versions: none) ERROR: No matching distribution found for pytables>=3.4.4 (from driverpower)

smshuai commented 4 years ago

Thank you both so much for pointing these out! I guess a lot of packages have been updated over the past two years. I will look into them asap.

t-silvers commented 4 years ago

Great!

The Infer driver candidates test run is also raising errors. I've debugged RandomizedLasso and successfully trained models per tutorial. When I run Step 4 though, I get this common, but hard to interpret here, XGBoost error.

$ driverpower infer \
  --feature test_feature.hdf5 \
  --response test_y.tsv \
  --model ./output/tutorial.GBM.model.pkl \
  --name 'DriverPower_burden' \
  --outDir ./output/

04/14/2020 13:07:16 | INFO: Welcome to DriverPower v1.0.2
Traceback (most recent call last):
  File "./bin/driverpower", line 8, in <module>
    sys.exit(main())
  File "./lib/python3.6/site-packages/driverpower/interface.py", line 147, in main
    out_dir=args.out_dir)
  File "./lib/python3.6/site-packages/driverpower/infer.py", line 49, in make_inference
    model = read_model(model_path)
  File "./lib/python3.6/site-packages/driverpower/dataIO.py", line 176, in read_model
    model = pickle.load(f)
  File "./lib/python3.6/site-packages/xgboost/core.py", line 678, in __setstate__
    _check_call(_LIB.XGBoosterLoadModelFromBuffer(handle, ptr, length))
  File "./lib/python3.6/site-packages/xgboost/core.py", line 127, in _check_call
    raise XGBoostError(_LIB.XGBGetLastError())
xgboost.core.XGBoostError: b'Required parameter max_delta_step of float is not presented'
Exception ignored in: <bound method Booster.__del__ of <xgboost.core.Booster object at 0x7f2d69222710>>
Traceback (most recent call last):
  File "./lib/python3.6/site-packages/xgboost/core.py", line 656, in __del__
    _LIB.XGBoosterFree(self.handle)
AttributeError: 'Booster' object has no attribute 'handle'

It's difficult to diagnose this bug given setup issues, but nevertheless you may want to look into this too.

smshuai commented 4 years ago

Sorry for the delay. I have found a solution to the incompatibility issue. The issue is caused by a mixture use of pip and conda, thus I have moved the pkg to Anaconda Cloud for linux-64 and osx-64. In addition, to solve the sklearn issue, I set the requirement to version 0.19.2 for now.

To install the software properly with conda:

# Setup Bioconda Channels if not set before
# https://bioconda.github.io/user/install.html#set-up-channels
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge

# Create env and install DriverPower
conda create -n dp
conda activate dp
conda install -c smshuai driverpower

I will update the documentation shortly.

Amanda2018genetics commented 4 years ago

Hi shimin, There is still a error when using pip install driverpower like the previous posted one ERROR: Could not find a version that satisfies the requirement pytables>=3.4.4 (from driverpower) (from versions: none) ERROR: No matching distribution found for pytables>=3.4.4 (from driverpower)

The requirement version on my computer are as follows: PyTables version: 3.6.1 HDF5 version: 1.10.4 NumPy version: 1.16.5 Numexpr version: 2.7.1 (not using Intel's VML/MKL) Zlib version: 1.2.7 (in Python interpreter) LZO version: 2.09 (Feb 04 2015) BZIP2 version: 1.0.6 (6-Sept-2010) Blosc version: 1.16.3 (2019-03-08) Blosc compressors: blosclz (1.1.0), lz4 (1.8.3), lz4hc (1.8.3), snappy (1.1.1), zlib (1.2.8), zstd (1.3.8) Blosc filters: shuffle, bitshuffle Python version: 3.7.4 (default, Sep 11 2019, 11:24:51) [GCC 6.2.0]

I am wondering if I can install it except for using conda ? Thank you.

Best, Yao

smshuai commented 4 years ago

Hi @Amanda2018genetics,

I just realized the pytables package has different names in conda (pytables) and pip (tables). I will check if this fixes the problem and let you know asap!

Hi shimin, There is still a error when using pip install driverpower like the previous posted one ERROR: Could not find a version that satisfies the requirement pytables>=3.4.4 (from driverpower) (from versions: none) ERROR: No matching distribution found for pytables>=3.4.4 (from driverpower)

The requirement version on my computer are as follows: PyTables version: 3.6.1 HDF5 version: 1.10.4 NumPy version: 1.16.5 Numexpr version: 2.7.1 (not using Intel's VML/MKL) Zlib version: 1.2.7 (in Python interpreter) LZO version: 2.09 (Feb 04 2015) BZIP2 version: 1.0.6 (6-Sept-2010) Blosc version: 1.16.3 (2019-03-08) Blosc compressors: blosclz (1.1.0), lz4 (1.8.3), lz4hc (1.8.3), snappy (1.1.1), zlib (1.2.8), zstd (1.3.8) Blosc filters: shuffle, bitshuffle Python version: 3.7.4 (default, Sep 11 2019, 11:24:51) [GCC 6.2.0]

I am wondering if I can install it except for using conda ? Thank you.

Best, Yao

smshuai commented 4 years ago

Hi @Amanda2018genetics,

Here is a way to install driverpower without conda:

git clone https://github.com/smshuai/DriverPower.git
cd driverpower
pip install .

Cheers, Shimin

Amanda2018genetics commented 4 years ago

Hi @Amanda2018genetics,

Here is a way to install driverpower without conda:

git clone https://github.com/smshuai/DriverPower.git
cd driverpower
pip install .

Cheers, Shimin

Hi shimin, Thanks for replying! You fixed it so fast! I can drive my data now using the power~~ Best, Yao