vanheeringen-lab / ANANSE

Prediction of key transcription factors in cell fate determination using enhancer networks. See full ANANSE documentation for detailed installation instructions and usage examples.
http://anansepy.readthedocs.io
MIT License
77 stars 16 forks source link

An error occurred when I use ananse influence with -w #211

Open socialtree-yt opened 7 months ago

socialtree-yt commented 7 months ago

I use ananse influence to compare two networks successfully but failed when I add a white list of genes. My list goes as follow: image

And the error is :

An error has been caught in function '<module>', process 'MainProcess' (71394), thread 'MainThread' (139919365887808):

Traceback (most recent call last):

> File "/mnt/dfc_data1/home/yanteng/micromamba/envs/ananse/bin/ananse", line 609, in <module>
    args.func(args)
    │    │    └ Namespace(target_file='KF_enhancer_network.tsv', expression='/mnt/dfc_data2/project/yanteng/human.aging/GSE163973.keloidscRNA...
    │    └ <function influence at 0x7f3eb9c21a20>
    └ Namespace(target_file='KF_enhancer_network.tsv', expression='/mnt/dfc_data2/project/yanteng/human.aging/GSE163973.keloidscRNA...
  File "/mnt/dfc_data1/home/yanteng/micromamba/envs/ananse/lib/python3.10/site-packages/ananse/commands/influence.py", line 9, in influence
    a = ananse.influence.Influence(
        │      │         └ <class 'ananse.influence.Influence'>
        │      └ <module 'ananse.influence' from '/mnt/dfc_data1/home/yanteng/micromamba/envs/ananse/lib/python3.10/site-packages/ananse/influ...
        └ <module 'ananse' from '/mnt/dfc_data1/home/yanteng/micromamba/envs/ananse/lib/python3.10/site-packages/ananse/__init__.py'>
  File "/mnt/dfc_data1/home/yanteng/micromamba/envs/ananse/lib/python3.10/site-packages/ananse/influence.py", line 368, in __init__
    self.read_networks(
    │    └ <function Influence.read_networks at 0x7f3ec5374700>
    └ <ananse.influence.Influence object at 0x7f3eb923b040>
  File "/mnt/dfc_data1/home/yanteng/micromamba/envs/ananse/lib/python3.10/site-packages/ananse/influence.py", line 403, in read_networks
    self.grn = difference(
    │    │     └ <function difference at 0x7f3ec5374280>
    │    └ None
    └ <ananse.influence.Influence object at 0x7f3eb923b040>
  File "/mnt/dfc_data1/home/yanteng/micromamba/envs/ananse/lib/python3.10/site-packages/ananse/influence.py", line 163, in difference
    diff_network = _filter_network_edges(diff_network, sort_by, edges, whitelist)
                   │                     │             │        │      └ ('A2M', 'ABI3BP', 'ACAN', 'ADAM10', 'ADAM11', 'ADAM12', 'ADAM15', 'ADAM17', 'ADAM19', 'ADAM22', 'ADAM23', 'ADAM28', 'ADAM30',...
                   │                     │             │        └ 500000
                   │                     │             └ 'prob'
                   │                     └                         weight
                   │                       tf_target
                   │                       HOXC12—LINC00316  3.000000e-08
                   │                       LEF1—AL512598.1   3.000000e-08
                   │                       N...
                   └ <function _filter_network_edges at 0x7f3ec5374310>
  File "/mnt/dfc_data1/home/yanteng/micromamba/envs/ananse/lib/python3.10/site-packages/ananse/influence.py", line 191, in _filter_network_edges
    tfs = set(df.index.str.startswith(whitelist).index)
              │  │                    └ ('A2M', 'ABI3BP', 'ACAN', 'ADAM10', 'ADAM11', 'ADAM12', 'ADAM15', 'ADAM17', 'ADAM19', 'ADAM22', 'ADAM23', 'ADAM28', 'ADAM30',...
              │  └ <pandas._libs.properties.AxisProperty object at 0x7f3ecb106260>
              └                         weight
                tf_target
                HOXC12—LINC00316  3.000000e-08
                LEF1—AL512598.1   3.000000e-08
                N...

AttributeError: 'numpy.ndarray' object has no attribute 'index'
siebrenf commented 7 months ago

Found the issue! It was a very silly coding mistake by me :o The fix is on the develop branch now. Install it with

pip install git+https://github.com/vanheeringen-lab/ANANSE.git@develop
socialtree-yt commented 7 months ago

I tried some times but if failed. Can I upgrade it through conda? The error is as follow: (ananse) [yanteng@compute-0-2 ~]$ pip install git+https://github.com/vanheeringen-lab/ANANSE.git@develop Collecting git+https://github.com/vanheeringen-lab/ANANSE.git@develop Cloning https://github.com/vanheeringen-lab/ANANSE.git (to revision develop) to /tmp/pip-req-build-t7myh_f2 Running command git clone --quiet https://github.com/vanheeringen-lab/ANANSE.git /tmp/pip-req-build-t7myh_f2 error: RPC failed; curl 18 transfer closed with outstanding read data remaining fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed error: subprocess-exited-with-error

× git clone --quiet https://github.com/vanheeringen-lab/ANANSE.git /tmp/pip-req-build-t7myh_f2 did not run successfully. │ exit code: 128 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× git clone --quiet https://github.com/vanheeringen-lab/ANANSE.git /tmp/pip-req-build-t7myh_f2 did not run successfully. │ exit code: 128 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Roki12543 commented 7 months ago

Have you fixed this issue? I'm having the same problem as you

siebrenf commented 7 months ago

I'll create a hotfix release, but that error message suggests there was an issue with the connection!

siebrenf commented 7 months ago

Conda update will be available shortly after this PR is merged!