giesselmann / STRique

Nanopore raw signal repeat detection pipeline
MIT License
45 stars 10 forks source link

Failed STRique test #34

Closed wormbro1 closed 1 year ago

wormbro1 commented 1 year ago

I am having some difficulty with the installation. Following the instructions for downloading via the command line (I'm using a mac), I get a series of deprecation warnings. For example, I will get:

      'PyThread_create_key' is deprecated [-Wdeprecated-declarations]

(See this file for entire output following attempted installation: STRique_download_output.txt)

When I try to run the test, it seems to work at first, but then ends up stopping (see this file for the output: STRique_test_output.txt ). Do you have any ideas for what the issue could be?

Thanks!

wormbro1 commented 1 year ago

Just an update @giesselmann, I saw that some packages were not the right versions, so I updated that. Here's the pip freeze:

cloudpickle==2.2.1
contourpy==1.0.7
cycler==0.11.0
Cython==0.29.33
decorator==5.1.1
ez-setup==0.9
fonttools==4.39.0
h5py==3.8.0
imageio==2.26.0
importlib-resources==5.12.0
joblib==1.2.0
kiwisolver==1.4.4
lazy_loader==0.1
matplotlib==3.7.1
networkx==1.11
numpy==1.24.2
ont-fast5-api @ file:///Users/jouyang3/src/STRique/submodules/ont_fast5_api
packaging==23.0
Pillow==9.4.0
pomegranate @ git+https://github.com/jmschrei/pomegranate.git@d57de976bbc52c70d83eac9cbf34bcfa6e5363fd
progressbar33==2.4
pyparsing==3.0.9
python-dateutil==2.8.2
PyWavelets==1.4.1
PyYAML==6.0
scikit-image==0.14.5
scipy==1.9.1
six==1.16.0
STRique==0.4.2
tifffile==2023.2.28
zipp==3.15.0

(inside pomegranate/init.py, it says: "version = '0.10.0'" , so it should be the right version)

However, when I run the test, it still has the same issues of working at first, and then failing. Here is the output:

Test GGCCCC repeat
Test repeat length: 100
Test repeat length: 200
Test repeat length: 300
.Test GCG repeat
Test repeat length: 100
Test repeat length: 200
Test repeat length: 300
.Test GGCCCC repeat
Test repeat length: 100
Test repeat length: 200
Test repeat length: 300
.Test normalization on short prefix/suffix sequences
Test repeat length: 10
Test repeat length: 20
Test repeat length: 30
Test repeat length: 40
Test repeat length: 50
Test repeat length: 60
Test repeat length: 70
Test repeat length: 80
Test repeat length: 90
.
----------------------------------------------------------------------
Ran 4 tests in 19.970s

OK
ID  target  strand  count   score_prefix    score_suffix    log_p   offset  ticks   mod
Traceback (most recent call last):
  File "scripts/STRique.py", line 1030, in <module>
    main()
  File "scripts/STRique.py", line 890, in __init__
    getattr(self, args.command)(sys.argv[2:])
  File "scripts/STRique.py", line 935, in count
    mt = mt_dispatcher(sam_queue, threads=args.t, worker_callables=[rd.detect], collector_callables=[ow.write_line])
  File "scripts/STRique.py", line 745, in __init__
    self.worker[-1].start()
  File "/Users/jouyang3/miniconda3/envs/py38/lib/python3.8/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/Users/jouyang3/miniconda3/envs/py38/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/Users/jouyang3/miniconda3/envs/py38/lib/python3.8/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/Users/jouyang3/miniconda3/envs/py38/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/Users/jouyang3/miniconda3/envs/py38/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/Users/jouyang3/miniconda3/envs/py38/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/Users/jouyang3/miniconda3/envs/py38/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle 'STRique_lib.pyseqan.align_raw' object

It has the error of not being able to pickle 'STRique_lib.pyseqan.align_raw' object. Do you know how that could be fixed?

Thanks!

giesselmann commented 1 year ago

Hi, seems to be a multiprocessing issue, different package similar error: https://stackoverflow.com/questions/71945399/python-3-8-multiprocessing-typeerror-cannot-pickle-weakref-object I have never tested with py3.8, can you by any chance use a virtual env. with python 3.6, looks like the multiprocessing module changed here. STRique won't get any further updates, I'm sorry that I won't be able to fix this for more recent versions of python. Hope this helps.

wormbro1 commented 1 year ago

I tried using py3.6 and updating the pomegranate version, but it gave the following error:

Collecting git+https://github.com/jmschrei/pomegranate.git@v0.10.0
  Cloning https://github.com/jmschrei/pomegranate.git (to revision v0.10.0) to /private/var/folders/_t/_csry_ws7cs3jbx0zr5jg8pr0000gn/T/pip-req-build-g9tnj3xe
  Running command git clone -q https://github.com/jmschrei/pomegranate.git /private/var/folders/_t/_csry_ws7cs3jbx0zr5jg8pr0000gn/T/pip-req-build-g9tnj3xe
  Running command git checkout -q 3164a88d8afcb6c220acee6c30f34631e2146f3f
Requirement already satisfied: numpy>=1.8.0 in /Users/jouyang3/miniconda3/envs/py36/lib/python3.6/site-packages (from pomegranate==0.10.0) (1.19.5)
Requirement already satisfied: joblib>=0.9.0b4 in /Users/jouyang3/miniconda3/envs/py36/lib/python3.6/site-packages (from pomegranate==0.10.0) (1.2.0)
ERROR: Package 'joblib' requires a different Python: 3.6.15 not in '>=3.7'

I then decided to try installing everything with Py3.7, and everything worked! The test was successful. Thanks for the help!