sjroth / ARTDeco

MIT License
15 stars 7 forks source link

Preprocessing troubles: Library not loaded: @rpath/libgfortran.3.dylib #22

Closed faleevz closed 3 months ago

faleevz commented 4 months ago

Hi there, I am trying to run the ARDeco preprocessing.

conda env create -f environment.yml
python setup.py install
gtf2bed < genes.gtf ##no error
ARTDeco -mode preprocess -gtf-file /Users/faleevamaria/Desktop/ARTDeco-master/modified_genes.gtf -chrom-sizes-file /Users/faleevamaria/Desktop/ARTDeco-master/hg38.chrom.sizes [-home-dir /Users/faleevamaria/Desktop/ARTDeco-master -bam-files-dir /Users/faleevamaria/Desktop/ARTDeco-master/bam -cpu 1 -read-in-dist 1000 -readthrough-dist 500 -intergenic-min-len 100 -intergenic-max-len 15000 -meta-file /Users/faleevamaria/Desktop/ARTDeco-master/SampleInputs/meta.txt -comparisons-file /Users/faleevamaria/Desktop/ARTDeco-master/SampleInputs/comparisons.txt]

The error code I get is this

Running preprocess mode...
Loading ARTDeco file structure...
/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/python3.6/site-packages/rpy2/rinterface/__init__.py:146: RRuntimeWarning: Error: package or namespace load failed for ‘S4Vectors’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/R/library/S4Vectors/libs/S4Vectors.so':
  dlopen(/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/R/library/S4Vectors/libs/S4Vectors.so, 0x0006): Library not loaded: @rpath/libgfortran.3.dylib
  Referenced from: <A65EB851-359E-3D11-B416-A9D3DB6E821B> /Users/faleevamaria/anaconda3/envs/ARTDeco/lib/R/library/S4Vectors/libs/S4Vectors.so
  Reason: tried: '/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/libgfortran.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/libgfortran.3.dylib' (no such file), '/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/R/library/S4Vectors/libs/../../../../libgfortran.3.dylib' (no such file), '/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/libgfortran.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/libgfortran.3.dylib' (no such file), '/Users/faleevamaria/anaconda3/envs/A

  warnings.warn(x, RRuntimeWarning)
/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/python3.6/site-packages/rpy2/rinterface/__init__.py:146: RRuntimeWarning: Failed with error:  
  warnings.warn(x, RRuntimeWarning)
/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/python3.6/site-packages/rpy2/rinterface/__init__.py:146: RRuntimeWarning: 
  warnings.warn(x, RRuntimeWarning)
/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/python3.6/site-packages/rpy2/rinterface/__init__.py:146: RRuntimeWarning: ‘package ‘S4Vectors’ could not be loaded’
  warnings.warn(x, RRuntimeWarning)
/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/python3.6/site-packages/rpy2/rinterface/__init__.py:146: RRuntimeWarning: 

  warnings.warn(x, RRuntimeWarning)
/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/python3.6/site-packages/rpy2/rinterface/__init__.py:146: RRuntimeWarning: Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/R/library/BiocParallel/libs/BiocParallel.so':
  dlopen(/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/R/library/BiocParallel/libs/BiocParallel.so, 0x0006): Library not loaded: @rpath/libgfortran.3.dylib
  Referenced from: <6A0854F2-CC6F-3559-B768-32A5874BAF31> /Users/faleevamaria/anaconda3/envs/ARTDeco/lib/R/library/BiocParallel/libs/BiocParallel.so
  Reason: tried: '/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/libgfortran.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/libgfortran.3.dylib' (no such file), '/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/R/library/BiocParallel/libs/../../../../libgfortran.3.dylib' (no such file), '/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/libgfortran.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/libgfortran.3.dylib' (no such file), '/Users

  warnings.warn(x, RRuntimeWarning)
