vfb_neo4j_query | R Documentation |
Query VFB's Neo4J graph database
vfb_neo4j_query(
x,
...,
path = "db/data",
server = getOption("vfbr.server.neo4j")
)
x |
A character query in Neo4J's cypher language |
... |
Additional arguments passed to |
path |
The relative path on the server for the Neo4J endpoint |
server |
The server's root URL |
Under the hood, this uses the RNeo4j::cypher
function to call
a Neo4J service running on the specified VFB server.
A data.frame of query results
https://neo4j.com/developer/cypher-query-language/
RNeo4j::RNeo4j
, RNeo4j::cypher
and
https://neo4j.com/docs/rest-docs/3.3/
Other query:
vfb_owl_query()
,
vfb_solr_query()
# ask for all neuronal classes
nclasses=vfb_neo4j_query("MATCH (n:Neuron:Class) RETURN n.label")
nrow(nclasses)
head(nclasses)
# Find all images with an associated neuronal class
q=paste("MATCH (p:Class:Neuron)<-[:INSTANCEOF]-(i:Individual:has_image)",
"RETURN distinct i.label, p.label, p.symbol;")
nclasses_image=vfb_neo4j_query(q)
nrow(nclasses_image)
head(nclasses_image)
# how many neuronal classes have images?
length(unique(nclasses_image$p.label))
# look at number of images for each neuronal class
# NB some of these are rather generic classes where
# a specific cell type annotation was not available.
table_by_nclass <- table(nclasses_image$p.label)
subset(as.data.frame(table_by_nclass), Freq>200)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.