Skip to content

Commit

Permalink
Merge pull request #860 from VirtualFlyBrain/development-sync-3068
Browse files Browse the repository at this point in the history
sync: development  with development-sync-3068
  • Loading branch information
Robbie1977 authored Dec 26, 2020
2 parents caa8126 + 3b3d2f5 commit 99589bc
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 16 deletions.
10 changes: 6 additions & 4 deletions components/VFBMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -1253,10 +1253,12 @@ class VFBMain extends React.Component {
if ( window.XMLHttpRequest ) {
var xhr = new XMLHttpRequest();
xhr.onload = function () {
document.title = 'Virtual Fly Brain (' + this.responseXML.title + ')';
document.querySelector('meta[property="og:title"]').setAttribute("content",this.responseXML.title);
document.querySelector('meta[name="description"]').setAttribute("content",this.responseXML.body.innerText);
document.querySelector('meta[property="og:description"]').setAttribute("content",this.responseXML.body.innerText);
if (this.responseXML.title.indexOf("404 Not Found") < 0) {
document.title = 'Virtual Fly Brain (' + this.responseXML.title + ')';
document.querySelector('meta[property="og:title"]').setAttribute("content",this.responseXML.title);
document.querySelector('meta[name="description"]').setAttribute("content",this.responseXML.body.innerText);
document.querySelector('meta[property="og:description"]').setAttribute("content",this.responseXML.body.innerText);
}
}
xhr.open( 'GET', 'https://virtualflybrain.org/data/VFB/json/' + this.idFromURL + '.html')
xhr.responseType = 'document';
Expand Down
20 changes: 10 additions & 10 deletions components/configuration/VFBMain/queryBuilderConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var queryResultsColMeta = [
},
{
"columnName": "type",
"order": 2,
"order": 3,
"locked": false,
"visible": true,
"customComponent": QueryLinkComponent,
Expand All @@ -53,12 +53,12 @@ var queryResultsColMeta = [
},
{
"columnName": "parent",
"order": 12,
"order": 3,
"locked": false,
"visible": true,
"customComponent": QueryLinkComponent,
"actions": "window.addVfbId('$entity$');",
"entityIndex": 2,
"entityIndex": 1,
"entityDelimiter": "----",
"displayName": "Parent",
"cssClassName": "query-results-type-column",
Expand Down Expand Up @@ -123,7 +123,7 @@ var queryResultsColMeta = [
"order": 7,
"locked": false,
"visible": true,
"displayName": "Downstream",
"displayName": "#_Downstream_Synapses",
"cssClassName": "query-results-stage-column",
"sortDirectionCycle": ['asc', 'desc', null]
},
Expand All @@ -132,7 +132,7 @@ var queryResultsColMeta = [
"order": 8,
"locked": false,
"visible": true,
"displayName": "Tbars",
"displayName": "#_Tbars",
"cssClassName": "query-results-stage-column",
"sortDirectionCycle": ['asc', 'desc', null]
},
Expand All @@ -141,7 +141,7 @@ var queryResultsColMeta = [
"order": 9,
"locked": false,
"visible": true,
"displayName": "Upstream",
"displayName": "#_Upstream_Synapses",
"cssClassName": "query-results-stage-column",
"sortDirectionCycle": ['asc', 'desc', null]
},
Expand All @@ -156,20 +156,20 @@ var queryResultsColMeta = [
},
{
"columnName": "neuron_B",
"order": 11,
"order": 1,
"locked": false,
"visible": true,
"customComponent": QueryLinkComponent,
"actions": "window.addVfbId('$entity$');",
"entityIndex": 1,
"entityIndex": 2,
"entityDelimiter": "----",
"displayName": "Neuron_B",
"displayName": "Partner_Neuron",
"cssClassName": "query-results-name-column",
"sortDirectionCycle": ['asc', 'desc', null]
},
{
"columnName": "region",
"order": 11,
"order": 2,
"locked": false,
"visible": true,
"customComponent": QueryLinkComponent,
Expand Down
7 changes: 7 additions & 0 deletions components/configuration/VFBMain/searchConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,13 @@ var searchConfiguration = {
if (b.label.toLowerCase().split(/\W+/).join(' ').replace('_', ' ').indexOf(InputString.toLowerCase().split(/\W+/).join(' ').replace('_', ' ')) < 0 && a.label.toLowerCase().split(/\W+/).join(' ').replace('_', ' ').indexOf(InputString.toLowerCase().split(/\W+/).join(' ').replace('_', ' ')) > -1) {
return -1;
}
// pick up any match without non alpha numeric join character match
if (a.label.toLowerCase().split(/\W+/).join(' ').replace(/[\W_]+/g,' ').indexOf(InputString.toLowerCase().split(/\W+/).join(' ').replace(/[\W_]+/g,' ')) < 0 && b.label.toLowerCase().split(/\W+/).join(' ').replace(/[\W_]+/g,' ').indexOf(InputString.toLowerCase().split(/\W+/).join(' ').replace(/[\W_]+/g,' ')) > -1) {
return 1;
}
if (b.label.toLowerCase().split(/\W+/).join(' ').replace(/[\W_]+/g,' ').indexOf(InputString.toLowerCase().split(/\W+/).join(' ').replace(/[\W_]+/g,' ')) < 0 && a.label.toLowerCase().split(/\W+/).join(' ').replace(/[\W_]+/g,' ').indexOf(InputString.toLowerCase().split(/\W+/).join(' ').replace(/[\W_]+/g,' ')) > -1) {
return -1;
}
// if not found in one then advance the other
if (a.label.toLowerCase().indexOf(InputString.toLowerCase()) < 0 && b.label.toLowerCase().indexOf(InputString.toLowerCase()) > -1) {
return 1;
Expand Down
3 changes: 3 additions & 0 deletions components/configuration/VFBToolbar/vfbtoolbarHTML.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ var about
+ " Former contributors: Michael Ashburner (original PI and grant holder), Simon Reeve (2009-2011), Nicole Staudt (2015-2016), Alex Holmes (2017-2019)<br />"
+ " <b>Department of Physiology, Development and Neuroscience</b><br />"
+ " <a href='https://www.pdn.cam.ac.uk/research/groups/flybase/flybase-group-members' target='_blank'>Clare Pilgrim</a> (Ontology editor/Curator)<br />"
+ " <a href='https://www.pdn.cam.ac.uk/research/groups/flybase/flybase-group-members' target='_blank'>Alex McLachlan</a> (Curator/UX Tester)<br />"
+ " <a href='https://www.pdn.cam.ac.uk/research/groups/flybase/flybase-group-members' target='_blank'>Aoife Larkin</a> (Curator)<br />"
+ " <a href='https://www.pdn.cam.ac.uk/research/groups/flybase/flybase-group-members' target='_blank'>Gillian Millburn</a> (Senior Curator)<br />"
+ " <a href='https://www.pdn.cam.ac.uk/research/groups/flybase/flybase-group-members' target='_blank'>Nick Brown (current project PI)</a><br />"
Expand Down Expand Up @@ -103,6 +104,8 @@ var about
+ " <b>European Bioinformatics Institute (EMBL-EBI), Cambridge</b><br />"
+ " <a href='https://www.ebi.ac.uk/about/people/david-osumi-sutherland' target='_blank'>David Osumi-Sutherland"
+ " (current project Co-I)</a><br />"
+ " <a href='https://www.researchgate.net/profile/Nicolas_Matentzoglu2' target='_blank'>Nico Matentzoglu"
+ " (developer)</a><br />"
+ " <a href='https://www.ebi.ac.uk/about/people/helen-parkinson' target='_blank'>Helen Parkinson (current"
+ " project PI)</a><br />"
+ " </div>"
Expand Down
26 changes: 26 additions & 0 deletions components/configuration/VFBToolbar/vfbtoolbarMenuConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,32 @@ var toolbarMenu = {
]
}
]
},
{
label: "VFB CONNECT (API)",
icon: "",
action: "",
position: "right-start",
list: [
{
label: "Python (PyPi)",
icon: "",
trailerIcon: "fa fa-external-link",
action: {
handlerAction: "openNewTab",
parameters: ["https://pypi.org/project/vfb-connect/"]
}
},
{
label: "R wrapper",
icon: "",
trailerIcon: "fa fa-external-link",
action: {
handlerAction: "openNewTab",
parameters: ["https://github.com/jefferis/vfbconnectr"]
}
}
]
}
]
},
Expand Down
4 changes: 2 additions & 2 deletions model/vfb.xmi
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,14 @@
</queries>
<queries
xsi:type="gep_2:CompoundQuery"
name="Datasaets available for Template"
name="Datasets available for Template"
description="Get JSON for template_2_datasets query">
<queryChain
xsi:type="gep_2:SimpleQuery"
name="template_2_datasets_query"
description="Get JSON for template_2_datasets query"
returnType="//@libraries.3/@types.24"
query="&quot;statement&quot;: &quot;MATCH (t:Template) &lt;-[depicts]-(tc:Template)-[:in_register_with]-(c:Individual)-[:depicts]->(ai:Individual)-[:has_source]->(ds:DataSet) WHERE t.short_form in [{ID}] WITH distinct ds CALL apoc.cypher.run('WITH ds OPTIONAL MATCH (ds) &lt;- [:has_source|SUBCLASSOF|INSTANCEOF*]-(i:Individual) &lt;-[:depicts]- (channel:Individual)-[irw:in_register_with] ->(template:Individual)-[:depicts]-> (template_anat:Individual) RETURN template, channel, template_anat, i, irw limit 5', {ds:ds}) yield value with value.template as template, value.channel as channel,value.template_anat as template_anat, value.i as i, value.irw as irw, ds 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), symbol: coalesce(i.symbol[0], '')} , channel_image: { channel: { short_form: channel.short_form, label: coalesce(channel.label,''), iri: channel.iri, types: labels(channel), symbol: coalesce(channel.symbol[0], '')} , imaging_technique: { short_form: technique.short_form, label: coalesce(technique.label,''), iri: technique.iri, types: labels(technique), symbol: coalesce(technique.symbol[0], '')} ,image: { template_channel : { short_form: template.short_form, label: coalesce(template.label,''), iri: template.iri, types: labels(template), symbol: coalesce(template.symbol[0], '')} , template_anatomy: { short_form: template_anat.short_form, label: coalesce(template_anat.label,''), iri: template_anat.iri, types: labels(template_anat), symbol: coalesce(template_anat.symbol[0], '')} ,image_folder: COALESCE(irw.folder[0], ''), index: coalesce(apoc.convert.toInteger(irw.index[0]), []) + [] }} }) END AS anatomy_channel_image ,ds OPTIONAL MATCH (ds)-[rp:has_reference]->(p:pub) WITH CASE WHEN p is null THEN [] ELSE collect({ core: { short_form: p.short_form, label: coalesce(p.label,''), iri: p.iri, types: labels(p), symbol: coalesce(p.symbol[0], '')} , PubMed: coalesce(p.PMID[0], ''), FlyBase: coalesce(p.FlyBase[0], ''), DOI: coalesce(p.DOI[0], '') } ) END AS pubs,ds,anatomy_channel_image OPTIONAL MATCH (ds)-[:has_license]->(l:License) WITH collect ({ icon : coalesce(l.license_logo[0], ''), link : coalesce(l.license_url[0], ''), core : { short_form: l.short_form, label: coalesce(l.label,''), iri: l.iri, types: labels(l), symbol: coalesce(l.symbol[0], '')} }) as license,ds,anatomy_channel_image,pubs OPTIONAL MATCH (ds) &lt;-[:has_source]-(i:Individual) WITH i, ds, anatomy_channel_image, pubs, license OPTIONAL MATCH (i)-[:INSTANCEOF]-(c:Class) WITH DISTINCT { images: count(distinct i),types: count(distinct c) } as dataset_counts,ds,anatomy_channel_image,pubs,license RETURN { short_form: ds.short_form, label: coalesce(ds.label,''), iri: ds.iri, types: labels(ds), symbol: coalesce(ds.symbol[0], '')} as dataset, 'bac066c' AS version, 'template_2_datasets_query' AS query, anatomy_channel_image, pubs, license, dataset_counts&quot;, &quot;parameters&quot; : { &quot;ID&quot; : &quot;$ID&quot; }"
query="&quot;statement&quot;: &quot;MATCH (t:Template) &lt;-[depicts]-(tc:Template)-[:in_register_with]-(c:Individual)-[:depicts]->(ai:Individual)-[:has_source]->(ds:DataSet) WHERE t.short_form in [{ID}] WITH distinct ds, t CALL apoc.cypher.run('WITH ds, template_anat OPTIONAL MATCH (ds) &lt;- [:has_source]-(i:Individual) &lt;-[:depicts]- (channel:Individual)-[irw:in_register_with]->(template:Individual)-[:depicts]->(template_anat) RETURN template, channel, template_anat, i, irw limit 5', {ds:ds, template_anat:t}) yield value with value.template as template, value.channel as channel,value.template_anat as template_anat, value.i as i, value.irw as irw, ds 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), symbol: coalesce(i.symbol[0], '')} , channel_image: { channel: { short_form: channel.short_form, label: coalesce(channel.label,''), iri: channel.iri, types: labels(channel), symbol: coalesce(channel.symbol[0], '')} , imaging_technique: { short_form: technique.short_form, label: coalesce(technique.label,''), iri: technique.iri, types: labels(technique), symbol: coalesce(technique.symbol[0], '')} ,image: { template_channel : { short_form: template.short_form, label: coalesce(template.label,''), iri: template.iri, types: labels(template), symbol: coalesce(template.symbol[0], '')} , template_anatomy: { short_form: template_anat.short_form, label: coalesce(template_anat.label,''), iri: template_anat.iri, types: labels(template_anat), symbol: coalesce(template_anat.symbol[0], '')} ,image_folder: COALESCE(irw.folder[0], ''), index: coalesce(apoc.convert.toInteger(irw.index[0]), []) + [] }} }) END AS anatomy_channel_image ,ds OPTIONAL MATCH (ds)-[rp:has_reference]->(p:pub) WITH CASE WHEN p is null THEN [] ELSE collect({ core: { short_form: p.short_form, label: coalesce(p.label,''), iri: p.iri, types: labels(p), symbol: coalesce(p.symbol[0], '')} , PubMed: coalesce(p.PMID[0], ''), FlyBase: coalesce(p.FlyBase[0], ''), DOI: coalesce(p.DOI[0], '') } ) END AS pubs,ds,anatomy_channel_image OPTIONAL MATCH (ds)-[:has_license]->(l:License) WITH collect ({ icon : coalesce(l.license_logo[0], ''), link : coalesce(l.license_url[0], ''), core : { short_form: l.short_form, label: coalesce(l.label,''), iri: l.iri, types: labels(l), symbol: coalesce(l.symbol[0], '')} }) as license,ds,anatomy_channel_image,pubs OPTIONAL MATCH (ds) &lt;-[:has_source]-(i:Individual) WITH i, ds, anatomy_channel_image, pubs, license OPTIONAL MATCH (i)-[:INSTANCEOF]-(c:Class) WITH DISTINCT { images: count(distinct i),types: count(distinct c) } as dataset_counts,ds,anatomy_channel_image,pubs,license RETURN { short_form: ds.short_form, label: coalesce(ds.label,''), iri: ds.iri, types: labels(ds), symbol: coalesce(ds.symbol[0], '')} as dataset, 'bac066c' AS version, 'template_2_datasets_query' AS query, anatomy_channel_image, pubs, license, dataset_counts&quot;, &quot;parameters&quot; : { &quot;ID&quot; : &quot;$ID&quot; }"
countQuery="&quot;statement&quot;: &quot;MATCH (t:Template)&lt;-[depicts]-(tc:Template)-[:in_register_with]-(c:Individual)-[:depicts]->(ai:Individual)-[:has_source]->(ds:DataSet) WHERE t.short_form in [{ID}] WITH distinct ds RETURN count(ds) as count&quot;, &quot;parameters&quot; : { &quot;ID&quot; : &quot;$ID&quot; }"/>
<queryChain
xsi:type="gep_2:ProcessQuery"
Expand Down

0 comments on commit 99589bc

Please sign in to comment.