Skip to content
Snippets Groups Projects
Commit 8ed0aa54 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

parent compartment/pathway for compartment/pathway should include child completely

parent c5d4358e
No related branches found
No related tags found
2 merge requests!1847Master to dev,!1846Resolve "for some translocations the reactant and product are the same species in CellDesigner or SBML exports"
Pipeline #100048 canceled
update element_table child
set compartment_id = null
where element_type_db = 'PATHWAY';
update element_table child
set compartment_id =
(select id
from element_table parent
where parent.element_type_db like '%COMPARTMENT'
and parent.model_id = child.model_id
and parent.x < child.x + child.width
and parent.x + parent.width > child.x
and parent.y < child.y + child.height
and parent.y + parent.height > child.y
and id <> child.id
order by parent.width * parent.height
limit 1)
where element_type_db <> 'PATHWAY'
and not element_type_db like '%COMPARTMENT';
;
update element_table child
set compartment_id =
(select id
from element_table parent
where parent.element_type_db like '%COMPARTMENT'
and parent.model_id = child.model_id
and parent.x < child.x
and parent.x + parent.width > child.x + child.width
and parent.y < child.y
and parent.y + parent.height > child.y + child.height
and id <> child.id
order by parent.width * parent.height
limit 1)
where element_type_db like '%COMPARTMENT';
;
update element_table child
set pathway_id =
(select id
from element_table parent
where parent.element_type_db = 'PATHWAY'
and parent.model_id = child.model_id
and parent.x < child.x + child.width
and parent.x + parent.width > child.x
and parent.y < child.y + child.height
and parent.y + parent.height > child.y
and id <> child.id
order by parent.width * parent.height
limit 1)
where element_type_db <> 'PATHWAY'
and not element_type_db like '%COMPARTMENT';
;
update element_table child
set pathway_id =
(select id
from element_table parent
where parent.element_type_db = 'PATHWAY'
and parent.model_id = child.model_id
and parent.x < child.x
and parent.x + parent.width > child.x + child.width
and parent.y < child.y
and parent.y + parent.height > child.y + child.height
and id <> child.id
order by parent.width * parent.height
limit 1)
where element_type_db = 'PATHWAY'
or element_type_db like '%COMPARTMENT';
;
update element_table child
set compartment_id = null
where element_type_db = 'PATHWAY';
update element_table child
set compartment_id =
(select id
from element_table parent
where parent.element_type_db like '%COMPARTMENT'
and parent.model_id = child.model_id
and parent.x < child.x + child.width
and parent.x + parent.width > child.x
and parent.y < child.y + child.height
and parent.y + parent.height > child.y
and id <> child.id
order by parent.width * parent.height
limit 1)
where element_type_db <> 'PATHWAY'
and not element_type_db like '%COMPARTMENT';
;
update element_table child
set compartment_id =
(select id
from element_table parent
where parent.element_type_db like '%COMPARTMENT'
and parent.model_id = child.model_id
and parent.x < child.x
and parent.x + parent.width > child.x + child.width
and parent.y < child.y
and parent.y + parent.height > child.y + child.height
and id <> child.id
order by parent.width * parent.height
limit 1)
where element_type_db like '%COMPARTMENT';
;
update element_table child
set pathway_id =
(select id
from element_table parent
where parent.element_type_db = 'PATHWAY'
and parent.model_id = child.model_id
and parent.x < child.x + child.width
and parent.x + parent.width > child.x
and parent.y < child.y + child.height
and parent.y + parent.height > child.y
and id <> child.id
order by parent.width * parent.height
limit 1)
where element_type_db <> 'PATHWAY'
and not element_type_db like '%COMPARTMENT';
;
update element_table child
set pathway_id =
(select id
from element_table parent
where parent.element_type_db = 'PATHWAY'
and parent.model_id = child.model_id
and parent.x < child.x
and parent.x + parent.width > child.x + child.width
and parent.y < child.y
and parent.y + parent.height > child.y + child.height
and id <> child.id
order by parent.width * parent.height
limit 1)
where element_type_db = 'PATHWAY'
or element_type_db like '%COMPARTMENT';
;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment