cytoscape / RCy3

New version of RCy3, redesigned and collaboratively maintained by Cytoscape developer community
MIT License
48 stars 20 forks source link

Error in Pathway Analysis vignette #217

Closed mauritsunkel closed 3 months ago

mauritsunkel commented 6 months ago

Hi, following this vignette (https://bioconductor.org/packages/release/bioc/vignettes/rWikiPathways/inst/doc/Pathway-Analysis.html) everything runs fine until:

em_command = paste('enrichmentmap build analysisType="generic" ', 
                   'pvalue=',"0.05", 'qvalue=',"0.05",
                   'similaritycutoff=',"0.25",
                   'coeffecients=',"JACCARD",
                   'enrichmentsDataset1=',egobp.results.filename ,
                   sep=" ")

  #enrichment map command will return the suid of newly created network.
  em_network_suid <- commandsRun(em_command)

Failed to execute: http://127.0.0.1:1234/v1/commands/enrichmentmap/build?analysisType=generic&pvalue=%200.05&qvalue=%200.05&similaritycutoff=%200.25&coeffecients=%20JACCARD&enrichmentsDataset1=%20C:/Users/mauri/Documents/bulkmRNAseq_DEA/PEA_TB/clusterprofiler_cluster_enr_results.txt

Error in fromJSON(rawToChar(res$content))$errors : $ operator is invalid for atomic vectors

What could I try?

khanspers commented 6 months ago

I see the same error. However, running the command (em_command) directly in the Command Line in Cytoscape works, so it seems this is RCy3 specific.

Also, the code that creates the command has a typo, unrelated to the error above (placement of single quote for analysisType):

em_command = paste('enrichmentmap build analysisType=',"generic", 
                    'pvalue=',"0.05", 'qvalue=',"0.05",
                    'similaritycutoff=',"0.25",
                    'coeffecients=',"JACCARD",
                    'enrichmentsDataset1=',egobp.results.filename ,
                    sep=" ")
AlexanderPico commented 6 months ago

Hmm... CyREST is returning a 500 status for this command, which is triggering the error clause in the code, which is returning this (ugly) error message.

And if I tease out the error message manually, I get:

"None of the gene sets have passed the filter. Try relaxing the gene set filter parameters."

Which is the same error I get when I run the analysis via CyREST Swagger: http://127.0.0.1:1234/v1/swaggerUI/swagger-ui/index.html?url=http://127.0.0.1:1234/v1/commands/swagger.json#!/enrichmentmap/enrichmentmap_build

Even though there are gene sets that pass the filter and the same command generates results via CLI.

So, it's not an rWikiPathways nor RCy3 error. It appears to be an issue with enrichmentmap app in how it's handling queries coming from CyREST vs. CLI, even with identical parameters.

Adding @risserlin to ticket to see if she has any additional insights.

AlexanderPico commented 6 months ago

@khanspers when you get a chance, can you update the vignette to fix the non-critical typo you found as well as this one:

coeffecients ==> coefficients (the typo version still works, but is deprecated)

bdemchak commented 6 months ago

@Alex Pico @.***> Does py4cytoscape return the same ugly error??

On Wed, Dec 13, 2023, 5:50 PM Alexander Pico @.***> wrote:

Hmm... CyREST is returning a 500 status for this command, which is triggering the error clause in the code, which is returning this (ugly) error message.

And if I tease out the error message manually, I get:

"None of the gene sets have passed the filter. Try relaxing the gene set filter parameters."

Which is the same error I get when I run the analysis via CyREST Swagger: http://127.0.0.1:1234/v1/swaggerUI/swagger-ui/index.html?url=http://127.0.0.1:1234/v1/commands/swagger.json#!/enrichmentmap/enrichmentmap_build https://urldefense.com/v3/__http://127.0.0.1:1234/v1/swaggerUI/swagger-ui/index.html?url=http:**A127.0.0.1:1234*v1*commands*swagger.json*!*enrichmentmap*enrichmentmap_build__;Ly8vLy8jLy8!!Mih3wA!CHKzrvCtyqZJvsMsTvmyV-jSdhV-gxcjiv3AKOYZ6HNpvRy1fI3MsumZKIeSIdOg7UtRlabU-L7rV6pxxotHjhrVjg$

So, it's not an rWikiPathways nor RCy3 error. It appears to be an issue with enrichmentmap app in how it's handling queries coming from CyREST vs. CLI, even with identical parameters.

Adding @risserlin https://urldefense.com/v3/__https://github.com/risserlin__;!!Mih3wA!CHKzrvCtyqZJvsMsTvmyV-jSdhV-gxcjiv3AKOYZ6HNpvRy1fI3MsumZKIeSIdOg7UtRlabU-L7rV6pxxosW2T2GpQ$ to ticket to see if she has any additional insights.

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/cytoscape/RCy3/issues/217*issuecomment-1854981028__;Iw!!Mih3wA!CHKzrvCtyqZJvsMsTvmyV-jSdhV-gxcjiv3AKOYZ6HNpvRy1fI3MsumZKIeSIdOg7UtRlabU-L7rV6pxxouVbhGuBQ$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AA4GLXTMPNYS7JTKYERX4XLYJJLPNAVCNFSM6AAAAABATFM23SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJUHE4DCMBSHA__;!!Mih3wA!CHKzrvCtyqZJvsMsTvmyV-jSdhV-gxcjiv3AKOYZ6HNpvRy1fI3MsumZKIeSIdOg7UtRlabU-L7rV6pxxos3t6fA6w$ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

AlexanderPico commented 6 months ago

Open issue in enrichmentmap repo: https://github.com/BaderLab/EnrichmentMapApp/issues/532

AlexanderPico commented 6 months ago

@alex Pico @.***> Does py4cytoscape return the same ugly error??

Nope. Unique R problem. Python doesn't use those $ shortcuts. https://github.com/cytoscape/py4cytoscape/blob/master/py4cytoscape/commands.py#L674

AlexanderPico commented 6 months ago

@yihangx can you look into better syntax here for parsing the error without creating a new error :)

https://github.com/cytoscape/RCy3/blob/devel/R/Commands.R#L828C76-L828C76

yihangx commented 6 months ago

Sure!

risserlin commented 6 months ago

This looks like an issue with the current version of EM that is in the app store(3.3.6). I can not recreate this issue with the development version of EM that I have installed but I was able to recreate it with EM 3.3.6. @mikekucera what is the time line for the release of the next version of EM? Can we maybe release an update of EM with the fix for the above issue?

AlexanderPico commented 6 months ago

Got CyREST to work by using correct Datasets arg, so that is not the source of the issue. Back to looking RCy3...

Currently stumped.

mauritsunkel commented 5 months ago

Hi, checking in if this issue is still on the radar.

Maybe in the meantime would you be able to recommend me a workaround?

AlexanderPico commented 5 months ago

Sure. The workaround is to use CyREST directly, using the enrichmentsDataset1 parameter name. See https://github.com/BaderLab/EnrichmentMapApp/issues/532.

yihangx commented 3 months ago

Kristina and I cannot reproduce this one.