vfb_neo4j_query: Query VFB's Neo4J graph database

View source: R/vfb_query.R

vfb_neo4j_queryR Documentation

Query VFB's Neo4J graph database

Description

Query VFB's Neo4J graph database

Usage

vfb_neo4j_query(
  x,
  ...,
  path = "db/data",
  server = getOption("vfbr.server.neo4j")
)

Arguments

x

A character query in Neo4J's cypher language

...

Additional arguments passed to neo2R::cypher()

path

The relative path on the server for the Neo4J endpoint

server

The server's root URL

Details

Under the hood, this uses the RNeo4j::cypher function to call a Neo4J service running on the specified VFB server.

Value

A data.frame of query results

References

https://neo4j.com/developer/cypher-query-language/

See Also

RNeo4j::RNeo4j, RNeo4j::cypher and https://neo4j.com/docs/rest-docs/3.3/

Other query: vfb_owl_query(), vfb_solr_query()

Examples


# 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)


jefferis/vfbr documentation built on Sept. 24, 2024, 1:37 p.m.