Learn R Programming

traits (version 0.5.1)

traitbank: Search for traits from EOL's Traitbank

Description

Search for traits from EOL's Traitbank

Usage

traitbank(query, key = NULL, ...)

Value

a list

Arguments

query

(character) a query to the EOL Cypher service that holds Traitbank data. required. no default query given. see examples

key

(character) EOL Cypher query API key. required, either passed in or as an environment variable

...

Curl options passed on to verb-GET

Authentication

You'll need an EOL cypher key to use this function. Steps:

  1. Sign in to (register if necessary) your EOL account https://eol.org/users/sign_in.

  2. Send an email to the EOL administrator (hammockj AT si.edu) with your username and request that they make you a "power user".

  3. Get your key by visiting https://eol.org/services/authenticate

  4. Store your key in your .Renviron file or similar under the name "EOL_CYPHER_KEY" Hint: To do this, you can create or edit this file in your home directory, or use the shortcut usethis::edit_r_environ() and add a line like EOL_CYPHER_KEY="your_key_here"

  5. (not recommended alternative): you can pass your key to the key parameter, but we do not recommend doing that as you risk accidentally committing your key to the public web.

Details

traitbank is an interface to the EOL Cypher query. Note that the previous interface EOL had for Traits has been completely replaced - thus, this function is completely different. You no longer query by EOL page id, but using the query language for a database called Neo4J. See the docs for help. Later we plan to make a more user friendly interface to get Traitbank data that doesn't require knowing the Neo4J query syntax

References

https://github.com/EOL/eol_website/blob/master/doc/api.md https://github.com/EOL/eol_website/blob/master/doc/query-examples.md

Examples

Run this code
if (FALSE) {
# traitbank_query function
traitbank(query = "MATCH (n:Trait) RETURN n LIMIT 1;")

# traitbank function
res <- traitbank(query = "MATCH (n:Trait) RETURN n LIMIT 2;")
res
}

Run the code above in your browser using DataLab