Traceback (most recent call last):
  File "/Users/faleevamaria/anaconda3/envs/ARTDeco/bin/ARTDeco", line 33, in <module>
    sys.exit(load_entry_point('ARTDeco==0.4', 'console_scripts', 'ARTDeco')())
  File "/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/python3.6/site-packages/ARTDeco-0.4-py3.6.egg/ARTDeco/main.py", line 115, in main
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/python3.6/site-packages/ARTDeco-0.4-py3.6.egg/ARTDeco/DESeq2.py", line 12, in <module>
  File "/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/python3.6/site-packages/rpy2/robjects/packages.py", line 453, in importr
    env = _get_namespace(rname)
rpy2.rinterface.RRuntimeError: Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/R/library/BiocParallel/libs/BiocParallel.so':
  dlopen(/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/R/library/BiocParallel/libs/BiocParallel.so, 0x0006): Library not loaded: @rpath/libgfortran.3.dylib
  Referenced from: <6A0854F2-CC6F-3559-B768-32A5874BAF31> /Users/faleevamaria/anaconda3/envs/ARTDeco/lib/R/library/BiocParallel/libs/BiocParallel.so
  Reason: tried: '/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/libgfortran.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/libgfortran.3.dylib' (no such file), '/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/R/library/BiocParallel/libs/../../../../libgfortran.3.dylib' (no such file), '/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/libgfortran.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/faleevamaria/anaconda3/envs/ARTDeco/lib/libgfortran.3.dylib' (no such file), '/Users

I have tried to debug it, but I cannot seem to download libgfortran.3? Any advice would be extremely appreciated!

sjroth commented 4 months ago

Without access to your system, it is hard to debug what is going on. This has to do with DESeq2 not being properly installed. Can you access an active shell in R and try to install DESeq2 via R?

faleevz commented 4 months ago

I tried to re-install DEseq2 via R in the ARTDeco environment but unfortunately the run failed.

I created a new environment and manually installed all the necessary packages via conda apart from DESeq2 (which was installed via R). All ok.

I then went to re-install ARTDeco, all ok here too.

python -m pip install .
Successfully built ARTDeco
Installing collected packages: ARTDeco
Successfully installed ARTDeco-0.4

However, when I try to run anything , such as ARTDeco -h I get the following:

(py38) MA57747:artdeco-master faleevamaria$ artdeco -h
Traceback (most recent call last):
  File "/Users/faleevamaria/anaconda3/envs/py38/bin/artdeco", line 5, in <module>
    from ARTDeco.main import main
  File "/Users/faleevamaria/anaconda3/envs/py38/lib/python3.8/site-packages/ARTDeco/main.py", line 4, in <module>
    from .misc import ARTDecoDir,infer_experiments_group,output_inferred_format,summarize_bam_files,get_regions_exp
  File "/Users/faleevamaria/anaconda3/envs/py38/lib/python3.8/site-packages/ARTDeco/misc.py", line 5, in <module>
    import networkx as nx
  File "/Users/faleevamaria/anaconda3/envs/py38/lib/python3.8/site-packages/networkx-3.2.1-py3.8.egg/networkx/__init__.py", line 35, in <module>
    from networkx import generators
  File "/Users/faleevamaria/anaconda3/envs/py38/lib/python3.8/site-packages/networkx-3.2.1-py3.8.egg/networkx/generators/__init__.py", line 5, in <module>
    from networkx.generators.atlas import *
  File "/Users/faleevamaria/anaconda3/envs/py38/lib/python3.8/site-packages/networkx-3.2.1-py3.8.egg/networkx/generators/atlas.py", line 54, in <module>
    ATLAS_FILE = importlib.resources.files("networkx.generators") / "atlas.dat.gz"
AttributeError: module 'importlib.resources' has no attribute 'files'

I am working with python 3.8 and on osx-64.

Any advice on what to do?

sjroth commented 3 months ago

I have never seen this error before. It seems that the generators in networkx are failing. I will likely re-factor much of this code in the coming weeks due to odd dependency issues like this.

faleevz commented 3 months ago

Please let me know when you've had a chance to look into this further! It would be greatly appreciated :)

sjroth commented 3 months ago

Hi @faleevz,

While I am happy to help, package management isn't within my purview here. I would recommend trying to find alternate ways to install the necessary packages.