vaquerizaslab / fanc

FAN-C: Framework for the ANalysis of C-like data
GNU General Public License v3.0
106 stars 14 forks source link

error when running line plot #131

Closed yeroslaviz closed 2 years ago

yeroslaviz commented 2 years ago

I'm following your examples from the web site, but have a problem when trying to plot the eigenvector matrix together with the line plot from here.

I just copy-pasted these cmmands:

fanc compartments -v architecture/compartments/fanc_example_1mb.ev.txt \
                  output/hic/binned/fanc_example_1mb.hic \
                  architecture/compartments/fanc_example_1mb.ab

fancplot -o architecture/compartments/fanc_example_1mb.ab_and_ev.png chr18 \
     -p square architecture/compartments/fanc_example_1mb.ab \
     -vmin -0.75 -vmax 0.75 -c RdBu_r \
     -p line architecture/compartments/fanc_example_1mb.ev.txt

and this is the error I get:

2022-09-29 13:08:22,503 INFO Using non-interactive backend
Traceback (most recent call last):
  File "/fs/home/yeroslaviz/miniconda3/envs/fanc/bin/fancplot", line 235, in <module>
    FancPlot()
  File "/fs/home/yeroslaviz/miniconda3/envs/fanc/bin/fancplot", line 87, in __init__
    plot, plot_args = plot_method(args)
  File "/fs/home/yeroslaviz/miniconda3/envs/fanc/lib/python3.7/site-packages/fanc/commands/fancplot_commands.py", line 146, in line
    regions = [fanc.load(file_name) for file_name in args.regions]
  File "/fs/home/yeroslaviz/miniconda3/envs/fanc/lib/python3.7/site-packages/fanc/commands/fancplot_commands.py", line 146, in <listcomp>
    regions = [fanc.load(file_name) for file_name in args.regions]
  File "/fs/home/yeroslaviz/miniconda3/envs/fanc/lib/python3.7/site-packages/fanc/tools/load.py", line 83, in load
    from fanc.compatibility.juicer import JuicerHic, is_juicer
  File "/fs/home/yeroslaviz/miniconda3/envs/fanc/lib/python3.7/site-packages/fanc/compatibility/juicer.py", line 7, in <module>
    from deprecated import deprecated
ModuleNotFoundError: No module named 'deprecated'
Closing remaining open files:architecture/compartments/fanc_example_1mb.ab...done

I have all the files. The text file with the eigenvectors looks like that:

$ head architecture/compartments/fanc_example_1mb.ev.txt
chr18   1   1000000 A   0.051471969383055864    .
chr18   1000001 2000000 A   0.1281533895356992  .
chr18   2000001 3000000 A   0.08243154262035376 .
chr18   3000001 4000000 B   -0.09804929965184188    .

Not sure what the problem is. any ideas?

thanks

kaukrise commented 2 years ago

The No module named 'deprecated' implies that the "Deprecated" module is not installed. This is odd, as it is one of FAN-C's dependencies. How did you install FAN-C? Did you use pip?

pip install fanc

You might be able to fix the error with

pip install Deprecated

but if your Python configuration is broken and it cannot find the installed packages, this might not work.

yeroslaviz commented 2 years ago

i have installed it with conda.

yeroslaviz commented 2 years ago

ok, solved it.

I have also conda installed the depracated package. Now it works.

thanks

kaukrise commented 2 years ago

Sorry, conda installation are no longer supported and conda packages are not updated anymore due to complex dependency issues outside of FAN-C. Please install and upgrade to the latest version using pip.

yeroslaviz commented 2 years ago

It would be good if the documentation can be updated, as it mentions conda there as well. this is why I chose it.

yeroslaviz commented 2 years ago

This is the reason, why I chose conda - when trying to install it on my iMac (my python version is 3.7.3 ), I get these errors:

  pybedtools/cbedtools.cpp:725:10: fatal error: 'ios' file not found
  #include "ios"
           ^~~~~
  1 error generated.
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for pybedtools
  Running setup.py clean for pybedtools
  Complete output from command /Users/yeroslaviz/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/sh/kwc66sqn4x36cjf9vncy99xm0000gp/T/pip-install-7ch2dmyv/pybedtools/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help

  error: option --all not recognized

  ----------------------------------------
  Failed cleaning build dir for pybedtools
  Building wheel for pyBigWig (setup.py) ... done
  Stored in directory: /Users/yeroslaviz/Library/Caches/pip/wheels/55/00/ed/6e2f4599b6b5fe0fc5867f8228924d254faaadecc76ed06eb4
  Building wheel for gridmap (setup.py) ... done
  Stored in directory: /Users/yeroslaviz/Library/Caches/pip/wheels/47/74/79/e3d381af990f6c68f15c8c2ed5ff4f7f1d373650421b837a76
  Building wheel for intervaltree (setup.py) ... done
  Stored in directory: /Users/yeroslaviz/Library/Caches/pip/wheels/f3/f2/66/e9c30d3e9499e65ea2fa0d07c002e64de63bd0adaa49c445bf
  Building wheel for genomic-regions (setup.py) ... done
  Stored in directory: /Users/yeroslaviz/Library/Caches/pip/wheels/53/5e/af/81e21fd91c29d6ae887a157ff9a0151959578108eb51867afd
  Building wheel for drmaa (setup.py) ... done
  Stored in directory: /Users/yeroslaviz/Library/Caches/pip/wheels/80/6d/e0/5bf9f29161bbb9e397d4af4702f8c5aeea119b0d5c74e44e0c
  Building wheel for asciitree (setup.py) ... done
  Stored in directory: /Users/yeroslaviz/Library/Caches/pip/wheels/1d/d9/58/9808b306744df0208fccc640d3d9952a5bc7468502d42897d5
  Building wheel for pypairix (setup.py) ... done
  Stored in directory: /Users/yeroslaviz/Library/Caches/pip/wheels/5d/c5/3d/b4d3a2f1c16fc4f5556e8d7891e448ef3701e2aabaa742d9f9
