MiraldiLab / maxATAC

Transcription Factor Binding Prediction from ATAC-seq and scATAC-seq with Deep Neural Networks
Apache License 2.0
25 stars 8 forks source link

Installation errors when using Anaconda and maxATAC TensorFlow2.5 #47

Closed tacazares closed 2 years ago

tacazares commented 3 years ago

I ran into some installation issues when I tried to install the new tensorflow 2.5 updated maxATAC on OSC and BMI. I started on both systems by loading anaconda.

I then created a new anaconda environment for maxatac: conda create -n maxatac_tf2 python=3.9

Then I installed the maxatac git project using: pip install -e .

When I ran maxatac I had the following error:

(maxatac_tf2) bash-4.2$ maxatac
Traceback (most recent call last):
  File "/users/caz3so/.conda/envs/maxatac_tf2/bin/maxatac", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/users/caz3so/repo/miraldilab/maxATAC/maxatac/bin/maxatac", line 7, in <module>
    from maxatac.utilities.parser import parse_arguments, print_args
  File "/users/caz3so/repo/miraldilab/maxATAC/maxatac/utilities/parser.py", line 5, in <module>
    from yaml import dump
ModuleNotFoundError: No module named 'yaml'

I fixed this issue with: pip install pyyaml

I then had a new bug based on the sklearn:

(maxatac_tf2) bash-4.2$ maxatac
Traceback (most recent call last):
  File "/users/caz3so/.conda/envs/maxatac_tf2/bin/maxatac", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/users/caz3so/repo/miraldilab/maxATAC/maxatac/bin/maxatac", line 7, in <module>
    from maxatac.utilities.parser import parse_arguments, print_args
  File "/users/caz3so/repo/miraldilab/maxATAC/maxatac/utilities/parser.py", line 25, in <module>
    from maxatac.analyses.interpret import run_interpretation
  File "/users/caz3so/repo/miraldilab/maxATAC/maxatac/analyses/interpret.py", line 6, in <module>
    import modisco
  File "/users/caz3so/.conda/envs/maxatac_tf2/lib/python3.9/site-packages/modisco/__init__.py", line 2, in <module>
    from . import aggregator
  File "/users/caz3so/.conda/envs/maxatac_tf2/lib/python3.9/site-packages/modisco/aggregator.py", line 3, in <module>
    from . import affinitymat
  File "/users/caz3so/.conda/envs/maxatac_tf2/lib/python3.9/site-packages/modisco/affinitymat/__init__.py", line 2, in <module>
    from .core import *
  File "/users/caz3so/.conda/envs/maxatac_tf2/lib/python3.9/site-packages/modisco/affinitymat/core.py", line 4, in <module>
    from .. import util as modiscoutil
  File "/users/caz3so/.conda/envs/maxatac_tf2/lib/python3.9/site-packages/modisco/util.py", line 8, in <module>
    from sklearn.neighbors.kde import KernelDensity
ModuleNotFoundError: No module named 'sklearn.neighbors.kde'

I fixed this error by opening the file /users/caz3so/.conda/envs/maxatac_tf2/lib/python3.9/site-packages/modisco/util.py and changing from sklearn.neighbors.kde import KernelDensity to from sklearn.neighbors import KernelDensity.

I also had to do this for the file /users/caz3so/.conda/envs/maxatac_tf2/lib/python3.9/site-packages/modisco/coordproducers.py.

These changes fixed the errors that I was having, but they might have negatively impacted interpretation which uses the modisco package. We need to test interpretation now that we have updated the code base.

dlab-arp commented 3 years ago

I ran into a plethora of strange issues when creating an environment on the OSC cluster for Tensorflow 2.5 Issues included, htslib error while installing pysam. Numpy errors while installing pybigwig. After lot of attempts, I was finally able to create the desired env. I am attaching a text file indicating the steps I took to resolve the issues. In general, whenever a package gave me error while installing via pip. The solution was to install the package first using conda before installing any other packages. For details please see the text file

OSC_Steps_for_TF2_env.txt