jefferis / vfbr

R Package to Access the Virtual Fly Brain project API
http://jefferis.github.io/vfbr/
2 stars 1 forks source link

Cypher query to find all images with an associated neuronal class fails #22

Open jefferis opened 2 weeks ago

jefferis commented 2 weeks ago

This cypher example no longer works:

# Find all images with an associated neuronal class
q=paste0("MATCH (n:Class:VFB { label : 'neuron' })",
  "<-[:SUBCLASSOF*]-(p)<-[:INSTANCEOF]-(i:Individual) ",
  "RETURN distinct i.label, p.label;")
nclasses_image=vfb_neo4j_query(q)
nrow(nclasses_image)
head(nclasses_image)

@Robbie1977 @dosumis can you advise why? How should one do it now? Here is the formatted cypher query:

MATCH (n:Class:VFB { label : 'neuron' })<-[:SUBCLASSOF*]-(p)<-[:INSTANCEOF]-(i:Individual)
RETURN distinct i.label, p.label;
dosumis commented 2 weeks ago

Hi Greg,

It seems that the VFB semantic tag is no longer present. This works:

MATCH (n:Class { label : 'neuron' })<-[:SUBCLASSOF*]-(p)<-[:INSTANCEOF]-(i:Individual)
RETURN distinct i.label, p.label;

But you could also run

MATCH (p:Class:Neuron)<-[:INSTANCEOF]-(i:Individual:has_image)
RETURN distinct i.label, p.label

The :Neuron tag avoids having to query across the graph and :has_image avoids other data types.

For neurons with connectomics only

MATCH (p:Class:Neuron)<-[:INSTANCEOF]-(i:Individual:has_neuron_connectivity)
RETURN distinct i.label, p.label limit 5