Skip to content

Revert "temporarily remove cell cell comm" - #598

Merged
scottgigante-immunai merged 4 commits into
mainfrom
cell_cell_communication/bugfix/import_omnipathr
Sep 30, 2022
Merged

Revert "temporarily remove cell cell comm"#598
scottgigante-immunai merged 4 commits into
mainfrom
cell_cell_communication/bugfix/import_omnipathr

Conversation

@scottgigante-immunai

Copy link
Copy Markdown
Collaborator

This reverts commit 1068e5f.

Cell cell communication was causing benchmarks to fail: https://github.com/openproblems-bio/openproblems/actions/runs/3136011677/jobs/5095990766

We need to identify the problem before we can merge it back in.

@scottgigante-immunai scottgigante-immunai added bug Something isn't working task Add a new task labels Sep 28, 2022
@codecov

codecov Bot commented Sep 28, 2022

Copy link
Copy Markdown

Codecov Report

Base: 86.11% // Head: 94.62% // Increases project coverage by +8.50% 🎉

Coverage data is based on head (ca80b97) compared to base (f9ecd71).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #598      +/-   ##
==========================================
+ Coverage   86.11%   94.62%   +8.50%     
==========================================
  Files         135      135              
  Lines        3378     3440      +62     
  Branches      176      176              
