knitr::opts_chunk$set(echo = TRUE)

Troubleshooting.

If we encounter problems, such as an empty result, we can always ask for Monarch's response to our query.

Response from Monarch Initiative.

library(monarchr)
gene <- "NCBIGene:8314"
results <- bioentity_homologs(gene)

We returned the response as a monarch_api (S3) class with its own print method

class(results$response)

The print method only shows the URL and highest 2 levels of the contents.

results$response

To view at an alternative depth, supply the depth setting to the print method.

# print(results$response, depth=3) # not run.

Troubleshooting the server status

class(results$response$response) # this is the response we saved from the call to httr GET(url)
results$response$url
results$response$response$status_code
#str(results$response$response)
#results$response$response$headers
#results$response$response$request

The server should have responded with an OK (200) status. If not, we can confirm the URL ourselves by pasting into a browser, or look at the response and response headers for more info (courtesy of httr).

Viewing JSON directly from the server.

We can use the URL at the top of monarchr's summary of the response to see the JSON results directly from the server.

(this is easier to view in Firefox):

[https://api.monarchinitiative.org/api/bioentity/gene/NCBIGene%3A8314/homologs/?rows=100&fetch_objects=true&format=json]

Viewing HTML on server.

If you prefer to see the expected results as HTML, note how the example of looking up NCBIGene:8314 on Monarch Initiative website ended up at a table for Monarch's preferred ID (HGNC:950).

[https://monarchinitiative.org/gene/HGNC:950#homologs]

Replacing HGNC:950 with NCBIGene ID, we are successfully directed to the same view.

[https://monarchinitiative.org/gene/NCBIGene:8314#homologs]

Verifying your search returns something consistent with searching Monarch Initiative's website directly.

  1. Go to Monarch's front page: [https://monarchinitiative.org/]
  2. In the search box, enter and search for: NCBIGene:8314.
  3. Select the exact match (of thousands) from Homo sapiens. (This is the first match and shows the gene name is BAP1.)
  4. Select homologs from the tabs at the top of the next page.

You should see something similar to the following view.

Homologs as seen on Monarch Inititiative Website.

In this case, the results shoud be consistent with what we see below.

results$homologs


charlieccarey/monarchr documentation built on Dec. 12, 2023, 12:57 p.m.