saezlab / decoupleR

R package to infer biological activities from omics data using a collection of methods.
https://saezlab.github.io/decoupleR/
GNU General Public License v3.0
176 stars 23 forks source link

Can't get PROGENy model by get_progeny #126

Closed leeyangyangyang closed 2 months ago

leeyangyangyang commented 2 months ago

Hello,

I am trying to infer pathway activavity in bulk RNA-seq, and when I use

net <- get_progeny(organism = 'mouse', top = 500)

to get progeny model, it throws a mistake:

[2024-05-19 15:41:05] [WARN]    [OmnipathR] Failed to download `https://www.ensembl.org/info/about/species.html` (attempt 1/3);
 error: schannel: next InitializeSecurityContext failed: SEC_E_CERT_EXPIRED (0x80090328)

My R version is 4.4.0 and both decoupleR and OmnipathR are the newest veriosn. It seems like the problem is from the Ensembl website. Is there any way to solve this problem? Thanks a lot !

PauBadiaM commented 2 months ago

Hi @leeyangyangyang,

Thanks for opening this issue. @deeenes , could this be caused by the new gene conversion refactor?

leeyangyangyang commented 2 months ago

@PauBadiaM Thank you for your quick response. The complete error message is as follows. Additionally, when I try to access the website https://www.ensembl.org/info/about/species.html using a browser, the browser indicates that the website's certificate has expired on May 18, 2024

[2024-05-20 19:27:50] [WARN]    [OmnipathR] Failed to download `https://www.ensembl.org/info/about/species.html` (attempt 1/3); error: schannel: next InitializeSecurityContext failed: SEC_E_CERT_EXPIRED (0x80090328) 
[2024-05-20 19:27:56] [WARN]    [OmnipathR] Failed to download `https://www.ensembl.org/info/about/species.html` (attempt 2/3); error: schannel: next InitializeSecurityContext failed: SEC_E_CERT_EXPIRED (0x80090328) 
[2024-05-20 19:28:02] [ERROR]   [OmnipathR] Failed to download `https://www.ensembl.org/info/about/species.html` (attempt 3/3); error: schannel: next InitializeSecurityContext failed: SEC_E_CERT_EXPIRED (0x80090328) 
[2024-05-20 19:28:03] [WARN]    [OmnipathR] Failed to download `https://www.ensembl.org/info/about/species.html` (attempt 1/3); error: schannel: next InitializeSecurityContext failed: SEC_E_CERT_EXPIRED (0x80090328) 
[2024-05-20 19:28:09] [WARN]    [OmnipathR] Failed to download `https://www.ensembl.org/info/about/species.html` (attempt 2/3); error: schannel: next InitializeSecurityContext failed: SEC_E_CERT_EXPIRED (0x80090328) 
[2024-05-20 19:28:14] [ERROR]   [OmnipathR] Failed to download `https://www.ensembl.org/info/about/species.html` (attempt 3/3); error: schannel: next InitializeSecurityContext failed: SEC_E_CERT_EXPIRED (0x80090328) 
[2024-05-20 19:28:15] [WARN]    [OmnipathR] Accessing `PROGENy` as a static table: this is not the recommended way to access OmniPath data; it is only a backup plan for situations when our server or your computer is experiencing issues.
[2024-05-20 19:28:16] [ERROR]   [OmnipathR] [decoupleR] Failed to download annotation resource `PROGENy` from OmniPath. For more information, see the OmnipathR log.
Error in value[[3L]](cond) : 
  [decoupleR] Failed to download annotation resource `PROGENy` from OmniPath. For more information, see the OmnipathR log.
deeenes commented 2 months ago

Hi @leeyangyangyang,

Ensembl.org renewed it's certificate by 30 Apr, the old one which expires by 18 May can come only from your machine's local cache. You're using Schannel, a built-in component of Windows. You should clear the cache of Windows' certificate store. As I understand, this is possible by running the command below in an admin shell and restarting the machine:

certutil -urlcache * delete
leeyangyangyang commented 2 months ago

@deeenes Thank you very much for your help. This is indeed very effective, but it seems that a new error has occurred:

[2024-05-22 17:23:01] [SUCCESS] [OmnipathR] Loaded 700239 annotation records from cache.
Error in UseMethod("mutate") : 
  no applicable method for 'mutate' applied to an object of class "list"

When the organism is set to 'human', it works correctly, but when it is changed to 'mouse', this error occurs. I tried to find the reason and discovered that this error occurs within the 'get_resource' function used by 'get_progeny'. Additionally, when I use the progeny() function from the progeny package and set the organism to mouse, it works correctly. Is there any difference between decoupleR run_mlm() function and progeny() function when inferring pathway activatity.

deeenes commented 2 months ago

@deeenes Thank you very much for your help. This is indeed very effective, but it seems that a new error has occurred:

[2024-05-22 17:23:01] [SUCCESS] [OmnipathR] Loaded 700239 annotation records from cache.
Error in UseMethod("mutate") : 
  no applicable method for 'mutate' applied to an object of class "list"

This means a download method returned a list instead of a data frame, suggesting a download failure, like the one you can see here. Can you confirm OmnipathR is updated for the new OMA API, i.e. its version is at least 3.11.14?

packageVersion(OmnipathR)

Please update it if necessary:

remotes::install_github('saezlab/OmnipathR')

And try to load the data with empty cache:

library(OmnipathR)
library(decoupleR)

omnipath_set_cachedir(tempdir())
p <- get_progeny(organism = 'mouse')

When the organism is set to 'human', it works correctly, but when it is changed to 'mouse', this error occurs.

Sure, because the human data is simply downloaded from our server, while the mouse data is translated from the human by orthologous gene pairs, which is a much more complex operation and requires data from 3 further resources. In the future we'll provide the mouse data directly from our server, reducing the chance of issues like this.

I tried to find the reason and discovered that this error occurs within the 'get_resource' function used by 'get_progeny'.

get_resource is only the first function in the stack, it is actually very deep, you can see the full stack by traceback or rlang::last_trace. And you'll probably see that the error is somewhere under OmnipathR::oma_pairwise.

Additionally, when I use the progeny() function from the progeny package and set the organism to mouse, it works correctly. Is there any difference between decoupleR run_mlm() function and progeny() function when inferring pathway activatity.

The old PROGENy is primarily a data package that contains the pathway signatures. Today we distribute the same signatures, among many other kind of signatures, by the OmniPath web service, while decoupleR provides a variety of statistics to calculate enrichment. Which one of those corresponds to the one originally used in PROGENy, maybe @PauBadiaM knows the answer. However, today we don't recommend using the old package, because the current solution offers more features and is actively maintained.

leeyangyangyang commented 2 months ago

Thanks very much @deeenes I updated OmnipathR to 3.11.16 and now everything goes well !

leeyangyangyang commented 2 months ago

Thanks very much @deeenes I updated OmnipathR to 3.11.16 and now everything goes well !