WGLab / RepeatHMM

a hidden Markov model to infer simple repeats from genome sequences
Other
34 stars 14 forks source link

AttributeError: symbol not found with dlsym (miniconda3) #46

Open fabienkst opened 2 years ago

fabienkst commented 2 years ago

Hello !

I have some issues installing the RepeatHMM script. At first I had trouble creating the conda environment. When I first tried, it stated that multiple packages couldn't be found:


ResolvePackageNotFound: 
  - reportlab==3.5.42=py27heca39a3_0
  - libgcc==7.2.0=h69d50b8_2
  - libffi==3.3=he6710b0_1
  - freetype==2.10.2=he06d7ca_0
  - sqlite==3.31.1=h62c20be_1
  - make==4.2.1=h1bed415_1
  - swig==3.0.12=h38cdd7d_3
  - readline==8.0=h7b6447c_0
  - libgcc-ng==9.1.0=hdf63c60_0
  - libgfortran-ng==7.3.0=hdf63c60_0
  - python_abi==2.7=1_cp27mu
  - ncurses==6.2=he6710b0_1
  - zstd==1.4.4=h6597ccf_3
  - hmmlearn==0.2.1=py27h3010b51_1000
  - libedit==3.1.20181209=hc058e9b_0
  - libtiff==4.1.0=hc7e4089_6
  - libstdcxx-ng==9.1.0=hdf63c60_0
  - python==2.7.18=h15b4118_1
  - perl==5.26.2=h14c3975_0
  - pillow==5.3.0=py27h00a061d_1000
  - zlib==1.2.11=h7b6447c_3
  - scipy==1.1.0=py27hd20e5f9_0
  - msgpack-python==1.0.0=py27h9e3301b_1
  - scikit-learn==0.19.2=py27h4989274_0
  - bwa==0.7.17=hed695b0_7
  - intel-openmp==2020.1=217
  - jpeg==9d=h516909a_0
  - tk==8.6.8=hbc83047_0
  - bzip2==1.0.8=h7b6447c_0
  - numpy==1.12.1=py27h9378851_1
  - libwebp-base==1.1.0=h516909a_3
  - libpng==1.6.37=hed695b0_1
  - pcre==8.43=he6710b0_0
  - xz==5.2.5=h7b6447c_0
  - lz4-c==1.9.2=he1b5a44_1

Then I tried bypassing these packages by first creating the conda env without them, and adding them afterwards It worked fine until I tried to run the py file (python bin/repeatHMM.py). Now, it states this error:


Traceback (most recent call last):
  File "bin/repeatHMM.py", line 18, in <module>
    from RepeatHMM_scripts import myBAMhandler
  File "/Users/fabien/tools/RepeatHMM/bin/RepeatHMM_scripts/myBAMhandler.py", line 25, in <module>
    from . import myHMM
  File "/Users/fabien/tools/RepeatHMM/bin/RepeatHMM_scripts/myHMM.py", line 5, in <module>
    from hmmlearn import hmm
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/hmmlearn/hmm.py", line 15, in <module>
    from sklearn import cluster
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/sklearn/__init__.py", line 64, in <module>
    from .base import clone
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/sklearn/base.py", line 14, in <module>
    from .utils.fixes import signature
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/sklearn/utils/__init__.py", line 14, in <module>
    from . import _joblib
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/sklearn/utils/_joblib.py", line 22, in <module>
    from ..externals import joblib
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/sklearn/externals/joblib/__init__.py", line 119, in <module>
    from .parallel import Parallel
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/sklearn/externals/joblib/parallel.py", line 28, in <module>
    from ._parallel_backends import (FallbackToBackend, MultiprocessingBackend,
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/sklearn/externals/joblib/_parallel_backends.py", line 22, in <module>
    from .executor import get_memmapping_executor
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/sklearn/externals/joblib/executor.py", line 14, in <module>
    from .externals.loky.reusable_executor import get_reusable_executor
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/sklearn/externals/joblib/externals/loky/__init__.py", line 11, in <module>
    from .backend.context import cpu_count
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/sklearn/externals/joblib/externals/loky/backend/__init__.py", line 4, in <module>
    from .context import get_context
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/sklearn/externals/joblib/externals/loky/backend/context.py", line 21, in <module>
    from .process import LokyProcess, LokyInitMainProcess
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/sklearn/externals/joblib/externals/loky/backend/process.py", line 11, in <module>
    from .compat import BaseProcess
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/sklearn/externals/joblib/externals/loky/backend/compat.py", line 25, in <module>
    from .compat_posix import wait
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/sklearn/externals/joblib/externals/loky/backend/compat_posix.py", line 11, in <module>
    from ._posix_wait import wait
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/sklearn/externals/joblib/externals/loky/backend/_posix_wait.py", line 28, in <module>
    absolute_to_nanoseconds = CoreServices.AbsoluteToNanoseconds
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/ctypes/__init__.py", line 379, in __getattr__
    func = self.__getitem__(name)
  File "/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/ctypes/__init__.py", line 384, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(RTLD_DEFAULT, AbsoluteToNanoseconds): symbol not found

If anyone has an idea on how to fix this, that would be really helpful :)

liuqianhn commented 2 years ago

@fabienkst Not sure why. But when I search this issue online, it seems that there is an issue with conda. The solution in https://github.com/conda/conda/issues/10361#issuecomment-731085866 works for some people.

fabienkst commented 2 years ago

Hello again !

Thank you @liuqianhn for your answer. I followed the instructions with the link that you provided, and it works now.

Now, I have another question, but regarding the usage of RepeatHMM.

When I use the BAMinput way, one of the required parameters is obviously the hg file. However, it seems that on my computer, it says that there is no pa file:

python bin/repeatHMM.py BAMinput --Onebamfile /Volumes/data/MinION/DPNNI/DPNNI_2022/FRAXA/Famille_704/CAS9_704-DIA1_202110291700/Longshot_WH_704-DIA1/704-DIA1.phased.bam --repeatName FMR1 --hgfile ../hg19.fa 

('No pa file ', '/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/RepeatHMM/reference_sts//hg38/hg38.predefined.pa')

As you can see on this code chunk, it states that there is no pa file for hg38, even though I ask to use the hg19 file.

Is it an issue with my installation, or something else ?

Furthermore, when I try to find the pa file, I can't find it with the mentionned path:

 '/Users/fabien/miniconda3/envs/repeathmmenv/lib/python2.7/site-packages/RepeatHMM/reference_sts//hg38/hg38.predefined.pa'

Instead, I find it here:


/Users/fabien/tools/RepeatHMM/bin/reference_sts/hg38/hg38.predefined.pa

I wonder if it's normal ?

liuqianhn commented 2 years ago

@fabienkst I am glad that the instructions can solve the issue. Thank you for update.

Regarding PA file, there is a default setting (--hg) for the default pa file. But if you specify your own repeat information using --UserDefinedRepeat, this has no effect on the results. To avoid this issue, you can use --Patternfile /Users/fabien/tools/RepeatHMM/bin/reference_sts/hg38/hg38.predefined.pa or --Patternfile /Users/fabien/tools/RepeatHMM/bin/reference_sts/hg19/hg19.predefined.pa (please make sure hg19.predefined.pa exists).

Please note that there will be issues ONLY IF you use the predefined repeats in pa file.