==========================================
+ Hits         2909     3255     +346     
+ Misses        412      124     -288     
- Partials       57       61       +4     
Flag Coverage Δ
unittests 94.62% <ø> (+8.50%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
openproblems/data/immune_cells.py 100.00% <0.00%> (ø)
.../_batch_integration/batch_integration_embed/api.py 100.00% <0.00%> (ø)
.../_batch_integration/batch_integration_graph/api.py 100.00% <0.00%> (ø)
...gration/batch_integration_graph/datasets/immune.py 100.00% <0.00%> (ø)
...gration/batch_integration_graph/methods/fastmnn.py 100.00% <0.00%> (ø)
...ation/batch_integration_graph/datasets/pancreas.py 100.00% <0.00%> (ø)
...lems/tasks/_cell_cell_communication/_common/api.py 91.57% <0.00%> (+91.57%) ⬆️
openproblems/data/tnbc_wu2021.py 100.00% <0.00%> (+100.00%) ⬆️
openproblems/data/allen_brain_atlas.py 100.00% <0.00%> (+100.00%) ⬆️
...ms/tasks/_cell_cell_communication/_common/utils.py 100.00% <0.00%> (+100.00%) ⬆️
... and 8 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@dbdimitrov

Copy link
Copy Markdown
Collaborator

Ooh, debug this in the next couple of days!!

@scottgigante-immunai

Copy link
Copy Markdown
Collaborator Author

Error code from the nextflow log looks like it's to do with the location of the omnipathr config file.

WARNING:rpy2.rinterface_lib.callbacks:R[write to console]: In addition:
WARNING:rpy2.rinterface_lib.callbacks:R[write to console]: Warning message:
WARNING:rpy2.rinterface_lib.callbacks:R[write to console]: In file(file, "w", encoding = fileEncoding) :
WARNING:rpy2.rinterface_lib.callbacks:R[write to console]: 
WARNING:rpy2.rinterface_lib.callbacks:R[write to console]: cannot open file '/home/sagemaker-user/.config/OmnipathR/omnipathr.yml': Permission denied
Traceback (most recent call last):
  File "/usr/local/bin/openproblems-cli", line 33, in <module>
    sys.exit(load_entry_point('openproblems', 'console_scripts', 'openproblems-cli')())
  File "/usr/src/singlecellopenproblems/openproblems/api/main.py", line 45, in main
    output = _main(args)
  File "/usr/src/singlecellopenproblems/openproblems/api/main.py", line 38, in _main
    return SUBCOMMANDS[args.subcommand].main(args)
  File "/usr/src/singlecellopenproblems/openproblems/api/load.py", line 12, in main
    adata = load_dataset(args.task, args.name, args.test)
  File "/usr/src/singlecellopenproblems/openproblems/api/load.py", line 7, in load_dataset
    return fun(test=test)
  File "/usr/src/singlecellopenproblems/openproblems/tools/decorators.py", line 155, in apply_func
    adata = func(*args, **kwargs)
  File "/usr/src/singlecellopenproblems/openproblems/tasks/_cell_cell_communication/cell_cell_communication_ligand_target/datasets/tnbc_wu2021.py", line 24, in tnbc_data
    adata.uns["ligand_receptor_resource"] = ligand_receptor_resource(
  File "<decorator-gen-33>", line 2, in __call__
  File "/usr/local/lib/python3.8/site-packages/scprep/utils.py", line 80, in _with_pkg
    return fun(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/scprep/run/r_function.py", line 138, in __call__
    robject = self.function(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/rpy2/robjects/functions.py", line 198, in __call__
    return (super(SignatureTranslatedFunction, self)
  File "/usr/local/lib/python3.8/site-packages/rpy2/robjects/functions.py", line 125, in __call__
    res = super(Function, self).__call__(*new_args, **new_kwargs)
  File "/usr/local/lib/python3.8/site-packages/rpy2/rinterface_lib/conversion.py", line 45, in _
    cdata = function(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/rpy2/rinterface.py", line 677, in __call__
    raise embedded.RRuntimeError(_rinterface._geterrmessage())
rpy2.rinterface_lib.embedded.RRuntimeError: Error: .onLoad failed in loadNamespace() for 'OmnipathR', details:
  call: file(file, "w", encoding = fileEncoding)
  error: cannot open the connection

<error/rlang_error>
Error:
! .onLoad failed in loadNamespace() for 'OmnipathR', details: call:
  file(file, "w", encoding = fileEncoding) error: cannot open the connection
---
Backtrace:
    ▆
 1. ├─`<fn>`(9606L)
 2. └─base::loadNamespace(x)
 3.   ├─base::namespaceImportFrom(...)
 4.   │ └─base::asNamespace(ns)
 5.   └─base::loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
 6.     └─base (local) runHook(".onLoad", env, package.lib, package)`, size: 3107 (max: 255)

@LuckyMD

LuckyMD commented Sep 28, 2022

Copy link
Copy Markdown
Collaborator

Is Omnipath ever explicitly called in your code, or is it wrapped by LIANA? This seems to error out in a load_dataset function, but the tnbc_wu dataset never calls omnipath explicitly as far as I can tell.

@dbdimitrov

dbdimitrov commented Sep 30, 2022

Copy link
Copy Markdown
Collaborator

OK. This is odd.

OmniPath is not actually used (I thought it might be wrongly calling liana::generate_homologs), but it is indeed loaded implicitly (wrapped in LIANA).

Loading OmniPath then makes it initiate it's own .cache and .configs, and this is where/why the exception is thrown. I was able to reproduce it by removing the permissions from my OmnipathR/omnipathr.yml file, meaning that the sagemaker-user run does not have access to it's own home directory? Is there a way to allow it to save small files (it won't be anything larger than 5MB)? This might be the easiest solution.

The next in-line solution would be to enable OmniPath to save in the current directory, or alternatively to just have a temporary omnipath.env created each time it's run (thus not writing anything at all).

Third solution (most work solution), save everything as files and I can move OmniPath from imported to suggested in LIANA.

@scottgigante-immunai

Copy link
Copy Markdown
Collaborator Author

I just opened up the docker image and sagemaker-user does indeed have access to its home directory, however, it does not have access to ~/.config. This should be an easy fix.

@scottgigante-immunai
scottgigante-immunai merged commit 8b570aa into main Sep 30, 2022
@scottgigante-immunai
scottgigante-immunai deleted the cell_cell_communication/bugfix/import_omnipathr branch September 30, 2022 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working task Add a new task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants