Search Mailing List Archives
[bioontology-support] API Example Code in R
Jennifer Leigh Vendetti
vendetti at stanford.edu
Fri Mar 10 12:54:03 PST 2017
Hi again Scott,
Turns out there is someone in the dept. here that knows R, and sent this comment about your code:
"The problem is in his code. He creates an array of sentences initially, and then loops through this array and tries to annotate one sentence at a time. The problem is that when he invokes the postForm function, he is passing the whole array (variable ‘text’) instead of one sentence (variable ‘curr_sentence’)."
result <- postForm(url,
Hope that helps.
On Mar 10, 2017, at 12:29 PM, Jennifer Leigh Vendetti <vendetti at stanford.edu<mailto:vendetti at stanford.edu>> wrote:
On Mar 10, 2017, at 10:39 AM, Scott Keating <sjk3001 at med.cornell.edu<mailto:sjk3001 at med.cornell.edu>> wrote:
I am trying to get the annotator to work using the R programming system. The API Documentation found here<http://data.bioontology.org/documentation> states that sample code can be found in other languages. Do you happen to have example code written in R that I might be able to use as a reference?
This is our GitHub repository that contains sample code in various languages:
We didn’t provide anything in R (I don’t know of anyone on our current development team that knows R). There is however, a link in the README.md file that points to an R project authored by Cristian R. Munteanu:
It looks like he’s interacting with the Recommender instead of the Annotator, but I imagine the code may be of use to you. There is also an old page on our wiki with some example Annotator code written in R:
The caveat here being that the page is roughly 4 years old, and I can see that it’s using an older version of our REST API. So, this one may not turn out to be that useful.
I am attempting to annotate patient electronic health record data for symptoms of adverse drug events using the diabetes ontology. When I run my code it states “Error: Bad Request”, which I assume has something to do with my API key, which I have verified as correct and properly linked to my account. Any pointers?
You mentioned that you think there’s a problem with your API key. Just curious - did you try to execute a simple curl request outside of your program to verify that your API key is working, e.g.:
bioontology-support mailing list
bioontology-support at lists.stanford.edu<mailto:bioontology-support at lists.stanford.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the bioontology-support