genomelake icon indicating copy to clipboard operation
genomelake copied to clipboard

Add support for Python 3.7

Open mmtrebuchet opened this issue 5 years ago • 6 comments

genomelake lists itself as compatible with python 3.6, and this makes it the only package in basepair's conda environment that prevents me from using python 3.7 and its coroutine goodness. Unless genomelake is somehow incompatible with python 3.7, it should be a simple matter of changing setup.py, I believe.

mmtrebuchet avatar Aug 08 '19 18:08 mmtrebuchet

What error message are you getting on python 3.7?

Avsecz avatar Aug 08 '19 18:08 Avsecz

If I set the python version in conda-env-cpu.yml to python=3.7, then the solve fails to generate an environment, with a spew of version requirements. If I comment out genomelake, then the build succeeds. If I move genomelake to the pip: section, then I get a bunch of compiler errors about structs and such at the C level.

mmtrebuchet avatar Aug 08 '19 19:08 mmtrebuchet

I see. You could install cython, pybigwig, pysam, bcolz and bedtools from conda and then genomelake from pip:

name: env
channels:
- bioconda
- conda-forge
- defaults
dependencies:
- python=3.7
- pybedtools>=0.7.10
- bedtools>=2.27.1
- pybigwig>=0.3.10
- bcolz>=1.1
- pysam>=0.14.0
- cython
- pip
- pip:
  - genomelake

Also, you have to make sure that your machine has the build tools installed. Run sudo apt-get install build-essential if you are using ubuntu.

Avsecz avatar Aug 09 '19 14:08 Avsecz

I'm not getting the pip change to build successfully for bpnet. conda env create -f conda-env.yml -p /dev/shm/cm2363/conda 2>&1 | tee log.txt log.txt


name: bpnet
channels:
- bioconda
- pytorch
- conda-forge
- defaults
dependencies:
- python=3.7

# genomics
- pybedtools>=0.7.10
- bedtools>=2.27.1
- pybigwig>=0.3.10
- pysam>=0.14.0

- pytorch  # optional for data-loading
- cython
- h5py>=2.7.0
- numpy

- pandas>=0.23.0
- fastparquet
- python-snappy

- nb_conda
- pip
- pip:
  - genomelake>=0.1.4
  - git+https://github.com/kundajelab/DeepExplain.git

  # ML & numerics
  - tensorflow>=1.7  # tensorflow-gpu==1.7 for gpu

  # bpnet package
  - .[dev,extras]  # install the local basepair package. All the other required pip packages are specified in the setup.py

mmtrebuchet avatar Aug 14 '19 20:08 mmtrebuchet

On some further investigating, it looks like the util.c file that is generated by cython was uploaded to PyPI, even though it is generated by the setup.py script in Genomelake. It should be a matter of rebuilding genomelake (in a python 3.7 environment) and then uploading the result to PyPI. I'm not familiar with how Python package management works, sadly, so I'm not sure what the exact sequence of commands will be. The issue seems to date from 2017, and it looks like Cython has since been fixed. cython/cython/issues/1955

mmtrebuchet avatar Aug 16 '19 20:08 mmtrebuchet

Hm. I think the best would be to distribute the package with wheel - https://pythonwheels.com. Let me finish submitting the manuscript first:)

Avsecz avatar Aug 16 '19 20:08 Avsecz