Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error in running python notebook of melc tonsils #30

Closed
ankitbioinfo opened this issue Aug 26, 2021 · 4 comments
Closed

Getting error in running python notebook of melc tonsils #30

ankitbioinfo opened this issue Aug 26, 2021 · 4 comments
Labels
question Further information is requested

Comments

@ankitbioinfo
Copy link

Hi, I am running your example of following two notebooks data_exploration_melc_tonsils.ipynb, and model_benchmarks_melc_tonsils.ipynb
In the first one I get the error at step "Supp. Fig. 7: Ligand–receptor permutation test"

TypeError: init() got an unexpected keyword argument 'allowed_methods'

And from the other notebook at step "Figure 1 (d): Modeling cell communication as spatial cell state dependencies"

FileNotFoundError: [Errno 2] No such file or directory: '.210419_INTERACTIONS_BASELINE_NONE_NODES_PATIENT_1_pascualreguanttonsil/results/'

Can you please let me know what I am missing here? Thanks.

@ankitbioinfo ankitbioinfo added the question Further information is requested label Aug 26, 2021
@AnnaChristina
Copy link
Member

Hi @ankitbioinfo,

thanks for raising your issue.

regarding your first issue:

In the first one I get the error at step "Supp. Fig. 7: Ligand–receptor permutation test"

TypeError: init() got an unexpected keyword argument 'allowed_methods'

could you please post the complete error stream from the cell you tried to execute? thanks!

And from the other notebook at step "Figure 1 (d): Modeling cell communication as spatial cell state dependencies"

FileNotFoundError: [Errno 2] No such file or directory: > '.210419_INTERACTIONS_BASELINE_NONE_NODES_PATIENT_1_pascualreguanttonsil/results/'

the second notebook raises a FileNotFoundError as it expects the results of a grid search ran on the MELC - tonsils in the stated directory. We currently do not provide those files seperatly, but we published the grid search scripts to reproduce our results in the ncem_benchmarks repository. In particular, for the MELC - tonsils dataset here. Those scripts and the repective grid searches will generate all files required for the model_benchmarks_melc_tonsils.ipynb notebook. For easier and an intuitive execution of the models, we recommend use the ncem_tutorials repository, which provides an tutorial notebook on how to fit an interaction linear model on one of the datasets here.

Please let me know, if you have more questions, happy to assist, so you can explore ncem!

@ankitbioinfo
Copy link
Author

Thanks for clearing the doubts. Here is the complete error from the first step.


TypeError Traceback (most recent call last)
in
52 'KIT'
53 ]
---> 54 adata = interpreter.data.ligrec(
55 hgnc_names=hgnc_names,
56 undefined_type='other',

~/miniconda/lib/python3.8/site-packages/ncem/data.py in ligrec(self, image_key, source_groups, undefined_type, hgnc_names, fraction, pvalue_threshold, width, seed, random_state, fontsize, save, suffix, show, copy)
1178 AnnData if copy is True.
1179 """
-> 1180 interactions = import_intercell_network(
1181 transmitter_params={"categories": "ligand"}, receiver_params={"categories": "receptor"}
1182 )

~/miniconda/lib/python3.8/site-packages/omnipath/_core/requests/interactions/_utils.py in import_intercell_network(include, interactions_params, transmitter_params, receiver_params)
98 receiver_params.setdefault("scope", "generic")
99
--> 100 interactions = AllInteractions.get(include=include, **interactions_params)
101 if interactions.empty:
102 raise ValueError(_ERROR_EMPTY_FMT.format(obj="interactions"))

~/miniconda/lib/python3.8/site-packages/omnipath/_core/requests/_utils.py in wrapper(wrapped, _instance, args, kwargs)
102 @wrapt.decorator(adapter=wrapt.adapter_factory(argspec_factory))
103 def wrapper(wrapped, _instance, args, kwargs):
--> 104 return wrapped(*args, **kwargs)
105
106 if hasattr(clazz, "get") and not hasattr(clazz.get, "wrapped"):

~/miniconda/lib/python3.8/site-packages/omnipath/_core/requests/interactions/_interactions.py in get(cls, include, exclude, **kwargs)
375 %(get.returns)s
376 """
--> 377 return cls(include, exclude=exclude)._get(**kwargs)
378
379

~/miniconda/lib/python3.8/site-packages/omnipath/_core/requests/interactions/_interactions.py in init(self, include, exclude)
338 exclude: Optional[Datasets_t] = None,
339 ):
--> 340 super().init(include, exclude=exclude)
341
342 def _inject_fields(self, params: Dict[str, Any]) -> Dict[str, Any]:

~/miniconda/lib/python3.8/site-packages/omnipath/_core/requests/interactions/_interactions.py in init(self, datasets, exclude)
66 exclude: Optional[Datasets_t] = None,
67 ):
---> 68 super().init()
69
70 datasets = _to_dataset_set(datasets, "datasets", set(InteractionDataset))

~/miniconda/lib/python3.8/site-packages/omnipath/_core/requests/_request.py in init(self)
74
75 def init(self):
---> 76 self._downloader = Downloader(options)
77
78 @classmethod

~/miniconda/lib/python3.8/site-packages/omnipath/_core/downloader/_downloader.py in init(self, opts)
47 if self._options.num_retries > 0:
48 adapter = HTTPAdapter(
---> 49 max_retries=Retry(
50 total=self._options.num_retries,
51 redirect=5,

TypeError: init() got an unexpected keyword argument 'allowed_methods'

@AnnaChristina
Copy link
Member

hi @ankitbioinfo,

thanks for posting the complete error stream. I tried to reproduce your error in an environment with only pip install ncem installed and could not reproduce your error.

From how I read your error stream, it might be caused by a different version of omnipath, requests or urllib3. Could you also check which versions you have installed for the required packages? Thanks!

@ankitbioinfo
Copy link
Author

Hi Anna, Many thanks for reproducing the error. I updated the following packages and now it seems working.
Thanks for your great help.

ruamel_yaml_conda>=0.11.14
pandas>=1.1.4
urllib3>=1.26.0
conda install -c conda-forge ipywidgets
jupyter nbextension enable --py widgetsnbextension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants