VirtualFlyBrain / VFB_reporting

Scripts for reporting on the state of VFB content and pipeline
https://github.com/VirtualFlyBrain/VFB_reporting_results
0 stars 0 forks source link

Write query to cover current FlyBase->VFB transgene linkouts #27

Open dosumis opened 4 years ago

dosumis commented 4 years ago

The following query produces a standard FLyBase linkout table with 1-2 links per FB construct.

MATCH (f:Feature)<-[]-(ep:Class)-[dbx:hasDbXref]->(s:Site { short_form: 'FlyLight'})
WITH f, ep MATCH (ep)<-[:INSTANCEOF]-(i:Individual)
<-[]-(channel:Individual)-[irw:in_register_with]->(t:Individual) 
WITH distinct f.short_form AS `#FlyBase ID`, collect(i.short_form)[0] AS DBID, 
t.label as template
 RETURN `#FlyBase ID`, 'VFB' as DBNAME, DBID ORDER BY `#FlyBase ID`

=>

FlyBase ID | DBNAME | DBID

-- | -- | -- "FBtp0057296" | "VFB" | "VFB_00020468" "FBtp0057297" | "VFB" | "VFB_00023198" "FBtp0057299" | "VFB" | "VFB_00020592" ...

Link recipe: https://virtualflybrain.org/reports/VFB_00068899

Thumbnail link recipe: https://virtualflybrain.org/reports/VFB_00068899/thumbnail.png

dosumis commented 4 years ago

From: https://wiki.flybase.org/wiki/FlyBase:Links_to_and_from_FlyBase

Notes: Use 4 for key and Column 3 for text to link on.

dosumis commented 4 years ago

Take2:

MATCH (f:Feature)<-[]-(ep:Class)-[dbx:hasDbXref]->(s:Site { short_form: 'FlyLight'})
WITH f, ep MATCH (ep)<-[:INSTANCEOF]-(i:Individual)
<-[]-(channel:Individual)-[irw:in_register_with]->(t:Individual) 
WITH distinct f.short_form AS `#FlyBase ID`, 
collect(i.short_form)[0] AS DBURL, ep.label AS DBID, t.label as template
 RETURN `#FlyBase ID`, 'VFB' as DBNAME, DBID, DBURL ORDER BY `#FlyBase ID`

FlyBase ID | DBNAME | DBID | DBURL

-- | -- | -- | -- "FBtp0057296" | "VFB" | "P{GMR10A06-GAL4} expression pattern" | "VFB_00020468" "FBtp0057297" | "VFB" | "P{GMR10A07-GAL4} expression pattern" | "VFB_00023198"

Query could be optimised(?)

Or use individual name ?

dosumis commented 4 years ago

Latest:

MATCH (f:Feature)<-[]-(ep:Class)-[dbx:hasDbXref]->(s:Site)
WHERE (s.short_form = 'FlyLight') OR (s.short_form = 'FlyLightSplit')
WITH f, ep MATCH (ep)<-[:INSTANCEOF]-(i:Individual)
<-[]-(channel:Individual)-[irw:in_register_with]->(t:Individual)
WITH distinct f.short_form AS `#FlyBase ID`,
collect(i.short_form)[0] AS DBURL, ep.label AS epl, t.label as template
RETURN `#FlyBase ID`, DBURL, 'VFB' AS DBNAME,
       epl + ' in ' + replace(
        replace(template, ' template - Court2018_c', ''),
       'JFRC2_template_c',
       'adult brain') + ' on Virtual Fly Brain' AS DBID ORDER BY `#FlyBase ID`

Note replace hack is necessary for template because a longer match pattern bridging to template:anatomy classification does not complete.

=>

FlyBase ID | DBURL | DBID

-- | -- | -- "FBtp0057296" | "VFB_00020468" | "P{GMR10A06-GAL4} expression pattern in adult brain on Virtual Fly Brain" "FBtp0057297" | "VFB_00023198" | "P{GMR10A07-GAL4} expression pattern in adult brain on Virtual Fly Brain" "FBtp0057299" | "VFB_00020592" | "P{GMR10A09-GAL4} expression pattern in adult brain on Virtual Fly Brain"

One query => Image linkout for transgene expression patterns & splits, adult brain & VNS, conforming to linkout spec. Single, arbitrary image is chosen for each.

Ways we might improve:

dosumis commented 4 years ago

Script for generating linkout.tsv https://gist.github.com/dosumis/9e2551acd3daa2f2343c6ee169ee71a7