Successfully built fanc pyBigWig gridmap intervaltree genomic-regions drmaa asciitree pypairix
Failed to build pybedtools
scikit-image 0.19.3 has requirement numpy>=1.17.0, but you'll have numpy 1.16.2 which is incompatible.
scikit-image 0.19.3 has requirement pillow!=7.1.0,!=7.1.1,!=8.3.0,>=6.1.0, but you'll have pillow 5.4.1 which is incompatible.
scikit-image 0.19.3 has requirement scipy>=1.4.1, but you'll have scipy 1.2.1 which is incompatible.
pywavelets 1.4.0 has requirement numpy>=1.17.3, but you'll have numpy 1.16.2 which is incompatible.
matplotlib 3.5.3 has requirement numpy>=1.17, but you'll have numpy 1.16.2 which is incompatible.
matplotlib 3.5.3 has requirement pillow>=6.2.0, but you'll have pillow 5.4.1 which is incompatible.
Installing collected packages: fonttools, packaging, matplotlib, pysam, msgpack, msgpack-numpy, python-utils, progressbar2, pybedtools, pyBigWig, drmaa, gridmap, intervaltree, genomic-regions, PyWavelets, tifffile, scikit-image, asciitree, dill, multiprocess, simplejson, pypairix, cooler, Deprecated, fanc
  Found existing installation: packaging 19.0
    Uninstalling packaging-19.0:
      Successfully uninstalled packaging-19.0
  Found existing installation: matplotlib 3.0.3
    Uninstalling matplotlib-3.0.3:
      Successfully uninstalled matplotlib-3.0.3
  Found existing installation: msgpack 0.6.1
    Uninstalling msgpack-0.6.1:
      Successfully uninstalled msgpack-0.6.1
  Running setup.py install for pybedtools ... error
    Complete output from command /Users/yeroslaviz/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/sh/kwc66sqn4x36cjf9vncy99xm0000gp/T/pip-install-7ch2dmyv/pybedtools/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/sh/kwc66sqn4x36cjf9vncy99xm0000gp/T/pip-record-4kwgcsmv/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    copying pybedtools/version.py -> build/lib.macosx-10.7-x86_64-3.7/pybedtools
    running egg_info
    writing pybedtools.egg-info/PKG-INFO
    writing dependency_links to pybedtools.egg-info/dependency_links.txt
    writing requirements to pybedtools.egg-info/requires.txt
    writing top-level names to pybedtools.egg-info/top_level.txt
    reading manifest file 'pybedtools.egg-info/SOURCES.txt'
    writing manifest file 'pybedtools.egg-info/SOURCES.txt'
    running build_ext
    building 'pybedtools.cbedtools' extension
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/yeroslaviz/anaconda3/include -arch x86_64 -I/Users/yeroslaviz/anaconda3/include -arch x86_64 -Ipybedtools/include/ -I/Users/yeroslaviz/anaconda3/include/python3.7m -c pybedtools/cbedtools.cpp -o build/temp.macosx-10.7-x86_64-3.7/pybedtools/cbedtools.o
    clang: warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    pybedtools/cbedtools.cpp:725:10: fatal error: 'ios' file not found
    #include "ios"
             ^~~~~
    1 error generated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/Users/yeroslaviz/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/sh/kwc66sqn4x36cjf9vncy99xm0000gp/T/pip-install-7ch2dmyv/pybedtools/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/sh/kwc66sqn4x36cjf9vncy99xm0000gp/T/pip-record-4kwgcsmv/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/sh/kwc66sqn4x36cjf9vncy99xm0000gp/T/pip-install-7ch2dmyv/pybedtools/
kaukrise commented 2 years ago

I see. This is a pybedtools error - maybe bring it up with them. But I found a different package with the same issue, they seems to be able to resolve it like this:

CFLAGS='-stdlib=libc++' pip install fanc

or this:

MACOSX_DEPLOYMENT_TARGET=10.14 pip install fanc

https://github.com/Ezibenroc/PyRoaringBitMap/issues/44#issuecomment-467890418

yeroslaviz commented 2 years ago

i tried it as well, but it didn't work straight away, as i have had dependencies problems with older versions.

I have solved it by creating a conda environment with a newer python version

conda create -n fanc -c bioconda python=3.8 matplotlib numpy pybedtools pywavelets scikit-image pillow scipy

conda activate fanc

 CFLAGS='-stdlib=libc++' pip install fanc

Not it seems to run. The example data set is running now.

thanks