Skip to content

Commit

Permalink
Merge pull request #340 from VirtualFlyBrain/vfb_geppetto_application
Browse files Browse the repository at this point in the history
changes from Vfb geppetto application
  • Loading branch information
Robbie1977 authored Jul 8, 2019
2 parents f9eaa38 + 5d20248 commit 34c019a
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ install:
- npm install jest@24.8.0 puppeteer@1.17.0 jest-puppeteer@3.9.0 babel-preset-env@1.6.0 url-join@4.0.0
script:
- echo -e "travis_fold:start:Docker_Build" || true
- travis_retry docker build -t=$REPO:$TAG --build-arg targetBranch=$TRAVIS_BRANCH --build-arg originBranch=$TRAVIS_PULL_REQUEST_BRANCH --build-arg defaultBranch=$DEFAULT_BRANCH $DOCKER_FOLDER || travis_terminate 1
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
- travis_retry docker build -t=$REPO:$TAG --build-arg targetBranch=$TRAVIS_BRANCH --build-arg originBranch=$BRANCH --build-arg defaultBranch=$DEFAULT_BRANCH $DOCKER_FOLDER || travis_terminate 1
- echo -e "travis_fold:end:Docker_Build" || true
- echo -e "travis_fold:start:Docker_Run" || true
- travis_retry docker run -t -dit --name=$CONTAINER_NAME -p 8080:8080 $REPO:$TAG || travis_terminate 1
Expand Down
36 changes: 30 additions & 6 deletions components/configuration/queryBuilderConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,48 @@ var queryResultsColMeta = [
"cssClassName": "query-results-name-column",
},
{
"columnName": "description",
"columnName": "expressed_in",
"order": 3,
"locked": false,
"visible": true,
"displayName": "Expressed_in",
"cssClassName": "query-results-expressed_in-column"
},
{
"columnName": "description",
"order": 4,
"locked": false,
"visible": true,
"displayName": "Definition",
"cssClassName": "query-results-description-column"
},
{
"columnName": "reference",
"order": 5,
"locked": false,
"visible": true,
"displayName": "Reference",
"cssClassName": "query-results-reference-column"
},
{
"columnName": "type",
"order": 4,
"order": 6,
"locked": false,
"visible": true,
"displayName": "Type",
"cssClassName": "query-results-type-column"
},
{
"columnName": "stage",
"order": 7,
"locked": false,
"visible": true,
"displayName": "Stage",
"cssClassName": "query-results-stage-column"
},
{
"columnName": "controls",
"order": 5,
"order": 8,
"locked": false,
"visible": false,
"customComponent": QueryResultsControlsComponent,
Expand All @@ -49,7 +73,7 @@ var queryResultsColMeta = [
},
{
"columnName": "images",
"order": 6,
"order": 9,
"locked": false,
"visible": true,
"customComponent": SlideshowImageComponent,
Expand All @@ -59,7 +83,7 @@ var queryResultsColMeta = [
},
{
"columnName": "score",
"order": 7,
"order": 10,
"locked": false,
"visible": true,
"displayName": "Score",
Expand All @@ -68,7 +92,7 @@ var queryResultsColMeta = [
];

// which columns to display in the results
var queryResultsColumns = ['name', 'description', 'type', 'images', 'score'];
var queryResultsColumns = ['name', 'expressed_in', 'description', 'reference', 'type', 'stage', 'images', 'score'];

var queryResultsControlConfig = {
"Common": {
Expand Down
11 changes: 11 additions & 0 deletions css/VFBMain.less
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,14 @@
.griddle-body {
font-size: 14px !important;
}

.query-results-slick-image img {
margin-left: auto;
margin-right: auto;
}

#querybuilder .griddle td {
min-width: 14VW;
}


34 changes: 20 additions & 14 deletions model/vfb.xmi
Original file line number Diff line number Diff line change
Expand Up @@ -299,57 +299,63 @@
</queries>
<queries
xsi:type="gep_2:CompoundQuery"
name="Test Query for exp from anatomy with warning"
name="Query for exp from anatomy with warning"
description="">
<queryChain
xsi:type="gep_2:SimpleQuery"
name="Test Query for Exp from Anatomy"
description="Test Query for Exp from Anatomy"
returnType="//@libraries.3/@types.0"
query="MATCH (anat:Class) WHERE anat.short_form IN $ARRAY_ID_RESULTS OPTIONAL MATCH (ep:Class)&lt;-[ar:overlaps|part_of]-(:Individual)-[:INSTANCEOF]->(anat) WITH DISTINCT collect(ar.pub) as pubs, anat, ep UNWIND pubs as p MATCH (pub:Individual:pub { short_form: p}) WITH anat, ep, collect({ core: { short_form: pub.short_form, label: coalesce(pub.label,''), iri: pub.iri, types: labels(pub) } , PubMed: coalesce(pub.PMID, ''), FlyBase: coalesce(pub.FlyBase, ''), DOI: coalesce(pub.DOI, '') }) as pubs OPTIONAL MATCH (anat)&lt;-[:has_source|SUBCLASSOF|INSTANCEOF*]-(i:Individual)&lt;-[:depicts]-(channel:Individual)-[irw:in_register_with]->(template:Individual)-[:depicts]->(template_anat:Individual) WITH template, channel, template_anat, irw, anat, ep, pubs , i limit 5 OPTIONAL MATCH (channel)-[:is_specified_output_of]->(technique:Class) WITH CASE WHEN channel IS NULL THEN null ELSE { anatomy: { short_form: i.short_form, label: coalesce(i.label,''), iri: i.iri, types: labels(i) } , channel_image: { channel: { short_form: channel.short_form, label: coalesce(channel.label,''), iri: channel.iri, types: labels(channel) } , imaging_technique: { short_form: technique.short_form, label: coalesce(technique.label,''), iri: technique.iri, types: labels(technique) } ,image: { template_channel : { short_form: template.short_form, label: coalesce(template.label,''), iri: template.iri, types: labels(template) } , template_anatomy: { short_form: template_anat.short_form, label: coalesce(template_anat.label,''), iri: template_anat.iri, types: labels(template_anat) } ,image_folder: irw.folder, index: coalesce(irw.index, []) + [] }} } END AS anatomy_channel_image ,anat,ep,pubs UNWIND pubs as p with anatomy_channel_image ,anat,ep,COLLECT(p.core.label) as refs RETURN ep.short_form as class_Id, ep.label as class_Name, 'Expressed in ' + coalesce(anat.label,'') + '&lt;br>&lt;small>Note: expression in this cell may be localised to regions of the cell that do not overlap the queried structure&lt;/small>' as class_Desc, refs as class_Type, CASE WHEN anatomy_channel_image IS NULL THEN [] ELSE COLLECT (DISTINCT { image_name: anatomy_channel_image.anatomy.label, image_id: anatomy_channel_image.anatomy.short_form, image_thumb: replace(anatomy_channel_image.image.image_folder,'http:','https:') + '/thumbnailT.png', template_id: anatomy_channel_image.image.template_anatomy.short_form}) END AS inds"
countQuery="MATCH (anat:Class) WHERE anat.short_form IN $ARRAY_ID_RESULTS OPTIONAL MATCH (ep:Class)&lt;-[ar:overlaps|part_of]-(:Individual)-[:INSTANCEOF]->(anat) RETURN count(ep) as count"/>
query="MATCH (ep:Class)&lt;-[ar:overlaps|part_of]-(:Individual)-[:INSTANCEOF]->(anat:Class) WHERE anat.short_form in $ARRAY_ID_RESULTS WITH DISTINCT collect(ar.pub) as pubs, anat, ep UNWIND pubs as p MATCH (pub:pub { short_form: p}) WITH anat, ep, collect({ core: { short_form: pub.short_form, label: coalesce(pub.label,''), iri: pub.iri, types: labels(pub) } , PubMed: coalesce(pub.PMID, ''), FlyBase: coalesce(pub.FlyBase, ''), DOI: coalesce(pub.DOI, '') }) as pubs OPTIONAL MATCH (ep)&lt;-[:has_source|SUBCLASSOF|INSTANCEOF*]-(i:Individual)&lt;-[:depicts]-(channel:Individual)-[irw:in_register_with]->(template:Individual)-[:depicts]->(template_anat:Individual) WITH template, channel, template_anat, irw, anat, ep, pubs , i OPTIONAL MATCH (channel)-[:is_specified_output_of]->(technique:Class) WITH CASE WHEN channel IS NULL THEN [] ELSE COLLECT({ anatomy: { short_form: i.short_form, label: coalesce(i.label,''), iri: i.iri, types: labels(i) } , channel_image: { channel: { short_form: channel.short_form, label: coalesce(channel.label,''), iri: channel.iri, types: labels(channel) } , imaging_technique: { short_form: technique.short_form, label: coalesce(technique.label,''), iri: technique.iri, types: labels(technique) } ,image: { template_channel : { short_form: template.short_form, label: coalesce(template.label,''), iri: template.iri, types: labels(template) } , template_anatomy: { short_form: template_anat.short_form, label: coalesce(template_anat.label,''), iri: template_anat.iri, types: labels(template_anat) } ,image_folder: irw.folder, index: coalesce(irw.index, []) + [] }} }) END AS anatomy_channel_image ,anat,ep,pubs RETURN { short_form: anat.short_form, label: coalesce(anat.label + ' Note: expression in this cell may be localised to regions of the cell that do not overlap the queried structure.',''), iri: anat.iri, types: labels(anat) } as anatomy, { short_form: ep.short_form, label: coalesce(ep.label,''), iri: ep.iri, types: labels(ep) } AS expression_pattern, 'Get JSON for anat_2_ep query' AS query, '6959794' AS version , pubs, anatomy_channel_image"
countQuery="MATCH (ep:Class)&lt;-[ar:overlaps|part_of]-(:Individual)-[:INSTANCEOF]->(anat:Class) WHERE anat.short_form in $ARRAY_ID_RESULTS WITH DISTINCT RETURN count(ep) as count"/>
<queryChain
xsi:type="gep_2:ProcessQuery"
name="Process Images"
id="vfb_query_schema_processor"
name="vfb_query schema processor"
description="vfb_query schema processor"
runForCount="false"
returnType="//@libraries.3/@types.1"
queryProcessorId="vfbCreateImagesForQueryResultsQueryProcessor"/>
queryProcessorId="neo4jQueryProcessor"/>
</queries>
<queries
xsi:type="gep_2:CompoundQuery"
name="Test Query for exp from anatomy without warning"
name="Query for exp from anatomy without warning"
description="">
<queryChain
xsi:type="gep_2:SimpleQuery"
name="Test Query for Exp from Anatomy"
description="Test Query for Exp from Anatomy"
returnType="//@libraries.3/@types.0"
query="MATCH (anat:Class) WHERE anat.short_form IN $ARRAY_ID_RESULTS OPTIONAL MATCH (ep:Class)&lt;-[ar:overlaps|part_of]-(:Individual)-[:INSTANCEOF]->(anat) WITH DISTINCT COLLECT(ar.pub) as pubs, anat, ep UNWIND pubs as p MATCH (pub:Individual:pub { short_form: p}) WITH anat, ep, collect({ core: { short_form: pub.short_form, label: coalesce(pub.label,''), iri: pub.iri, types: labels(pub) } , PubMed: coalesce(pub.PMID, ''), FlyBase: coalesce(pub.FlyBase, ''), DOI: coalesce(pub.DOI, '') }) as pubs OPTIONAL MATCH (anat)&lt;-[:has_source|SUBCLASSOF|INSTANCEOF*]-(i:Individual)&lt;-[:depicts]-(channel:Individual)-[irw:in_register_with]->(template:Individual)-[:depicts]->(template_anat:Individual) WITH template, channel, template_anat, irw, anat, ep, pubs , i limit 5 OPTIONAL MATCH (channel)-[:is_specified_output_of]->(technique:Class) WITH CASE WHEN channel IS NULL THEN null ELSE { anatomy: { short_form: i.short_form, label: coalesce(i.label,''), iri: i.iri, types: labels(i) } , channel_image: { channel: { short_form: channel.short_form, label: coalesce(channel.label,''), iri: channel.iri, types: labels(channel) } , imaging_technique: { short_form: technique.short_form, label: coalesce(technique.label,''), iri: technique.iri, types: labels(technique) } ,image: { template_channel : { short_form: template.short_form, label: coalesce(template.label,''), iri: template.iri, types: labels(template) } , template_anatomy: { short_form: template_anat.short_form, label: coalesce(template_anat.label,''), iri: template_anat.iri, types: labels(template_anat) } ,image_folder: irw.folder, index: coalesce(irw.index, []) + [] }} } END AS anatomy_channel_image ,anat,ep,pubs UNWIND pubs as p with anatomy_channel_image ,anat,ep,COLLECT(p.core.label) as refs RETURN ep.short_form as class_Id, ep.label as class_Name, 'Expressed in ' + coalesce(anat.label,'') as class_Desc, refs as class_Type, CASE WHEN anatomy_channel_image IS NULL THEN [] ELSE COLLECT (DISTINCT { image_name: anatomy_channel_image.anatomy.label, image_id: anatomy_channel_image.anatomy.short_form, image_thumb: replace(anatomy_channel_image.image.image_folder,'http:','https:') + '/thumbnailT.png', template_id: anatomy_channel_image.image.template_anatomy.short_form}) END AS inds"
countQuery="MATCH (anat:Class) WHERE anat.short_form IN $ARRAY_ID_RESULTS OPTIONAL MATCH (ep:Class)&lt;-[ar:overlaps|part_of]-(:Individual)-[:INSTANCEOF]->(anat) RETURN count(ep) as count"/>
query="MATCH (ep:Class)&lt;-[ar:overlaps|part_of]-(:Individual)-[:INSTANCEOF]->(anat:Class) WHERE anat.short_form in $ARRAY_ID_RESULTS WITH DISTINCT collect(ar.pub) as pubs, anat, ep UNWIND pubs as p MATCH (pub:pub { short_form: p}) WITH anat, ep, collect({ core: { short_form: pub.short_form, label: coalesce(pub.label,''), iri: pub.iri, types: labels(pub) } , PubMed: coalesce(pub.PMID, ''), FlyBase: coalesce(pub.FlyBase, ''), DOI: coalesce(pub.DOI, '') }) as pubs OPTIONAL MATCH (ep)&lt;-[:has_source|SUBCLASSOF|INSTANCEOF*]-(i:Individual)&lt;-[:depicts]-(channel:Individual)-[irw:in_register_with]->(template:Individual)-[:depicts]->(template_anat:Individual) WITH template, channel, template_anat, irw, anat, ep, pubs , i OPTIONAL MATCH (channel)-[:is_specified_output_of]->(technique:Class) WITH CASE WHEN channel IS NULL THEN [] ELSE COLLECT({ anatomy: { short_form: i.short_form, label: coalesce(i.label,''), iri: i.iri, types: labels(i) } , channel_image: { channel: { short_form: channel.short_form, label: coalesce(channel.label,''), iri: channel.iri, types: labels(channel) } , imaging_technique: { short_form: technique.short_form, label: coalesce(technique.label,''), iri: technique.iri, types: labels(technique) } ,image: { template_channel : { short_form: template.short_form, label: coalesce(template.label,''), iri: template.iri, types: labels(template) } , template_anatomy: { short_form: template_anat.short_form, label: coalesce(template_anat.label,''), iri: template_anat.iri, types: labels(template_anat) } ,image_folder: irw.folder, index: coalesce(irw.index, []) + [] }} }) END AS anatomy_channel_image ,anat,ep,pubs RETURN { short_form: anat.short_form, label: coalesce(anat.label,''), iri: anat.iri, types: labels(anat) } as anatomy, { short_form: ep.short_form, label: coalesce(ep.label,''), iri: ep.iri, types: labels(ep) } AS expression_pattern, 'Get JSON for anat_2_ep query' AS query, '6959794' AS version , pubs, anatomy_channel_image"
countQuery="MATCH (ep:Class)&lt;-[ar:overlaps|part_of]-(:Individual)-[:INSTANCEOF]->(anat:Class) WHERE anat.short_form in $ARRAY_ID_RESULTS WITH DISTINCT RETURN count(ep) as count"/>
<queryChain
xsi:type="gep_2:ProcessQuery"
name="Process Images"
id="vfb_query_schema_processor"
name="vfb_query schema processor"
description="vfb_query schema processor"
runForCount="false"
returnType="//@libraries.3/@types.1"
queryProcessorId="vfbCreateImagesForQueryResultsQueryProcessor"/>
queryProcessorId="neo4jQueryProcessor"/>
</queries>
<queries
xsi:type="gep_2:CompoundQuery"
name="Test Query for anatomy from expression "
name="Query for anatomy from expression "
description="">
<queryChain
xsi:type="gep_2:SimpleQuery"
name="Test Query for Anatomy from Exp"
description="Test Query for Anatomy from Exp"
returnType="//@libraries.3/@types.0"
query="MATCH (ep:Expression_pattern:Class)&lt;-[ar:overlaps|part_of]-(anoni:Individual)-[:INSTANCEOF]->(anat:Class) WHERE ep.short_form in ['$ID'] WITH anoni, anat, ar, ep OPTIONAL MATCH (p:pub:Individual { short_form: ar.pub}) WITH ep, anat, anoni, { core: { short_form: p.short_form, label: coalesce(p.label,''), iri: p.iri, types: labels(p) } , PubMed: coalesce(p.PMID, ''), FlyBase: coalesce(p.FlyBase, ''), DOI: coalesce(p.DOI, '') } AS pub OPTIONAL MATCH (anoni)-[r:Related]->(o:FBdv) WITH CASE WHEN o IS NULL THEN [] ELSE COLLECT ({ relation: { label: r.label, iri: r.uri, type: type(r) } , object: { short_form: o.short_form, label: coalesce(o.label,''), iri: o.iri, types: labels(o) } }) END AS stages ,anoni,anat,pub,ep OPTIONAL MATCH (ep)&lt;-[:has_source|SUBCLASSOF|INSTANCEOF*]-(i:Individual)&lt;-[:depicts]-(channel:Individual)-[irw:in_register_with]->(template:Individual)-[:depicts]->(template_anat:Individual) WITH ep, template, channel, template_anat, irw, anoni, anat, pub, stages , i OPTIONAL MATCH (channel)-[:is_specified_output_of]->(technique:Class) WITH CASE WHEN channel IS NULL THEN [] ELSE COLLECT({ anatomy: { short_form: i.short_form, label: coalesce(i.label,''), iri: i.iri, types: labels(i) } , channel_image: { channel: { short_form: channel.short_form, label: coalesce(channel.label,''), iri: channel.iri, types: labels(channel) } , imaging_technique: { short_form: technique.short_form, label: coalesce(technique.label,''), iri: technique.iri, types: labels(technique) } ,image: { template_channel : { short_form: template.short_form, label: coalesce(template.label,''), iri: template.iri, types: labels(template) } , template_anatomy: { short_form: template_anat.short_form, label: coalesce(template_anat.label,''), iri: template_anat.iri, types: labels(template_anat) } ,image_folder: irw.folder, index: coalesce(irw.index, []) + [] }} }) END AS anatomy_channel_image ,anoni,anat,pub,stages,ep UNWIND anatomy_channel_image as images WITH images as anatomy_channel_image,anat,ep,pub.core.label as refs RETURN ep.short_form as class_Id, ep.label as class_Name, 'Expressed in ' + coalesce(anat.label,'') as class_Desc, COLLECT(DISTINCT refs) as class_Type, CASE WHEN anatomy_channel_image IS NULL THEN [] ELSE COLLECT (DISTINCT { image_name: anatomy_channel_image.anatomy.label, image_id: anatomy_channel_image.anatomy.short_form, image_thumb: replace(anatomy_channel_image.image.image_folder,'http:','https:') + '/thumbnailT.png', template_id: anatomy_channel_image.image.template_anatomy.short_form}) END AS inds"
query="MATCH (ep:Expression_pattern:Class)&lt;-[ar:overlaps|part_of]-(anoni:Individual)-[:INSTANCEOF]->(anat:Class) WHERE ep.short_form in ['$ID'] WITH anoni, anat, ar OPTIONAL MATCH (p:pub { short_form: ar.pub}) WITH anat, anoni, { core: { short_form: p.short_form, label: coalesce(p.label,''), iri: p.iri, types: labels(p) } , PubMed: coalesce(p.PMID, ''), FlyBase: coalesce(p.FlyBase, ''), DOI: coalesce(p.DOI, '') } AS pub OPTIONAL MATCH (anoni)-[r:Related]->(o:FBdv) WITH CASE WHEN o IS NULL THEN [] ELSE COLLECT ({ relation: { label: r.label, iri: r.uri, type: type(r) } , object: { short_form: o.short_form, label: coalesce(o.label,''), iri: o.iri, types: labels(o) } }) END AS stages ,anoni,anat,pub OPTIONAL MATCH (anat:Synaptic_neuropil)&lt;-[:has_source|SUBCLASSOF|INSTANCEOF*]-(i:Individual)&lt;-[:depicts]-(channel:Individual)-[irw:in_register_with]->(template:Individual)-[:depicts]->(template_anat:Individual) WITH template, channel, template_anat, irw, anoni, anat, pub, stages , i OPTIONAL MATCH (channel)-[:is_specified_output_of]->(technique:Class) WITH CASE WHEN channel IS NULL THEN [] ELSE COLLECT({ anatomy: { short_form: i.short_form, label: coalesce(i.label,''), iri: i.iri, types: labels(i) } , channel_image: { channel: { short_form: channel.short_form, label: coalesce(channel.label,''), iri: channel.iri, types: labels(channel) } , imaging_technique: { short_form: technique.short_form, label: coalesce(technique.label,''), iri: technique.iri, types: labels(technique) } ,image: { template_channel : { short_form: template.short_form, label: coalesce(template.label,''), iri: template.iri, types: labels(template) } , template_anatomy: { short_form: template_anat.short_form, label: coalesce(template_anat.label,''), iri: template_anat.iri, types: labels(template_anat) } ,image_folder: irw.folder, index: coalesce(irw.index, []) + [] }} }) END AS anatomy_channel_image ,anoni,anat,pub,stages RETURN { short_form: anat.short_form, label: coalesce(anat.label,''), iri: anat.iri, types: labels(anat) } AS anatomy, 'Get JSON for ep_2_anat query' AS query, '6959794' AS version , pub, stages, anatomy_channel_image"
countQuery="MATCH (ep:Expression_pattern:Class)&lt;-[ar:overlaps|part_of]-(anoni:Individual)-[:INSTANCEOF]->(anat:Class) WHERE ep.short_form in ['$ID'] RETURN count(anat) as count"/>
<queryChain
xsi:type="gep_2:ProcessQuery"
name="Process Images"
id="vfb_query_schema_processor"
name="vfb_query schema processor"
description="vfb_query schema processor"
runForCount="false"
returnType="//@libraries.3/@types.1"
queryProcessorId="vfbCreateImagesForQueryResultsQueryProcessor"/>
queryProcessorId="neo4jQueryProcessor"/>
</queries>
<fetchVariableQuery
xsi:type="gep_2:CompoundQuery"
Expand Down

0 comments on commit 34c019a

Please sign in to comment.