VirtualFlyBrain / VFB_connect

A library for querying VFB servers (neo4j, owlery, solr)
GNU General Public License v3.0
4 stars 1 forks source link

Add find common ancestors query #51

Open dosumis opened 3 years ago

dosumis commented 3 years ago

LCA would be better, but not sure possible

Match (n:Class { label: 'EB-PB 1 glomerulus-D/Vgall neuron'}),
 (m:Class{ label:'EBw.AMP.s-Dga-s.b neuron'})
MATCH path=(n)-[:SUBCLASSOF*0..3]->(MRCA)<-[:SUBCLASSOF*0..3]-(m) 
return collect(MRCA.label)

returning graph

WITH ['EBw.AMP.s-Dga-s.b neuron',
 'EB-PB 1 glomerulus-D/Vgall neuron',
 'EB-PB glomerulus 6-Vgall neuron',
 'EB-PB 1 glomerulus-D/Vgall neuron',
 'EB-PB 1 glomerulus-D/Vgall neuron']  as fu 
MATCH (n:Class), (m:Class)
WHERE n.label in fu and m.label in fu
MATCH path=(n)-[:SUBCLASSOF*0..3]->(MRCA)<-[:SUBCLASSOF*0..3]-(m) 
return distinct path
dosumis commented 3 years ago

This is potentially very useful for NBLAST results.