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

Parse Error #9

Closed CucinaGiorgia closed 1 year ago

CucinaGiorgia commented 1 year ago

I encountered a parse error while performing "Physical Entities". Is there a way to fix it?

> rba_reactome_participants(event_id = "Q9BXM7-1", 
+                           only_physical_entities = TRUE)
Retrieving 'Physical Entities' Participants of Reactome event Q9BXM7-1.
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 : parse error: premature EOF

                     (right here) ------^
moosa-r commented 1 year ago

Hi.

The input of this function is a Reactome event, but you supplied a UniProt id here. Please see the examples in the function's manual.

You can try the rba_reactome_mapping function:

# map an external id to Reactome database:
rba_reactome_mapping("Q9BXM7", resource = "uniprot", "reactions")

     dbId                                                    displayName          stId     stIdVersion isInDisease isInferred
1 5205652     Pink1 recruits Parkin to the outer mitochondrial membrane. R-HSA-5205652 R-HSA-5205652.2       FALSE      FALSE
2 5205661      Pink1 is recruited from the cytoplasm to the mitochondria R-HSA-5205661 R-HSA-5205661.2       FALSE      FALSE
3 5205672            Uncleaved Pink1 accumulates in damaged mitochondria R-HSA-5205672 R-HSA-5205672.2       FALSE      FALSE
4 5205681                       Pink1 is cleaved on healthy mitochondria R-HSA-5205681 R-HSA-5205681.2       FALSE      FALSE
5 5205682 Parkin promotes the ubiquitination of mitochondrial substrates R-HSA-5205682 R-HSA-5205682.4       FALSE      FALSE
6 9621289             PINK1 gene expression is stimulated by FOXO1,FOXO3 R-HSA-9621289 R-HSA-9621289.1       FALSE       TRUE
                                                            name releaseDate  speciesName isChimeric   category className
1     Pink1 recruits Parkin to the outer mitochondrial membrane.  2015-09-22 Homo sapiens      FALSE    binding  Reaction
2      Pink1 is recruited from the cytoplasm to the mitochondria  2015-09-22 Homo sapiens      FALSE transition  Reaction
3            Uncleaved Pink1 accumulates in damaged mitochondria  2015-09-22 Homo sapiens      FALSE transition  Reaction
4                       Pink1 is cleaved on healthy mitochondria  2015-09-22 Homo sapiens      FALSE transition  Reaction
5 Parkin promotes the ubiquitination of mitochondrial substrates  2015-09-22 Homo sapiens      FALSE transition  Reaction
6             PINK1 gene expression is stimulated by FOXO1,FOXO3  2018-12-13 Homo sapiens      FALSE    omitted  Reaction
    schemaClass
1      Reaction
2      Reaction
3      Reaction
4      Reaction
5      Reaction
6 BlackBoxEvent
rba_reactome_mapping("Q9BXM7", resource = "uniprot", "pathways")

     dbId                                     displayName          stId     stIdVersion isInDisease isInferred
1 5205685                   PINK1-PRKN Mediated Mitophagy R-HSA-5205685 R-HSA-5205685.4       FALSE      FALSE
2 9614657 FOXO-mediated transcription of cell death genes R-HSA-9614657 R-HSA-9614657.1       FALSE      FALSE
                                             name releaseDate  speciesName hasDiagram hasEHLD className schemaClass
1                   PINK1-PRKN Mediated Mitophagy  2015-09-22 Homo sapiens      FALSE   FALSE   Pathway     Pathway
2 FOXO-mediated transcription of cell death genes  2018-12-13 Homo sapiens       TRUE   FALSE   Pathway     Pathway

# Also, you can see the complexes that your molecule participates into:

rba_reactome_participants(event_id = "R-HSA-5205637", only_physical_entities = TRUE)
moosa-r commented 1 year ago

Also, This error is because sometimes APIs return an empty body instead of a non-200 status response. I made a small change to return NULL on such instances instead of trying to parse the expected response.

Thank you for reporting this issue.