saezlab/CollecTRI

ValueError: Invalid value `loops` for `InteractionsQuery`. Valid options are

Closed this issue · 9 comments

Hi I am getting the following error

net = dc.get_collectri(organism='human', split_complexes=False)
Traceback (most recent call last):

ValueError: Invalid value loops for InteractionsQuery. Valid options are: ['database', 'databases', 'dataset', 'datasets', 'directed', 'directeds', 'dorothea_level', 'dorothea_levels', 'dorothea_method', 'dorothea_methods', 'entity_type', 'entity_types', 'field', 'fields', 'format', 'formats', 'genesymbol', 'genesymbols', 'header', 'headers', 'license', 'licenses', 'limit', 'limits', 'organism', 'organisms', 'partner', 'partners', 'password', 'passwords', 'resource', 'resources', 'signed', 'signeds', 'source_target', 'source_targets', 'source', 'sources', 'target', 'targets', 'tfregulons_level', 'tfregulons_levels', 'tfregulons_method', 'tfregulons_methods', 'type', 'types']

Hi @nbutyrate ,

Could you please update decoupler and omnipath and try again:

pip install git+https://github.com/saezlab/decoupler-py
pip install git+https://github.com/saezlab/omnipath/

Let me know how it goes, hope this is helpful!

dub2s commented

@PauBadiaM

Hii. I also got the above error. I updated decoupler and omnipath as suggested by you. However, the issue persisted. I ran this code : net = dc.get_collectri(organism='human', split_complexes=False) and got the following error

ValueError: Invalid value `loops` for `InteractionsQuery`. Valid options are: `['database', 'databases', 'dataset', 'datasets', 'directed', 'directeds', 'dorothea_level', 'dorothea_levels', 'dorothea_method', 'dorothea_methods', 'entity_type', 'entity_types', 'field', 'fields', 'format', 'formats', 'genesymbol', 'genesymbols', 'header', 'headers', 'license', 'licenses', 'limit', 'limits', 'organism', 'organisms', 'partner', 'partners', 'password', 'passwords', 'resource', 'resources', 'signed', 'signeds', 'source_target', 'source_targets', 'source', 'sources', 'target', 'targets', 'tfregulons_level', 'tfregulons_levels', 'tfregulons_method', 'tfregulons_methods', 'type', 'types']`.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/abhishek/.local/lib/python3.10/site-packages/decoupler/omnip.py", line 520, in get_collectri
    ct = _static_fallback(
  File "/home/abhishek/.local/lib/python3.10/site-packages/decoupler/omnip.py", line 123, in _static_fallback
    return op.static.static_table(
AttributeError: module 'omnipath' has no attribute 'static'

Output of dc.__versions__ is 1.5.1 and omnipath.__version__ is 1.0.7

Interestingly, I do not get this error when I run it on google colab. The version of decoupler there is 1.5.0. !

Hi @dub2s

Thanks for bringing this up. @deeenes, since with decoupler 1.5.0 it works, could it be that is caused by the new introduced changes?

We don't bump the version number of the omnipath Python module at every bug fix or feature (though maybe we should), so even if it's the same version, might be worth to update it.

The second error can not come up with decoupler older than 3 weeks: we introduced any reference to omnipath.static only that time. At the same time, omnipath must be older than 3 weeks, as since Sept 19 omnipath.static is exported.

The first error about the loops option, I would expect it's not possible since this and this commits, since 14 Sept.

So before we start a thorough investigation, I'd recommend to double check if all packages are up-to-date. Maybe the best is to check it in a fresh virtualenv:

python -m venv venv
soruce ./venv/bin/activate
pip install git+https://github.com/saezlab/decoupler-py.git
pip install git+https://github.com/saezlab/omnipath.git
python

>>> import omnipath as op
>>> ci = op.interactions.CollecTRI.get(loops = True)
>>> import decoupler as dc
>>> ci = dc.omnip.get_collectri()
dub2s commented

Hii @deeenes

Indeed in a fresh virtual environment, it worked. And after that when I just normally tried net = dc.get_collectri(organism='human', split_complexes=False) in the terminal, it worked as well !.

It is actually weird. I tried almost 10 times. Open the terminal and type the following commands
`python

import decoupler as dc
net = dc.get_collectri(organism='human', split_complexes=False)
`
Out of 10 times, around 4 times it throws the same error and it is randomly spread among the 10 trials.

Out of 10 times, around 4 times it throws the same error and it is randomly spread among the 10 trials.

Seeing the Invalid value: loops error randomly, I can easily imagine this with code from 3 weeks ago, but I believe in the latest version of the module this error is not possible any more.

same error
decoupler version 1.4.0
omnipath version 1.0.7

Hi @MariaRosariaNucera, Have you updated both packages within the past 2-3 weeks?

pip install git+https://github.com/saezlab/decoupler-py.git
pip install git+https://github.com/saezlab/omnipath.git

Does it work for you in a clean virtualenv, as shown here?

Hi @deeenes,
thanks for your reply, it works now with decoupler-1.5.1