moosa-r / rbioapi

rbioapi: User-Friendly R Interface to Biologic Web Services' API
https://rbioapi.moosa-r.com/
GNU General Public License v3.0
17 stars 1 forks source link

rbioapi - Panther - Internal Error: Failed to parse the server's response. This is probably because the server has changed the response format. #4

Closed agleto closed 2 years ago

agleto commented 2 years ago

Hello,

I am trying to run the enrichment analysis for maize using the Zm00001d type gene ids, which usually works fine on the Panther website.

genes <- result_table_interaction_ash$gene_id genes [1] "Zm00001d029136" "Zm00001d053999" "Zm00001d033416" "Zm00001d033985" "Zm00001d018414" "Zm00001d017251" "Zm00001d027760" "Zm00001d046865" [9] "Zm00001d041323" "Zm00001d024291" "Zm00001d024423" "Zm00001d038223" "Zm00001d027715" "Zm00001d047538" "Zm00001d005934" "Zm00001d020557" [17] "Zm00001d007301" "Zm00001d013960" "Zm00001d012791" "Zm00001d031943" "Zm00001d022396" "Zm00001d044686" "Zm00001d023312" "Zm00001d044285" [25]

enriched <- rba_panther_enrich(genes = genes, organism = 4577, annot_dataset = "molecular_function", cutoff = 0.05)

But it returns this error.

Performing over-representation enrichment analysis of 29 input genes of organism 4577 against molecular_function datasets. Error in .rba_skeleton(input_call) : Internal Error: Failed to parse the server's response. This is probably because the server has changed the response format. Please report this bug to us: Error in jsonlite::flatten(x$result) : is.data.frame(x) is not TRUE

Thanks in advance for any help with this issue.

agleto commented 2 years ago

sorry, already solved the problem; the annot_dataset was wrong, I should've wrote "GO:0003674"

moosa-r commented 2 years ago

Hi. Thank you for reporting this issue.

I've added this sentence to the function's manual and vignette articles to prevent the ambiguities:

Note that you should enter the "id" of the datasets, not its label (e.g. entering "biological_process" is incorrect, you should rather enter "GO:0008150").

Also, I've edited the response parser to correctly return any error messages from PANTHER's API. Now, in your case for instance, the following will be returned:

$search
$search$error
[1] "Error ontology type not supported"

$search$search_type
[1] "overrepresentation"
agleto commented 2 years ago

Hello again! I would like to ask if it is possible that the enrichment results also include the lists of genes that are overrepresented in each term. This would be very useful for downstream work.

Thanks a lot!

moosa-r commented 2 years ago

Hi. This PANTHER API endpoint does not return the overlapping genes between the user's input and the terms. I intend to keep rbioapi faithful to the corresponding resources, so I cannot implement your requested feature. Please see my answer to this issue for workarounds.