From 7bf980aa49b2e7ca5d815fece7f458131b41b808 Mon Sep 17 00:00:00 2001 From: buczekp <buczekp> Date: Tue, 7 Sep 2010 10:45:49 +0000 Subject: [PATCH] [LMS-1736] naming changes from OLIGO to siRNA SVN: 17742 --- .../shared/dto/types/MaterialTypeCode.java | 2 +- .../migration/migration-055-056.sql | 11 ++++--- .../056/017=database_version_logs.tsv | 2 +- .../sql/postgresql/056/032=material_types.tsv | 14 ++++---- .../sql/postgresql/056/036=property_types.tsv | 32 +++++++++---------- .../sql/postgresql/056/043=sample_types.tsv | 12 +++---- .../application/ClientPluginFactory.java | 2 +- .../LibrarySampleBatchRegistrationForm.java | 18 +++++------ .../client/web/server/LibraryExtractor.java | 2 +- .../web/server/LibraryRegistrationTask.java | 6 ++-- .../LibraryEntityRegistrator.java | 11 ++++--- ...QiagenScreeningLibraryColumnExtractor.java | 8 ++--- .../ScreeningLibraryTransformer.java | 4 +-- .../api/v1/dto/MaterialTypeIdentifier.java | 4 +-- .../basic/dto/LibraryRegistrationInfo.java | 8 ++--- .../shared/basic/dto/ScreeningConstants.java | 6 ++-- screening/source/sql/postgresql/006/data.sql | 12 +++---- 17 files changed, 79 insertions(+), 75 deletions(-) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/types/MaterialTypeCode.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/types/MaterialTypeCode.java index fde7c1f1557..931ccd20f66 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/types/MaterialTypeCode.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/types/MaterialTypeCode.java @@ -30,7 +30,7 @@ public final class MaterialTypeCode public static final String GENE = "GENE"; - public static final String OLIGO = "OLIGO"; + public static final String SIRNA = "SIRNA"; public static final String VIRUS = "VIRUS"; diff --git a/openbis/source/sql/postgresql/migration/migration-055-056.sql b/openbis/source/sql/postgresql/migration/migration-055-056.sql index e9ec53b2722..c115e0e1dff 100644 --- a/openbis/source/sql/postgresql/migration/migration-055-056.sql +++ b/openbis/source/sql/postgresql/migration/migration-055-056.sql @@ -171,15 +171,18 @@ BEGIN END; $$ LANGUAGE 'plpgsql'; -select REPLACE_GENE_SYMBOL_BY_GENE_ID(); -drop function REPLACE_GENE_SYMBOL_BY_GENE_ID(); -DROP AGGREGATE merge_words(text); -drop function merge_words(text,text); +-- select REPLACE_GENE_SYMBOL_BY_GENE_ID(); +--drop function REPLACE_GENE_SYMBOL_BY_GENE_ID(); +--DROP AGGREGATE merge_words(text); +--drop function merge_words(text,text); -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- +UPDATE sample_types SET code = 'SIRNA_WELL' WHERE code = 'OLIGO_WELL'; +UPDATE material_types SET code = 'SIRNA' WHERE code = 'OLIGO'; +UPDATE property_types SET code = 'SIRNA', label = 'siRNA' WHERE code = 'OLIGO'; diff --git a/openbis/sourceTest/sql/postgresql/056/017=database_version_logs.tsv b/openbis/sourceTest/sql/postgresql/056/017=database_version_logs.tsv index 05ba8337c57..b03df6fa097 100644 --- a/openbis/sourceTest/sql/postgresql/056/017=database_version_logs.tsv +++ b/openbis/sourceTest/sql/postgresql/056/017=database_version_logs.tsv @@ -29,4 +29,4 @@ 053 source/sql/postgresql/migration/migration-052-053.sql SUCCESS 2010-06-08 15:27:55.032 -- Migration from 052 to 053\\012\\012-- Change code uniqueness check for samples of specific type.\\012-- If sample_types.is_subcode_unique flag is set to 'true', additional check is performed \\012-- on codes of samples of the type. Subcodes will have to be unique as well.\\012\\012ALTER TABLE sample_types ADD COLUMN is_subcode_unique boolean_char NOT NULL DEFAULT false;\\012\\012CREATE OR REPLACE FUNCTION SAMPLE_SUBCODE_UNIQUENESS_CHECK() RETURNS trigger AS $$\\012DECLARE\\012 counter INTEGER;\\012 unique_subcode BOOLEAN_CHAR;\\012BEGIN\\012 LOCK TABLE samples IN EXCLUSIVE MODE;\\012 \\012 SELECT is_subcode_unique into unique_subcode FROM sample_types WHERE id = NEW.saty_id;\\012 \\012 IF (unique_subcode) THEN\\012 IF (NEW.dbin_id is not NULL) THEN\\012\\011\\011\\011SELECT count(*) into counter FROM samples \\012\\011\\011\\011\\011where id != NEW.id and code = NEW.code and saty_id = NEW.saty_id and dbin_id = NEW.dbin_id;\\012\\011\\011\\011IF (counter > 0) THEN\\012\\011\\011\\011\\011RAISE EXCEPTION 'Insert/Update of Sample (Code: %) failed because database instance sample of the same type with the same subcode already exists.', NEW.code;\\012\\011\\011\\011END IF;\\012\\011\\011ELSIF (NEW.grou_id is not NULL) THEN\\012\\011\\011\\011SELECT count(*) into counter FROM samples \\012\\011\\011\\011\\011where id != NEW.id and code = NEW.code and saty_id = NEW.saty_id and grou_id = NEW.grou_id;\\012\\011\\011\\011IF (counter > 0) THEN\\012\\011\\011\\011\\011RAISE EXCEPTION 'Insert/Update of Sample (Code: %) failed because space sample of the same type with the same subcode already exists.', NEW.code;\\012\\011\\011\\011END IF;\\012\\011\\011END IF;\\012 END IF;\\012 \\012 RETURN NEW;\\012END;\\012$$ LANGUAGE 'plpgsql';\\012\\012CREATE TRIGGER SAMPLE_SUBCODE_UNIQUENESS_CHECK BEFORE INSERT OR UPDATE ON SAMPLES\\012 FOR EACH ROW EXECUTE PROCEDURE SAMPLE_SUBCODE_UNIQUENESS_CHECK();\\012 \\012-- Fixing error messages in old trigger\\012\\012CREATE OR REPLACE FUNCTION SAMPLE_CODE_UNIQUENESS_CHECK() RETURNS trigger AS $$\\012DECLARE\\012 counter INTEGER;\\012BEGIN\\012 LOCK TABLE samples IN EXCLUSIVE MODE;\\012 \\012\\011 IF (NEW.samp_id_part_of is NULL) THEN\\012\\011\\011 IF (NEW.dbin_id is not NULL) THEN\\012\\011\\011\\011 SELECT count(*) into counter FROM samples \\012\\011\\011 where id != NEW.id and code = NEW.code and samp_id_part_of is NULL and dbin_id = NEW.dbin_id;\\012 IF (counter > 0) THEN\\012\\011\\011\\011\\011 RAISE EXCEPTION 'Insert/Update of Sample (Code: %) failed because database instance sample with the same code already exists.', NEW.code;\\012 END IF;\\012\\011\\011 ELSIF (NEW.grou_id is not NULL) THEN\\012\\011\\011\\011 SELECT count(*) into counter FROM samples \\012\\011\\011\\011\\011 where id != NEW.id and code = NEW.code and samp_id_part_of is NULL and grou_id = NEW.grou_id;\\012\\011\\011\\011 IF (counter > 0) THEN\\012\\011\\011\\011\\011 RAISE EXCEPTION 'Insert/Update of Sample (Code: %) failed because space sample with the same code already exists.', NEW.code;\\012\\011\\011\\011 END IF;\\012 END IF;\\012 ELSE\\012\\011\\011 IF (NEW.dbin_id is not NULL) THEN\\012\\011\\011\\011 SELECT count(*) into counter FROM samples \\012\\011\\011\\011\\011 where id != NEW.id and code = NEW.code and samp_id_part_of = NEW.samp_id_part_of and dbin_id = NEW.dbin_id;\\012\\011\\011\\011 IF (counter > 0) THEN\\012\\011\\011\\011\\011 RAISE EXCEPTION 'Insert/Update of Sample (Code: %) failed because database instance sample with the same code and being the part of the same container already exists.', NEW.code;\\012\\011\\011\\011 END IF;\\012\\011\\011 ELSIF (NEW.grou_id is not NULL) THEN\\012\\011\\011\\011 SELECT count(*) into counter FROM samples \\012\\011\\011\\011\\011 where id != NEW.id and code = NEW.code and samp_id_part_of = NEW.samp_id_part_of and grou_id = NEW.grou_id;\\012\\011\\011\\011 IF (counter > 0) THEN\\012\\011\\011\\011\\011 RAISE EXCEPTION 'Insert/Update of Sample (Code: %) failed because space sample with the same code and being the part of the same container already exists.', NEW.code;\\012\\011\\011\\011 END IF;\\012\\011\\011 END IF;\\012 END IF; \\012 \\012 RETURN NEW;\\012END;\\012$$ LANGUAGE 'plpgsql';\\012 \N 054 source/sql/postgresql/migration/migration-053-054.sql SUCCESS 2010-07-27 11:30:46.766 -- Migration from 053 to 054\\012\\012\\012-- Add RELATIONSHIP_TYPES table\\012CREATE TABLE relationship_types (id TECH_ID NOT NULL, code CODE NOT NULL, label COLUMN_LABEL, parent_label COLUMN_LABEL, child_label COLUMN_LABEL, description DESCRIPTION_2000, registration_timestamp TIME_STAMP_DFL NOT NULL DEFAULT CURRENT_TIMESTAMP, pers_id_registerer TECH_ID NOT NULL, is_managed_internally BOOLEAN_CHAR NOT NULL DEFAULT 'F', is_internal_namespace BOOLEAN_CHAR NOT NULL DEFAULT 'F', dbin_id TECH_ID NOT NULL);\\012\\012-- Add SAMPLE_RELATIONSHIPS table\\012CREATE TABLE sample_relationships (id TECH_ID NOT NULL, sample_id_parent TECH_ID NOT NULL, relationship_id TECH_ID NOT NULL, sample_id_child TECH_ID NOT NULL);\\012\\012-- Add/update constraints\\012ALTER TABLE relationship_types ADD CONSTRAINT rety_pk PRIMARY KEY (id);\\012ALTER TABLE relationship_types ADD CONSTRAINT rety_uk UNIQUE(code,dbin_id);\\012ALTER TABLE sample_relationships ADD CONSTRAINT sare_pk PRIMARY KEY (id);\\012ALTER TABLE sample_relationships ADD CONSTRAINT sare_bk_uk UNIQUE(sample_id_child,sample_id_parent,relationship_id);\\012ALTER TABLE sample_relationships ADD CONSTRAINT sare_data_fk_child FOREIGN KEY (sample_id_child) REFERENCES samples(id) ON DELETE CASCADE;\\012ALTER TABLE sample_relationships ADD CONSTRAINT sare_data_fk_parent FOREIGN KEY (sample_id_parent) REFERENCES samples(id) ON DELETE CASCADE;\\012ALTER TABLE sample_relationships ADD CONSTRAINT sare_data_fk_relationship FOREIGN KEY (relationship_id) REFERENCES relationship_types(id);\\012\\012-- Create index\\012CREATE INDEX sare_data_fk_i_child ON sample_relationships (sample_id_child);\\012CREATE INDEX sare_data_fk_i_parent ON sample_relationships (sample_id_parent);\\012CREATE INDEX sare_data_fk_i_relationship ON sample_relationships (relationship_id);\\012\\012-- Create sequence for RELATIONSHIP_TYPES\\012CREATE SEQUENCE RELATIONSHIP_TYPE_ID_SEQ;\\012CREATE SEQUENCE SAMPLE_RELATIONSHIP_ID_SEQ;\\012\\012-- Create initial relationships\\012insert into relationship_types\\012(id, \\012code, \\012label, \\012parent_label, \\012child_label, \\012description, \\012pers_id_registerer, \\012is_managed_internally, \\012is_internal_namespace, \\012dbin_id) \\012values\\012(\\012nextval('RELATIONSHIP_TYPE_ID_SEQ'),\\012'PARENT_CHILD',\\012'Parent - Child', \\012'Parent', \\012'Child', \\012'Parent - Child relationship', \\012(select id from persons where user_id ='system'), \\012'T', \\012'T', \\012(select id from database_instances where is_original_source = 'T')\\012);\\012\\012insert into relationship_types\\012(id, \\012code, \\012label, \\012parent_label, \\012child_label, \\012description, \\012pers_id_registerer, \\012is_managed_internally, \\012is_internal_namespace, \\012dbin_id) \\012values\\012(\\012nextval('RELATIONSHIP_TYPE_ID_SEQ'),\\012'PLATE_CONTROL_LAYOUT',\\012'Plate - Control Layout', \\012'Plate', \\012'Control Layout', \\012'Plate - Control Layout relationship', \\012(select id from persons where user_id ='system'), \\012'T', \\012'T', \\012(select id from database_instances where is_original_source = 'T')\\012); \\012\\012\\012-- Migrate sample relationships to new schema\\012INSERT INTO sample_relationships (id, sample_id_parent,sample_id_child,relationship_id) (select distinct nextval('SAMPLE_RELATIONSHIP_ID_SEQ') as id, s.SAMP_ID_GENERATED_FROM as parent_id, s.ID as child_id, rt.id as relationship_id from samples s, relationship_types rt WHERE rt.code = 'PARENT_CHILD' and s.SAMP_ID_GENERATED_FROM is not null); \\012INSERT INTO sample_relationships (id, sample_id_parent,sample_id_child,relationship_id) (select distinct nextval('SAMPLE_RELATIONSHIP_ID_SEQ') as id, s.SAMP_ID_CONTROL_LAYOUT as parent_id, s.ID as child_id, rt.id as relationship_id from samples s, relationship_types rt WHERE rt.code = 'PLATE_CONTROL_LAYOUT' and s.SAMP_ID_CONTROL_LAYOUT is not null);\\012\\012-- Drop old sample relations\\012ALTER TABLE SAMPLES DROP COLUMN SAMP_ID_TOP;\\012ALTER TABLE SAMPLES DROP COLUMN SAMP_ID_GENERATED_FROM;\\012ALTER TABLE SAMPLES DROP COLUMN SAMP_ID_CONTROL_LAYOUT;\\012\\012--------------------------------------------------------------------------------------\\012--------------------------------------------------------------------------------------\\012-- This is a screening specific migration. Nothing will be performed on openBIS databases \\012-- which are not screening specific.\\012-- \\012-- This migration for each existing connection between oligo well, oligo material and gene material\\012-- creates a direct connection between the well and the gene. \\012--------------------------------------------------------------------------------------\\012--------------------------------------------------------------------------------------\\012 \\012\\011\\012CREATE OR REPLACE FUNCTION CONNECT_WELLS_WITH_GENES() RETURNS void AS $$\\012DECLARE\\012\\011counter int;\\012\\011oligo_well_exists bool;\\012BEGIN\\012\\011--------------------------------------------------\\012\\011-- create a gene property and assign it to oligo well\\012\\011--------------------------------------------------\\012\\011\\012\\011select true \\012\\011into oligo_well_exists\\012\\011from sample_types \\012\\011where code = 'OLIGO_WELL';\\012\\011\\012\\011if oligo_well_exists IS NULL then \\012\\011\\011-- skip migration if there are no oligo wells\\012\\011\\011return;\\012\\011end if; \\012\\011\\012\\011insert into property_types(\\012\\011\\011id, \\012\\011\\011code, description, label, \\012\\011\\011daty_id,\\012\\011\\011pers_id_registerer,\\012\\011\\011dbin_id,\\012\\011\\011maty_prop_id) \\012\\011values(\\012\\011\\011\\011nextval('PROPERTY_TYPE_ID_SEQ'), \\012\\011\\011\\011'GENE','Inhibited gene','Gene',\\012\\011\\011\\011(select id from data_types where code = 'MATERIAL'), \\012\\011\\011\\011(select id from persons where user_id ='system'), \\012\\011\\011\\011(select id from database_instances where is_original_source = 'T'), \\012\\011\\011\\011(select id from material_types where code = 'GENE')\\012\\011\\011);\\012\\011\\011\\012\\011insert into sample_type_property_types( \\012\\011 id,\\012\\011 saty_id,\\012\\011 prty_id,\\012\\011 is_mandatory,\\012\\011 pers_id_registerer,\\012\\011 ordinal\\012\\011) values(\\012\\011\\011\\011nextval('stpt_id_seq'), \\012\\011\\011\\011(select id from sample_types where code = 'OLIGO_WELL'),\\012\\011\\011\\011(select id from property_types where code = 'GENE'),\\012\\011\\011\\011false,\\012\\011\\011\\011(select id from persons where user_id ='system'),\\012\\011\\011\\011(select max(ordinal)+1 from sample_type_property_types \\012\\011\\011\\011\\011where saty_id = (select id from sample_types where code = 'OLIGO_WELL'))\\012\\011\\011);\\012\\012\\011--------------------------------------------------\\012\\011-- create a gene material property for each oligo well\\012\\011--------------------------------------------------\\012\\011\\011\\012\\011select \\011count(*)\\012\\011into counter\\012\\011from\\012\\011\\011samples well, sample_types well_type, sample_properties well_props, \\012\\011\\011materials well_material, material_properties well_material_props,\\012\\011\\011materials nested_well_material\\012\\011where\\012\\011\\011well_type.code = 'OLIGO_WELL' and\\012\\011\\011-- find 'well_material' assigned to the well\\012\\011\\011well_props.samp_id = well.id and well_material.id = well_props.mate_prop_id and \\012\\011\\011-- additional joins to entity type tables\\012\\011\\011well_type.id = well.saty_id and\\012\\011\\011-- well content material property\\012\\011\\011well_material_props.mate_id = well_material.id and \\012\\011\\011-- material connected to the material in the well (e.g. gene)\\012\\011\\011well_material_props.mate_prop_id = nested_well_material.id and\\012\\011\\011nested_well_material.maty_id = (select id from material_types where code = 'GENE');\\012\\011\\012\\011if counter = 0 then \\012\\011\\011-- skip migration if there are no genes indirectly connected to oligo wells\\012\\011\\011return;\\012\\011end if; \\012\\012\\011insert into sample_properties(id, samp_id, stpt_id, mate_prop_id, pers_id_registerer) (\\012\\011\\011select \\011nextval('sample_property_id_seq') id, \\012\\011\\011\\011well.id samp_id, \\012\\011\\011\\011(select stpt.id from sample_type_property_types stpt, property_types props where stpt.prty_id = props.id and props.code='GENE') stpt_id,\\012\\011\\011\\011nested_well_material.id mate_prop_id,\\012\\011\\011\\011(select id from persons where user_id ='system') pers_id_registerer \\012\\011\\011from\\012\\011\\011\\011samples well, sample_types well_type, sample_properties well_props, \\012\\011\\011\\011materials well_material, material_properties well_material_props,\\012\\011\\011\\011materials nested_well_material\\012\\011\\011where\\012\\011\\011\\011well_type.code = 'OLIGO_WELL' and\\012\\011\\011\\011-- find 'well_material' assigned to the well\\012\\011\\011\\011well_props.samp_id = well.id and well_material.id = well_props.mate_prop_id and \\012\\011\\011\\011-- additional joins to entity type tables\\012\\011\\011\\011well_type.id = well.saty_id and\\012\\011\\011\\011-- well content material property\\012\\011\\011\\011well_material_props.mate_id = well_material.id and \\012\\011\\011\\011-- material connected to the material in the well (e.g. gene)\\012\\011\\011\\011well_material_props.mate_prop_id = nested_well_material.id and\\012\\011\\011\\011nested_well_material.maty_id = (select id from material_types where code = 'GENE')\\012\\011);\\012\\012END;\\012$$ LANGUAGE 'plpgsql';\\012\\012select CONNECT_WELLS_WITH_GENES();\\012drop function CONNECT_WELLS_WITH_GENES();\\012\\012--------------------------------------------------------------------------------------\\012--------------------------------------------------------------------------------------\\012\\012-- drop dataset triggers\\012\\012DROP TRIGGER check_dataset_relationships_on_data_table_modification ON data;\\012DROP FUNCTION check_dataset_relationships_on_data_table_modification();\\012DROP TRIGGER check_dataset_relationships_on_relationships_table_modification ON data_set_relationships;\\012DROP FUNCTION check_dataset_relationships_on_relationships_table_modification();\\012 \\012\\012\\012\\012\\012\\012\\012\\012 \N 055 source/sql/postgresql/migration/migration-054-055.sql SUCCESS 2010-08-04 14:15:34.151 -- Migration from 054 to 055\\012\\012UPDATE sample_types SET generated_from_depth = 1 WHERE generated_from_depth > 1;\\012 \N -056 source/sql/postgresql/migration/migration-055-056.sql SUCCESS 2010-09-03 15:46:30.451 -- Migration from 055 to 056\\012\\012--------------------------------------------------------------------------------------\\012--------------------------------------------------------------------------------------\\012-- Screening specific migration. Nothing will be performed on openBIS databases \\012-- which are not screening specific.\\012--------------------------------------------------------------------------------------\\012--------------------------------------------------------------------------------------\\012\\012CREATE OR REPLACE FUNCTION merge_words(text, text) RETURNS text AS $$\\012DECLARE\\012 BEGIN\\012 IF character_length($1) > 0 THEN\\012 RETURN $1 || ' ' || $2;\\012 ELSE\\012 RETURN $2;\\012 END IF;\\012 END;\\012$$ LANGUAGE plpgsql;\\012\\012CREATE AGGREGATE merge_words(text)\\012(\\012 SFUNC = merge_words,\\012 STYPE = text\\012);\\012\\012\\012CREATE OR REPLACE FUNCTION REPLACE_GENE_SYMBOL_BY_GENE_ID() RETURNS void AS $$\\012DECLARE\\012\\011counter int;\\012\\011library_id_assigned_to_gene bool;\\012BEGIN\\012\\011--------------------------------------------------\\012\\011-- create a GENE_SYMBOL property and assign it to GENE\\012\\011--------------------------------------------------\\012\\011\\012\\011select true \\012\\011into library_id_assigned_to_gene \\012\\011from material_type_property_types mtpt, material_types mt, property_types pt \\012\\011where mtpt.maty_id = mt.id and mtpt.prty_id = pt.id \\012\\011\\011and mt.code = 'GENE' and pt.code = 'LIBRARY_ID';\\012\\011\\012\\011if library_id_assigned_to_gene IS NULL then \\012\\011\\011-- skip migration if gene has no library_id property\\012\\011\\011return;\\012\\011end if; \\012\\011\\012\\011\\012\\011select count(*)\\012\\011into counter \\012\\011from \\012\\011\\011(select m.id, count(mp.id) as c \\012\\011\\011\\011from materials m, material_types mt, material_properties mp, material_type_property_types mtpt, property_types pt \\012\\011\\011\\011where m.maty_id = mt.id and mp.mate_id = m.id and mp.mtpt_id = mtpt.id and mtpt.maty_id = mt.id and pt.id = mtpt.prty_id\\012\\011\\011\\011\\011and mt.code = 'GENE' and pt.code = 'LIBRARY_ID' \\012\\011\\011\\011group by m.id) as counter_table \\012\\011where c < 1; \\012\\011\\012\\011if counter > 0 then \\012\\011\\011-- skip migration if there is at least one gene without library_id\\012\\011\\011return;\\012\\011end if;\\012\\011\\012\\011\\012\\011insert into property_types\\012\\011\\011(id\\012\\011\\011,code\\012\\011\\011,description\\012\\011\\011,label\\012\\011\\011,daty_id\\012\\011\\011,pers_id_registerer\\012\\011\\011,dbin_id)\\012\\011values \\012\\011\\011(nextval('PROPERTY_TYPE_ID_SEQ')\\012\\011\\011,'GENE_SYMBOLS'\\012\\011\\011,'Gene symbols'\\012\\011\\011,'Gene symbols'\\012\\011\\011,(select id from data_types where code ='VARCHAR')\\012\\011\\011,(select id from persons where user_id ='system')\\012\\011\\011,(select id from database_instances where is_original_source = 'T')\\012\\011);\\012\\011\\011\\012\\011insert into material_type_property_types( \\012\\011 id,\\012\\011 maty_id,\\012\\011 prty_id,\\012\\011 is_mandatory,\\012\\011 pers_id_registerer,\\012\\011 ordinal\\012\\011) values(\\012\\011\\011\\011nextval('mtpt_id_seq'), \\012\\011\\011\\011(select id from material_types where code = 'GENE'),\\012\\011\\011\\011(select id from property_types where code = 'GENE_SYMBOLS'),\\012\\011\\011\\011false,\\012\\011\\011\\011(select id from persons where user_id ='system'),\\012\\011\\011\\011(select max(ordinal)+1 from material_type_property_types \\012\\011\\011\\011\\011where maty_id = (select id from material_types where code = 'GENE'))\\012\\011\\011);\\012\\012\\011--------------------------------------------------\\012\\011-- create temporary table with all gene migration information\\012\\011--------------------------------------------------\\012\\012\\011create temp table genes \\012\\011(\\012\\011\\011id tech_id,\\012\\011\\011code code,\\012\\011\\011library_id generic_value,\\012\\011\\011gene_codes generic_value,\\012\\011\\011new_id tech_id,\\012\\011\\011library_tech_id tech_id\\011\\011\\012\\011);\\012\\011\\012\\011insert into genes (id, code, library_id, library_tech_id)\\012\\011\\011(select m.id, m.code, mp.value as library_id, mp.id as library_tech_id from materials m, material_properties mp, material_type_property_types mtpt, property_types pt, material_types mt\\012\\011\\011where mp.mate_id = m.id and mp.mtpt_id = mtpt.id and pt.id = mtpt.prty_id and pt.code = 'LIBRARY_ID' and mt.id = m.maty_id and mt.id = mtpt.maty_id and mt.code = 'GENE');\\012\\011\\012\\011update genes set new_id = map.to_id from (select g_from.id as from_id, min(g_to.id) as to_id from genes g_from, genes g_to where g_from.library_id = g_to.library_id group by g_from.id) as map where map.from_id = id;\\011\\012\\011\\012\\011update genes set gene_codes = map.gene_codes from (select g_from.library_id as lib_id, merge_words(distinct g_to.code) as gene_codes from genes g_from, genes g_to where g_from.library_id = g_to.library_id group by g_from.library_id) as map where map.lib_id = library_id;\\011\\012\\012\\011--------------------------------------------------\\012\\011-- update gene references\\012\\011--------------------------------------------------\\012\\012\\011update EXPERIMENTS set MATE_ID_STUDY_OBJECT = genes.new_id from genes where genes.id = MATE_ID_STUDY_OBJECT and not genes.id = genes.new_id;\\012\\011update EXPERIMENT_PROPERTIES set MATE_PROP_ID = genes.new_id from genes where genes.id = MATE_PROP_ID and not genes.id = genes.new_id;\\012\\011update MATERIAL_PROPERTIES set MATE_PROP_ID = genes.new_id from genes where genes.id = MATE_PROP_ID and not genes.id = genes.new_id;\\012\\011update SAMPLE_PROPERTIES set MATE_PROP_ID = genes.new_id from genes where genes.id = MATE_PROP_ID and not genes.id = genes.new_id;\\012\\011update DATA_SET_PROPERTIES set MATE_PROP_ID = genes.new_id from genes where genes.id = MATE_PROP_ID and not genes.id = genes.new_id;\\012\\011\\012\\011delete from material_properties where mate_id in (select id from genes where not genes.id = genes.new_id);\\012\\011delete from MATERIALS where id in (select id from genes where not genes.id = genes.new_id);\\012\\012\\011delete from genes where id in (select id from genes where not genes.id = genes.new_id);\\012\\012\\012\\011--------------------------------------------------\\012\\011-- replace gene code with library_id\\012\\011--------------------------------------------------\\012\\011\\012\\011update materials set code = genes.library_id from genes where materials.id = genes.id ;\\012\\011delete from material_properties where id in (select library_tech_id from genes);\\012\\011\\012\\011--------------------------------------------------\\012\\011-- create a gene symbols property for each gene\\012\\011--------------------------------------------------\\012\\011\\012\\011insert into material_properties\\012\\011\\011(id\\012\\011 , mate_id\\012\\011 , mtpt_id\\012\\011 , "value"\\012\\011 , pers_id_registerer)\\012\\011\\011(select nextval('material_property_id_seq') id\\012\\011 \\011, genes.id mate_id\\012\\011 , (select mtpt.id\\012\\011 \\011\\011from material_type_property_types mtpt, material_types mt, property_types pt\\012\\011 \\011\\011where pt.code = 'GENE_SYMBOLS' and mt.code = 'GENE' and mtpt.prty_id = pt.id\\012\\011 \\011and mtpt.maty_id = mt.id) mtpt_id\\012\\011 , genes.gene_codes "value"\\012\\011 , (select id from persons where user_id = 'system') pers_id_registerer\\012\\011 \\011from genes); \\012\\012\\011--------------------------------------------------\\012\\011-- delete temporary table\\012\\011--------------------------------------------------\\012\\011\\012\\011drop table genes;\\012\\011\\012END;\\012$$ LANGUAGE 'plpgsql';\\012\\012select REPLACE_GENE_SYMBOL_BY_GENE_ID();\\012drop function REPLACE_GENE_SYMBOL_BY_GENE_ID();\\012DROP AGGREGATE merge_words(text);\\012drop function merge_words(text,text);\\012\\012\\012--------------------------------------------------------------------------------------\\012--------------------------------------------------------------------------------------\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012 \N +056 source/sql/postgresql/migration/migration-055-056.sql SUCCESS 2010-09-07 11:21:53.17 -- Migration from 055 to 056\\012\\012--------------------------------------------------------------------------------------\\012--------------------------------------------------------------------------------------\\012-- Screening specific migration. Nothing will be performed on openBIS databases \\012-- which are not screening specific.\\012--------------------------------------------------------------------------------------\\012--------------------------------------------------------------------------------------\\012\\012CREATE OR REPLACE FUNCTION merge_words(text, text) RETURNS text AS $$\\012DECLARE\\012 BEGIN\\012 IF character_length($1) > 0 THEN\\012 RETURN $1 || ' ' || $2;\\012 ELSE\\012 RETURN $2;\\012 END IF;\\012 END;\\012$$ LANGUAGE plpgsql;\\012\\012CREATE AGGREGATE merge_words(text)\\012(\\012 SFUNC = merge_words,\\012 STYPE = text\\012);\\012\\012\\012CREATE OR REPLACE FUNCTION REPLACE_GENE_SYMBOL_BY_GENE_ID() RETURNS void AS $$\\012DECLARE\\012\\011counter int;\\012\\011library_id_assigned_to_gene bool;\\012BEGIN\\012\\011--------------------------------------------------\\012\\011-- create a GENE_SYMBOL property and assign it to GENE\\012\\011--------------------------------------------------\\012\\011\\012\\011select true \\012\\011into library_id_assigned_to_gene \\012\\011from material_type_property_types mtpt, material_types mt, property_types pt \\012\\011where mtpt.maty_id = mt.id and mtpt.prty_id = pt.id \\012\\011\\011and mt.code = 'GENE' and pt.code = 'LIBRARY_ID';\\012\\011\\012\\011if library_id_assigned_to_gene IS NULL then \\012\\011\\011-- skip migration if gene has no library_id property\\012\\011\\011return;\\012\\011end if; \\012\\011\\012\\011\\012\\011select count(*)\\012\\011into counter \\012\\011from \\012\\011\\011(select m.id, count(mp.id) as c \\012\\011\\011\\011from materials m, material_types mt, material_properties mp, material_type_property_types mtpt, property_types pt \\012\\011\\011\\011where m.maty_id = mt.id and mp.mate_id = m.id and mp.mtpt_id = mtpt.id and mtpt.maty_id = mt.id and pt.id = mtpt.prty_id\\012\\011\\011\\011\\011and mt.code = 'GENE' and pt.code = 'LIBRARY_ID' \\012\\011\\011\\011group by m.id) as counter_table \\012\\011where c < 1; \\012\\011\\012\\011if counter > 0 then \\012\\011\\011-- skip migration if there is at least one gene without library_id\\012\\011\\011return;\\012\\011end if;\\012\\011\\012\\011\\012\\011insert into property_types\\012\\011\\011(id\\012\\011\\011,code\\012\\011\\011,description\\012\\011\\011,label\\012\\011\\011,daty_id\\012\\011\\011,pers_id_registerer\\012\\011\\011,dbin_id)\\012\\011values \\012\\011\\011(nextval('PROPERTY_TYPE_ID_SEQ')\\012\\011\\011,'GENE_SYMBOLS'\\012\\011\\011,'Gene symbols'\\012\\011\\011,'Gene symbols'\\012\\011\\011,(select id from data_types where code ='VARCHAR')\\012\\011\\011,(select id from persons where user_id ='system')\\012\\011\\011,(select id from database_instances where is_original_source = 'T')\\012\\011);\\012\\011\\011\\012\\011insert into material_type_property_types( \\012\\011 id,\\012\\011 maty_id,\\012\\011 prty_id,\\012\\011 is_mandatory,\\012\\011 pers_id_registerer,\\012\\011 ordinal\\012\\011) values(\\012\\011\\011\\011nextval('mtpt_id_seq'), \\012\\011\\011\\011(select id from material_types where code = 'GENE'),\\012\\011\\011\\011(select id from property_types where code = 'GENE_SYMBOLS'),\\012\\011\\011\\011false,\\012\\011\\011\\011(select id from persons where user_id ='system'),\\012\\011\\011\\011(select max(ordinal)+1 from material_type_property_types \\012\\011\\011\\011\\011where maty_id = (select id from material_types where code = 'GENE'))\\012\\011\\011);\\012\\012\\011--------------------------------------------------\\012\\011-- create temporary table with all gene migration information\\012\\011--------------------------------------------------\\012\\012\\011create temp table genes \\012\\011(\\012\\011\\011id tech_id,\\012\\011\\011code code,\\012\\011\\011library_id generic_value,\\012\\011\\011gene_codes generic_value,\\012\\011\\011new_id tech_id,\\012\\011\\011library_tech_id tech_id\\011\\011\\012\\011);\\012\\011\\012\\011insert into genes (id, code, library_id, library_tech_id)\\012\\011\\011(select m.id, m.code, mp.value as library_id, mp.id as library_tech_id from materials m, material_properties mp, material_type_property_types mtpt, property_types pt, material_types mt\\012\\011\\011where mp.mate_id = m.id and mp.mtpt_id = mtpt.id and pt.id = mtpt.prty_id and pt.code = 'LIBRARY_ID' and mt.id = m.maty_id and mt.id = mtpt.maty_id and mt.code = 'GENE');\\012\\011\\012\\011update genes set new_id = map.to_id from (select g_from.id as from_id, min(g_to.id) as to_id from genes g_from, genes g_to where g_from.library_id = g_to.library_id group by g_from.id) as map where map.from_id = id;\\011\\012\\011\\012\\011update genes set gene_codes = map.gene_codes from (select g_from.library_id as lib_id, merge_words(distinct g_to.code) as gene_codes from genes g_from, genes g_to where g_from.library_id = g_to.library_id group by g_from.library_id) as map where map.lib_id = library_id;\\011\\012\\012\\011--------------------------------------------------\\012\\011-- update gene references\\012\\011--------------------------------------------------\\012\\012\\011update EXPERIMENTS set MATE_ID_STUDY_OBJECT = genes.new_id from genes where genes.id = MATE_ID_STUDY_OBJECT and not genes.id = genes.new_id;\\012\\011update EXPERIMENT_PROPERTIES set MATE_PROP_ID = genes.new_id from genes where genes.id = MATE_PROP_ID and not genes.id = genes.new_id;\\012\\011update MATERIAL_PROPERTIES set MATE_PROP_ID = genes.new_id from genes where genes.id = MATE_PROP_ID and not genes.id = genes.new_id;\\012\\011update SAMPLE_PROPERTIES set MATE_PROP_ID = genes.new_id from genes where genes.id = MATE_PROP_ID and not genes.id = genes.new_id;\\012\\011update DATA_SET_PROPERTIES set MATE_PROP_ID = genes.new_id from genes where genes.id = MATE_PROP_ID and not genes.id = genes.new_id;\\012\\011\\012\\011delete from material_properties where mate_id in (select id from genes where not genes.id = genes.new_id);\\012\\011delete from MATERIALS where id in (select id from genes where not genes.id = genes.new_id);\\012\\012\\011delete from genes where id in (select id from genes where not genes.id = genes.new_id);\\012\\012\\012\\011--------------------------------------------------\\012\\011-- replace gene code with library_id\\012\\011--------------------------------------------------\\012\\011\\012\\011update materials set code = genes.library_id from genes where materials.id = genes.id ;\\012\\011delete from material_properties where id in (select library_tech_id from genes);\\012\\011\\012\\011--------------------------------------------------\\012\\011-- create a gene symbols property for each gene\\012\\011--------------------------------------------------\\012\\011\\012\\011insert into material_properties\\012\\011\\011(id\\012\\011 , mate_id\\012\\011 , mtpt_id\\012\\011 , "value"\\012\\011 , pers_id_registerer)\\012\\011\\011(select nextval('material_property_id_seq') id\\012\\011 \\011, genes.id mate_id\\012\\011 , (select mtpt.id\\012\\011 \\011\\011from material_type_property_types mtpt, material_types mt, property_types pt\\012\\011 \\011\\011where pt.code = 'GENE_SYMBOLS' and mt.code = 'GENE' and mtpt.prty_id = pt.id\\012\\011 \\011and mtpt.maty_id = mt.id) mtpt_id\\012\\011 , genes.gene_codes "value"\\012\\011 , (select id from persons where user_id = 'system') pers_id_registerer\\012\\011 \\011from genes); \\012\\012\\011--------------------------------------------------\\012\\011-- delete temporary table\\012\\011--------------------------------------------------\\012\\011\\012\\011drop table genes;\\012\\011\\012END;\\012$$ LANGUAGE 'plpgsql';\\012\\012select REPLACE_GENE_SYMBOL_BY_GENE_ID();\\012drop function REPLACE_GENE_SYMBOL_BY_GENE_ID();\\012DROP AGGREGATE merge_words(text);\\012drop function merge_words(text,text);\\012\\012\\012--------------------------------------------------------------------------------------\\012--------------------------------------------------------------------------------------\\012\\012UPDATE sample_types SET code = 'SIRNA_WELL' WHERE code = 'OLIGO_WELL';\\012UPDATE material_types SET code = 'SIRNA' WHERE code = 'OLIGO';\\012UPDATE property_types SET code = 'SIRNA', label = 'siRNA' WHERE code = 'OLIGO';\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012\\012 \N diff --git a/openbis/sourceTest/sql/postgresql/056/032=material_types.tsv b/openbis/sourceTest/sql/postgresql/056/032=material_types.tsv index bc0b51327ee..da16d4da3b4 100644 --- a/openbis/sourceTest/sql/postgresql/056/032=material_types.tsv +++ b/openbis/sourceTest/sql/postgresql/056/032=material_types.tsv @@ -1,7 +1,7 @@ -1 VIRUS Virus 1 2009-03-23 15:34:44.462776+01 -2 CELL_LINE Cell Line or Cell Culture. The growing of cells under controlled conditions. 1 2009-03-23 15:34:44.462776+01 -3 GENE Gene 1 2009-03-23 15:34:44.462776+01 -4 OLIGO Oligo nucleotide 1 2009-03-23 15:34:44.462776+01 -5 CONTROL Control of a control layout 1 2009-03-23 15:34:44.462776+01 -6 BACTERIUM Bacterium 1 2009-03-23 15:34:44.462776+01 -7 COMPOUND Compound 1 2009-03-23 15:34:44.462776+01 +1 VIRUS Virus 1 2009-03-23 07:34:44.462776-07 +2 CELL_LINE Cell Line or Cell Culture. The growing of cells under controlled conditions. 1 2009-03-23 07:34:44.462776-07 +3 GENE Gene 1 2009-03-23 07:34:44.462776-07 +5 CONTROL Control of a control layout 1 2009-03-23 07:34:44.462776-07 +6 BACTERIUM Bacterium 1 2009-03-23 07:34:44.462776-07 +7 COMPOUND Compound 1 2009-03-23 07:34:44.462776-07 +4 SIRNA Oligo nucleotide 1 2009-03-23 07:34:44.462776-07 diff --git a/openbis/sourceTest/sql/postgresql/056/036=property_types.tsv b/openbis/sourceTest/sql/postgresql/056/036=property_types.tsv index 3ea8eff7141..1feffc8b233 100644 --- a/openbis/sourceTest/sql/postgresql/056/036=property_types.tsv +++ b/openbis/sourceTest/sql/postgresql/056/036=property_types.tsv @@ -1,16 +1,16 @@ -1 DESCRIPTION A Description Description 1 2008-11-05 09:18:00.622+01 1 \N f f 1 \N -2 GENE_SYMBOL Gene Symbol, e.g. BMP15 Gene Symbol 1 2008-11-05 09:18:00.622+01 1 \N f f 1 \N -3 NUCLEOTIDE_SEQUENCE A sequence of nucleotides Nucleotide Sequence 1 2008-11-05 09:18:00.622+01 1 \N f f 1 \N -4 REFSEQ NCBI Reference Sequence code, applicable to sequences of type: DNA, RNA, protein RefSeq 1 2008-11-05 09:18:00.622+01 1 \N f f 1 \N -5 OFFSET Offset from the start of the sequence Offset 2 2008-11-05 09:18:00.622+01 1 \N f f 1 \N -6 PLATE_GEOMETRY Plate Geometry Plate Geometry 6 2008-11-05 09:18:00.622+01 1 1 t t 1 \N -7 EYE_COLOR The color of the eyes Eye color 1 2008-11-05 09:18:16.559+01 2 \N f f 1 \N -8 SIZE The size of the object Size 2 2008-11-05 09:18:16.559+01 2 \N f f 1 \N -9 VOLUME The volume of this person Volume 3 2008-11-05 09:18:16.559+01 2 \N f f 1 \N -10 IS_VALID Can the material be used? Valid? 4 2008-11-05 09:18:16.559+01 2 \N f f 1 \N -11 PURCHASE_DATE When material has been bought Purchased 5 2008-11-05 09:18:16.559+01 2 \N f f 1 \N -13 GENDER The gender of the living organism Gender 6 2008-11-05 09:18:31.545+01 2 4 f f 1 \N -14 COMMENT Any other comments Comment 1 2008-11-05 09:18:31.545+01 2 \N f f 1 \N -15 ORGANISM The organism from which cells come Organism 6 2008-11-05 09:18:31.545+01 2 3 f f 1 \N -25 BACTERIUM bacterium bacterium 7 2009-08-18 17:52:05.435021+02 2 \N f f 1 6 -26 ANY_MATERIAL any_material any_material 7 2009-08-18 17:52:47.771005+02 2 \N f f 1 \N +1 DESCRIPTION A Description Description 1 2008-11-05 00:18:00.622-08 1 \N f f 1 \N +2 GENE_SYMBOL Gene Symbol, e.g. BMP15 Gene Symbol 1 2008-11-05 00:18:00.622-08 1 \N f f 1 \N +3 NUCLEOTIDE_SEQUENCE A sequence of nucleotides Nucleotide Sequence 1 2008-11-05 00:18:00.622-08 1 \N f f 1 \N +4 REFSEQ NCBI Reference Sequence code, applicable to sequences of type: DNA, RNA, protein RefSeq 1 2008-11-05 00:18:00.622-08 1 \N f f 1 \N +5 OFFSET Offset from the start of the sequence Offset 2 2008-11-05 00:18:00.622-08 1 \N f f 1 \N +6 PLATE_GEOMETRY Plate Geometry Plate Geometry 6 2008-11-05 00:18:00.622-08 1 1 t t 1 \N +7 EYE_COLOR The color of the eyes Eye color 1 2008-11-05 00:18:16.559-08 2 \N f f 1 \N +8 SIZE The size of the object Size 2 2008-11-05 00:18:16.559-08 2 \N f f 1 \N +9 VOLUME The volume of this person Volume 3 2008-11-05 00:18:16.559-08 2 \N f f 1 \N +10 IS_VALID Can the material be used? Valid? 4 2008-11-05 00:18:16.559-08 2 \N f f 1 \N +11 PURCHASE_DATE When material has been bought Purchased 5 2008-11-05 00:18:16.559-08 2 \N f f 1 \N +13 GENDER The gender of the living organism Gender 6 2008-11-05 00:18:31.545-08 2 4 f f 1 \N +14 COMMENT Any other comments Comment 1 2008-11-05 00:18:31.545-08 2 \N f f 1 \N +15 ORGANISM The organism from which cells come Organism 6 2008-11-05 00:18:31.545-08 2 3 f f 1 \N +25 BACTERIUM bacterium bacterium 7 2009-08-18 08:52:05.435021-07 2 \N f f 1 6 +26 ANY_MATERIAL any_material any_material 7 2009-08-18 08:52:47.771005-07 2 \N f f 1 \N diff --git a/openbis/sourceTest/sql/postgresql/056/043=sample_types.tsv b/openbis/sourceTest/sql/postgresql/056/043=sample_types.tsv index 883d6918367..68b9fe1ac7b 100644 --- a/openbis/sourceTest/sql/postgresql/056/043=sample_types.tsv +++ b/openbis/sourceTest/sql/postgresql/056/043=sample_types.tsv @@ -1,6 +1,6 @@ -1 MASTER_PLATE Master Plate 1 t 0 0 2009-03-23 15:34:44.462776+01 f S f -2 DILUTION_PLATE Dilution Plate 1 t 1 0 2009-03-23 15:34:44.462776+01 f S f -5 CONTROL_LAYOUT Control layout 1 t 0 0 2009-03-23 15:34:44.462776+01 f S f -6 WELL Plate Well 1 f 0 1 2009-03-23 15:34:44.462776+01 f S f -3 CELL_PLATE Cell Plate 1 t 1 0 2009-03-23 15:34:44.462776+01 f S f -4 REINFECT_PLATE Re-infection Plate 1 t 1 0 2009-03-23 15:34:44.462776+01 f S f +1 MASTER_PLATE Master Plate 1 t 0 0 2009-03-23 07:34:44.462776-07 f S f +2 DILUTION_PLATE Dilution Plate 1 t 1 0 2009-03-23 07:34:44.462776-07 f S f +5 CONTROL_LAYOUT Control layout 1 t 0 0 2009-03-23 07:34:44.462776-07 f S f +6 WELL Plate Well 1 f 0 1 2009-03-23 07:34:44.462776-07 f S f +3 CELL_PLATE Cell Plate 1 t 1 0 2009-03-23 07:34:44.462776-07 f S f +4 REINFECT_PLATE Re-infection Plate 1 t 1 0 2009-03-23 07:34:44.462776-07 f S f diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java index b3b2a9c14fa..1f5dab35be8 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ClientPluginFactory.java @@ -94,7 +94,7 @@ public final class ClientPluginFactory extends AbstractClientPluginFactory<Scree } else if (entityKind == EntityKind.MATERIAL) { types.add(ScreeningConstants.GENE_PLUGIN_TYPE_CODE); - types.add(ScreeningConstants.OLIGO_PLUGIN_TYPE_NAME); + types.add(ScreeningConstants.SIRNA_PLUGIN_TYPE_NAME); // NOTE: it would be better to fetch all the material types from the db, but we cannot // do this - this code is executed before the user logs in. // Another way not to hardcode material types would be to allow the plugin to be used diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/sample/LibrarySampleBatchRegistrationForm.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/sample/LibrarySampleBatchRegistrationForm.java index a211f0899c8..d9ab9e43525 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/sample/LibrarySampleBatchRegistrationForm.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/sample/LibrarySampleBatchRegistrationForm.java @@ -50,9 +50,9 @@ public final class LibrarySampleBatchRegistrationForm extends AbstractSampleBatc private static final String PLATES = "Plates"; - private static final String OLIGOS_PLATES = "Oligos + Plates"; + private static final String SIRNAS_PLATES = "siRNAs + Plates"; - private static final String GENES_OLIGOS_PLATES = "Genes + Oligos + Plates"; + private static final String GENES_SIRNAS_PLATES = "Genes + siRNAs + Plates"; private static final String SESSION_KEY = "qiagen-library-sample-batch-registration"; @@ -102,8 +102,8 @@ public final class LibrarySampleBatchRegistrationForm extends AbstractSampleBatc private SimpleComboBox<String> createScope() { SimpleComboBox<String> options = new SimpleComboBox<String>(); - options.add(GENES_OLIGOS_PLATES); - options.add(OLIGOS_PLATES); + options.add(GENES_SIRNAS_PLATES); + options.add(SIRNAS_PLATES); options.add(PLATES); options .setFieldLabel(viewContext @@ -112,7 +112,7 @@ public final class LibrarySampleBatchRegistrationForm extends AbstractSampleBatc options.setForceSelection(true); options.setEditable(false); options.setAllowBlank(false); - options.setSimpleValue(GENES_OLIGOS_PLATES); + options.setSimpleValue(GENES_SIRNAS_PLATES); FieldUtil.markAsMandatory(options); return options; } @@ -137,12 +137,12 @@ public final class LibrarySampleBatchRegistrationForm extends AbstractSampleBatc private RegistrationScope extractRegistrationScope() { String value = scopeField.getValue().getValue(); - if (value.equals(GENES_OLIGOS_PLATES)) + if (value.equals(GENES_SIRNAS_PLATES)) { - return RegistrationScope.GENES_OLIGOS_PLATES; - } else if (value.equals(OLIGOS_PLATES)) + return RegistrationScope.GENES_SIRNAS_PLATES; + } else if (value.equals(SIRNAS_PLATES)) { - return RegistrationScope.OLIGOS_PLATES; + return RegistrationScope.SIRNAS_PLATES; } else if (value.equals(PLATES)) { return RegistrationScope.PLATES; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/LibraryExtractor.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/LibraryExtractor.java index bed76500635..0c59e69802f 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/LibraryExtractor.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/LibraryExtractor.java @@ -85,7 +85,7 @@ class LibraryExtractor throw new UserFailureException(status.tryGetErrorMessage()); } newGenes = registrationScope.isGenes() ? extractMaterials(genesFile) : null; - newOligos = registrationScope.isOligos() ? extractMaterials(oligosFile) : null; + newOligos = registrationScope.isSiRNAs() ? extractMaterials(oligosFile) : null; newSamplesWithType = extractSamples(platesFile); } catch (FileNotFoundException ex) { diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/LibraryRegistrationTask.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/LibraryRegistrationTask.java index 0beee99cfc8..cdad5cd61ac 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/LibraryRegistrationTask.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/LibraryRegistrationTask.java @@ -78,12 +78,12 @@ class LibraryRegistrationTask implements Runnable if (newOligosOrNull != null) { genericServer.registerOrUpdateMaterials(sessionToken, - ScreeningConstants.OLIGO_PLUGIN_TYPE_NAME, newOligosOrNull); - message.append("Successfuly saved " + newOligosOrNull.size() + " oligos.\n"); + ScreeningConstants.SIRNA_PLUGIN_TYPE_NAME, newOligosOrNull); + message.append("Successfuly saved " + newOligosOrNull.size() + " siRNAs.\n"); } } catch (Exception ex) { - message.append("ERROR: Oligos could not be saved!\n"); + message.append("ERROR: siRNAs could not be saved!\n"); message.append(ex.getMessage()); sendErrorEmail(message, startDate, email); return; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/library_tools/LibraryEntityRegistrator.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/library_tools/LibraryEntityRegistrator.java index 1c796dadd73..51efc742467 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/library_tools/LibraryEntityRegistrator.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/library_tools/LibraryEntityRegistrator.java @@ -128,8 +128,9 @@ public class LibraryEntityRegistrator private static final String HEADER_PLATES = "[PLATE]\n" + join("identifier", "experiment", "$PLATE_GEOMETRY"); - private static final String HEADER_OLIGOS = - "[OLIGO_WELL]\n" + join("identifier", "container", "OLIGO", "GENE"); + private static final String HEADER_SIRNAS = + "[" + ScreeningConstants.SIRNA_WELL_TYPE_CODE + "]\n" + + join("identifier", "container", "SIRNA", "GENE"); private final Set<String/* plate code */> registeredPlates; @@ -178,7 +179,7 @@ public class LibraryEntityRegistrator String wellCode = extractor.getWellCode(row); String wellIdentifier = plateId + ":" + wellCode; String oligoMaterialProperty = - oligoId + " (" + ScreeningConstants.OLIGO_PLUGIN_TYPE_NAME + ")"; + oligoId + " (" + ScreeningConstants.SIRNA_PLUGIN_TYPE_NAME + ")"; String geneMaterialProperty = geneId + " (" + ScreeningConstants.GENE_PLUGIN_TYPE_CODE + ")"; saveWell(wellIdentifier, plateId, oligoMaterialProperty, geneMaterialProperty); @@ -192,7 +193,7 @@ public class LibraryEntityRegistrator // saves all the wells to the file public void saveResults() throws IOException { - writeLine(HEADER_OLIGOS); + writeLine(HEADER_SIRNAS); for (String[] wellLine : wellRegistrationBuffer) { writeLine(wellLine); @@ -266,7 +267,7 @@ public class LibraryEntityRegistrator String inhibitedGeneCode) throws IOException { String geneId = extractor.getGeneId(row); - String oligoId = extractor.getOligoId(row); + String oligoId = extractor.getSiRNAId(row); String openbisOligoId = geneId + "_" + oligoId; if (containsCaseInsensitive(registeredOligos, openbisOligoId) == false) { diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/library_tools/QiagenScreeningLibraryColumnExtractor.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/library_tools/QiagenScreeningLibraryColumnExtractor.java index 83d6d1269aa..59d3fa5791c 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/library_tools/QiagenScreeningLibraryColumnExtractor.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/library_tools/QiagenScreeningLibraryColumnExtractor.java @@ -48,10 +48,10 @@ public class QiagenScreeningLibraryColumnExtractor extends AbstractColumnExtract private final static String RNA_SEQUENCE = "sirna"; - private final static String OLIGO_ID = "productId"; + private final static String SIRNA_ID = "productId"; private final static String[] EXPECTED_COLUMNS = new String[] - { PLATE_NAME, WELL_ROW, WELL_COL, RNA_SEQUENCE, GENE_ID, GENE_SYMBOL, GENE_DESC, OLIGO_ID }; + { PLATE_NAME, WELL_ROW, WELL_COL, RNA_SEQUENCE, GENE_ID, GENE_SYMBOL, GENE_DESC, SIRNA_ID }; // ------------- @@ -97,9 +97,9 @@ public class QiagenScreeningLibraryColumnExtractor extends AbstractColumnExtract return getValue(row, RNA_SEQUENCE); } - public String getOligoId(String[] row) + public String getSiRNAId(String[] row) { - return getValue(row, OLIGO_ID); + return getValue(row, SIRNA_ID); } public String getGeneId(String[] row) diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/library_tools/ScreeningLibraryTransformer.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/library_tools/ScreeningLibraryTransformer.java index e04e8954ded..5393aa87230 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/library_tools/ScreeningLibraryTransformer.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/library_tools/ScreeningLibraryTransformer.java @@ -40,7 +40,7 @@ public class ScreeningLibraryTransformer private static final String GENES_FILE_NAME = "genes.txt"; - private static final String OLIGOS_FILE_NAME = "oligos.txt"; + private static final String SIRNAS_FILE_NAME = "oligos.txt"; private static final String PLATES_FILE_NAME = "plates.txt"; @@ -65,7 +65,7 @@ public class ScreeningLibraryTransformer } Status status = readLibrary(new FileInputStream(input), experimentIdentifier, plateGeometry, - groupCode, GENES_FILE_NAME, OLIGOS_FILE_NAME, PLATES_FILE_NAME); + groupCode, GENES_FILE_NAME, SIRNAS_FILE_NAME, PLATES_FILE_NAME); if (status.isError()) { System.err.println(status.tryGetErrorMessage()); diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/api/v1/dto/MaterialTypeIdentifier.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/api/v1/dto/MaterialTypeIdentifier.java index aa5a22eaf9f..928d9122bf7 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/api/v1/dto/MaterialTypeIdentifier.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/api/v1/dto/MaterialTypeIdentifier.java @@ -36,9 +36,9 @@ public class MaterialTypeIdentifier implements Serializable public static final MaterialTypeIdentifier GENE = new MaterialTypeIdentifier("GENE"); /** - * Material identifier for an oligo-nucleotide + * Material identifier for an siRNA-nucleotide */ - public static final MaterialTypeIdentifier OLIGO = new MaterialTypeIdentifier("OLIGO"); + public static final MaterialTypeIdentifier OLIGO = new MaterialTypeIdentifier("SIRNA"); /** * Material identifier for a compound. diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/LibraryRegistrationInfo.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/LibraryRegistrationInfo.java index 01752b68e17..560d2baf812 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/LibraryRegistrationInfo.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/LibraryRegistrationInfo.java @@ -31,21 +31,21 @@ public class LibraryRegistrationInfo implements IsSerializable, Serializable { public enum RegistrationScope implements IsSerializable { - PLATES, OLIGOS_PLATES, GENES_OLIGOS_PLATES; + PLATES, SIRNAS_PLATES, GENES_SIRNAS_PLATES; public boolean isPlates() { return true; } - public boolean isOligos() + public boolean isSiRNAs() { - return this.equals(OLIGOS_PLATES) || this.equals(GENES_OLIGOS_PLATES); + return this.equals(SIRNAS_PLATES) || this.equals(GENES_SIRNAS_PLATES); } public boolean isGenes() { - return this.equals(GENES_OLIGOS_PLATES); + return this.equals(GENES_SIRNAS_PLATES); } } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/ScreeningConstants.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/ScreeningConstants.java index f267ff82c55..8bde1830459 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/ScreeningConstants.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/ScreeningConstants.java @@ -47,7 +47,7 @@ public class ScreeningConstants // type of the dataset which stores image analysis data, there should be at most one public static final String IMAGE_ANALYSIS_DATASET_TYPE = "HCS_IMAGE_ANALYSIS_DATA"; - public static final String OLIGO_WELL_TYPE_CODE = "OLIGO_WELL"; + public static final String SIRNA_WELL_TYPE_CODE = "SIRNA_WELL"; public static final String CONTROL_WELL_TYPE_CODE = "CONTROL_WELL"; @@ -58,8 +58,8 @@ public class ScreeningConstants // code of the gene material type public static final String GENE_PLUGIN_TYPE_CODE = "GENE"; - // code of the oligo material type - public static final String OLIGO_PLUGIN_TYPE_NAME = "OLIGO"; + // code of the siRNA material type + public static final String SIRNA_PLUGIN_TYPE_NAME = "SIRNA"; // code of plate geometry vocabulary public static final String PLATE_GEOMETRY = "$PLATE_GEOMETRY"; diff --git a/screening/source/sql/postgresql/006/data.sql b/screening/source/sql/postgresql/006/data.sql index ceb12636476..ec6617a0e52 100644 --- a/screening/source/sql/postgresql/006/data.sql +++ b/screening/source/sql/postgresql/006/data.sql @@ -59,7 +59,7 @@ COPY material_types (id, code, description, dbin_id, modification_timestamp) FRO 1 VIRUS Virus 1 2009-11-27 16:02:26.451046+01 2 CELL_LINE Cell Line or Cell Culture. The growing of cells under controlled conditions. 1 2009-11-27 16:02:26.451046+01 3 GENE Gene 1 2009-11-27 16:02:26.451046+01 -4 OLIGO Oligo nucleotide 1 2009-11-27 16:02:26.451046+01 +4 SIRNA siRNA nucleotide 1 2009-11-27 16:02:26.451046+01 5 CONTROL Control of a control layout 1 2009-11-27 16:02:26.451046+01 6 BACTERIUM Bacterium 1 2009-11-27 16:02:26.451046+01 7 COMPOUND Compound 1 2009-11-27 16:02:26.451046+01 @@ -75,7 +75,7 @@ COPY property_types (id, code, description, label, daty_id, registration_timesta 4 REFSEQ NCBI Reference Sequence code, applicable to sequences of type: DNA, RNA, protein RefSeq 1 2008-02-28 13:03:03.358532+01 1 \N f f 1 \N 13 MICROSCOPE Microscope 7 2009-11-29 23:57:05.85618+01 1 3 f f 1 \N 7 INHIBITOR_OF Inhibitor Of Inhibitor Of 8 2009-11-27 16:02:45.060699+01 1 \N f f 1 3 -11 OLIGO Oligo Oligo 8 2009-11-29 23:56:19.39967+01 1 \N f f 1 4 +11 SIRNA siRNA siRNA 8 2009-11-29 23:56:19.39967+01 1 \N f f 1 4 12 CONTROL Control Control 8 2009-11-29 23:56:37.355313+01 1 \N f f 1 5 6 PLATE_GEOMETRY Plate Geometry Plate Geometry 7 2008-06-17 16:38:30.723292+02 1 2 t t 1 \N 15 NUMBER_OF_CHANNEL Channels 3 2009-12-17 10:56:17.239319+01 1 \N f f 1 \N @@ -158,7 +158,7 @@ COPY material_type_property_types (id, maty_id, prty_id, is_mandatory, registrat COPY sample_types (id, code, description, dbin_id, is_listable, generated_from_depth, part_of_depth, modification_timestamp, is_auto_generated_code, generated_code_prefix) FROM stdin; 3 PLATE Cell Plate 1 t 2 0 2009-11-27 16:02:26.451046+01 f S -7 OLIGO_WELL \N 1 f 0 1 2009-11-27 19:42:03.483115+01 f O +7 SIRNA_WELL \N 1 f 0 1 2009-11-27 19:42:03.483115+01 f O 8 CONTROL_WELL \N 1 f 0 1 2009-11-27 19:42:25.791288+01 f C 9 LIBRARY \N 1 f 0 0 2009-11-27 19:42:25.791288+01 f L \. @@ -197,7 +197,7 @@ select setval('mtpt_id_seq', 100); -------------------------------------------------- --- create a gene property and assign it to oligo well +-- create a gene property and assign it to sirna well -------------------------------------------------- insert into property_types( @@ -225,12 +225,12 @@ insert into sample_type_property_types( ordinal ) values( nextval('stpt_id_seq'), - (select id from sample_types where code = 'OLIGO_WELL'), + (select id from sample_types where code = 'SIRNA_WELL'), (select id from property_types where code = 'GENE'), false, (select id from persons where user_id ='system'), (select max(ordinal)+1 from sample_type_property_types - where saty_id = (select id from sample_types where code = 'OLIGO_WELL')) + where saty_id = (select id from sample_types where code = 'SIRNA_WELL')) ); -- GitLab