VirtualFlyBrain / VFB_json_schema

VFB json schema spec + code for rolling queries producing VFB json schema + related integration tests
Apache License 2.0
0 stars 0 forks source link

Add queries for dataset by content #71

Open dosumis opened 4 years ago

dosumis commented 4 years ago
dosumis commented 4 years ago

Query for dataset by content (using labels on individuals)

MATCH (ds:DataSet) where (ds)<-[:has_source]-(:Individual:Neuron) return distinct ds

Query dataset by technique:

MATCH (ds:DataSet) where (ds)<-[:has_source]-(:Individual)
<-[:depicts]-(:Individual)-[:is_specified_output_of]->(:Class { label: 'confocal microscopy'})
 RETURN distinct ds
dosumis commented 4 years ago

Dataset return could usefully include label badges - although these need to be reduced to some minimal set.

MATCH (ds:DataSet) 
WHERE ds.short_form = 'Xu2020Neurons' 
WITH ds MATCH (ds)<-[:has_source]-(i:Individual)
RETURN ds.short_form, ds.label, 
REDUCE(s = [], tags IN COLLECT(distinct labels(i)) | s + tags)
ds.short_form ds.label REDUCE(s = [], tags IN COLLECT(distinct labels(i)) \ s + tags)
Xu2020Neurons JRC_FlyEM_Hemibrain neurons Version 1.0.1 [Individual, VFB, _Individual, Neuron, Anatomy, Cell, Entity, Individual, VFB, _Individual, Neuron, Anatomy, Cell, Octopaminergic, Entity, Individual, VFB, _Individual, Neuron, Anatomy, Cell, Glutamatergic, Entity, Individual, VFB, _Individual, Neuron, Sensory_neuron, Peptidergic_neuron, Anatomy, Cell, Entity, Individual, VFB, _Individual, Neuron, Anatomy, Cell, GABAergic, Entity, Individual, VFB, _Individual, Neuron, Anatomy, Cell, Dopaminergic, Entity, Individual, VFB, _Individual, Neuron, Anatomy, Cell, Cholinergic, Entity, Individual, VFB, _Individual, Neuron, Anatomy, Cell, Serotonergic, Entity, Individual, VFB, _Individual, Neuron, Anatomy, Cell, GABAergic, Octopaminergic, Entity]
ds.short_form ds.label REDUCE(s = [], tags IN COLLECT(distinct labels(i)) \ s + tags)
Xie2018 Split GAL4 lines for dopaminergic neurons, Xie2018 [Individual, VFB, _Individual, Anatomy, Expression_pattern, Split, Entity]

(can be made into non-redundant set with APOC - trickier to do without APOC).

dosumis commented 4 years ago

With APOC

MATCH (ds:DataSet) 
WHERE ds.short_form = 'CarreiraRosario2018' 
WITH ds MATCH (ds)<-[:has_source]-(i:Individual)
RETURN ds.short_form, ds.label, 
apoc.coll.toSet(REDUCE(s = [], tags IN COLLECT(distinct labels(i)) | s + tags)) as ulabs
ds.short_form ds.label ulabs
"CarreiraRosario2018" "CarreiraRosario2018" ["Entity", "Cell", "Individual", "Anatomy", "Nervous_system", "Neuron", "Larva", "Cholinergic"]