Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for NBLAST queries #745

Merged
merged 11 commits into from
Nov 4, 2020
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# total job timeout:
timeout-minutes: 45
timeout-minutes: 60

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:

- name: Build and push local wss
id: docker_build_local
timeout-minutes: 10
timeout-minutes: 15
uses: docker/build-push-action@v2
with:
push: true
Expand All @@ -141,7 +141,7 @@ jobs:

- name: Build and push remote
id: docker_build_remote
timeout-minutes: 10
timeout-minutes: 15
uses: docker/build-push-action@v2
with:
push: true
Expand Down
6 changes: 3 additions & 3 deletions components/configuration/VFBGraph/graphConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ var locationCypherQuery = instance => ({
var whatCypherQuery = instance => ({
"statements": [
{
"statement": "MATCH p=(n:Entity {short_form:'" + instance + "'})-[:INSTANCEOF|:SUBCLASSOF*..]->(x) "
+ "WHERE ('Anatomy' IN labels(x)) OR (('Cell' IN labels(x)) OR ('synaptic neuropil' IN labels(x))) "
"statement": "MATCH (n:Entity {short_form:'" + instance + "'}) OPTIONAL MATCH p=(n)-[:INSTANCEOF|:SUBCLASSOF*..]->(x) "
+ "WHERE (('Anatomy' IN labels(x)) AND ('Class' IN labels(n))) OR (('Cell' IN labels(x)) OR ('synaptic neuropil' IN labels(x))) "
+ " OR (('Ganglion' IN labels(x)) OR ('Neuron_projection_bundle' IN labels(x))) "
+ "RETURN p, n.short_form as root",
+ "RETURN n,p, n.short_form as root",
"resultDataContents": ["graph"]
}
]
Expand Down
7 changes: 5 additions & 2 deletions model/vfb.xmi
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@
<types xsi:type="gep_1:SimpleType"
id="VFB_00200000"
name="JRC2018VU template"/>
<types xsi:type="gep_1:SimpleType"
id="NBLAST2"
name="NEW NBLAST"/>
</libraries>
<libraries
id="vfbLibrary"
Expand Down Expand Up @@ -189,7 +192,7 @@
name="anat_image_query"
description="Get images for individual list"
runForCount="false"
query="&quot;statement&quot;: &quot;MATCH (primary:Individual) WHERE primary.short_form in {ARRAY_ID_RESULTS} WITH primary OPTIONAL MATCH (primary)&lt;-[:depicts]-(channel:Individual)-[irw:in_register_with]->(template:Individual)-[:depicts]->(template_anat:Individual) WITH template, channel, template_anat, irw, primary OPTIONAL MATCH (channel)-[:is_specified_output_of]->(technique:Class) WITH CASE WHEN channel IS NULL THEN [] ELSE collect ({ 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 channel_image,primary OPTIONAL MATCH (primary)-[:INSTANCEOF]->(typ:Class) WITH CASE WHEN typ is null THEN [] ELSE collect ({ short_form: typ.short_form, label: coalesce(typ.label,''), iri: typ.iri, types: labels(typ), symbol: coalesce(typ.symbol[0], '')} ) END AS types,primary,channel_image RETURN { core : { short_form: primary.short_form, label: coalesce(primary.label,''), iri: primary.iri, types: labels(primary), symbol: coalesce(primary.symbol[0], '')} , description : coalesce(primary.description, []), comment : coalesce(primary.comment, []) } AS term, '58214d4' AS version, 'anat_image_query' AS query, channel_image, types&quot;, &quot;parameters&quot; : { &quot;ARRAY_ID_RESULTS&quot; : $ARRAY_ID_RESULTS}"
query="&quot;statement&quot;: &quot;MATCH (primary:Individual) WHERE primary.short_form in {ARRAY_ID_RESULTS} WITH primary OPTIONAL MATCH (primary)&lt;-[:depicts]-(channel:Individual)-[irw:in_register_with]->(template:Individual)-[:depicts]->(template_anat:Individual) WITH template, channel, template_anat, irw, primary OPTIONAL MATCH (channel)-[:is_specified_output_of]->(technique:Class) WITH CASE WHEN channel IS NULL THEN [] ELSE collect ({ 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 channel_image,primary OPTIONAL MATCH (primary)-[:INSTANCEOF]->(typ:Class) WITH CASE WHEN typ is null THEN [] ELSE collect ({ short_form: typ.short_form, label: coalesce(typ.label,''), iri: typ.iri, types: labels(typ), symbol: coalesce(typ.symbol[0], '')} ) END AS types,primary,channel_image RETURN { core : { short_form: primary.short_form, label: coalesce(primary.label,''), iri: primary.iri, types: labels(primary), symbol: coalesce(primary.symbol[0], '')} , description : coalesce(primary.description, []), comment : coalesce(primary.comment, []) } AS term, '58214d4' AS version, 'anat_image_query' AS query, channel_image, types $EXTRA_RESULT_COLUMNS&quot;, &quot;parameters&quot; : { &quot;ARRAY_ID_RESULTS&quot; : $ARRAY_ID_RESULTS}"
countQuery="&quot;statement&quot;: &quot;MATCH(i:Individual) WHERE i.short_form IN {ARRAY_ID_RESULTS} RETURN count(i) as count&quot;, &quot;parameters&quot; : { &quot;ARRAY_ID_RESULTS&quot; : $ARRAY_ID_RESULTS}"/>
<queryChain
xsi:type="gep_2:ProcessQuery"
Expand Down Expand Up @@ -1036,6 +1039,6 @@
returnType="//@libraries.3/@types.2"
queryChain="//@dataSources.5/@queries.0 //@dataSources.4/@queries.2 //@dataSources.0/@queries.1">
<matchingCriteria
type="//@libraries.3/@types.0 //@libraries.3/@types.2"/>
type="//@libraries.3/@types.40 //@libraries.3/@types.0 //@libraries.3/@types.2"/>
</queries>
</gep:GeppettoModel>