----------------------------------------------------------------------
--  Purpose:  Insert an initial data set into the table MATERIAL_TYPES
--
--  Authors: Randy Ramin-Wright (CRW)
--
--  Change History:
--
--  Date          Author       Description
--  21-May-2007   CRW          First Draft
--
-----------------------------------------------------------------------

insert into persons
(id
,first_name
,last_name
,user_id
,email)
values
(nextval('PERSON_ID_SEQ')
,''
,'System User'
,'system'
,''
);

insert into material_types
(id
,code
,description)
values 
(nextval('MATERIAL_TYPE_ID_SEQ')
,'VIRUS'
,'Virus'
);

insert into material_types
(id
,code
,description)
values 
(nextval('MATERIAL_TYPE_ID_SEQ')
,'CELLLINE'
,'Cell Line or Cell Culture. The growing of cells under controlled conditions.'
);

insert into material_types
(id
,code
,description)
values 
(nextval('MATERIAL_TYPE_ID_SEQ')
,'CELLNUCL'
,'Cell Nucleus'
);

insert into material_types
(id
,code
,description)
values 
(nextval('MATERIAL_TYPE_ID_SEQ')
,'GENE'
,'Gene'
);
insert into material_types
(id
,code
,description)
values 
(nextval('MATERIAL_TYPE_ID_SEQ')
,'OLIGO'
,'Oligo nucleotide'
);
insert into material_types
(id
,code
,description)
values 
(nextval('MATERIAL_TYPE_ID_SEQ')
,'CONTROL'
,'Control of a control layout'
);

----------------------------------------------------------------------
--  Purpose:  Insert an initial data set into the table MATERIALS
--
--  Authors: Randy Ramin-Wright (CRW)
--
--  Change History:
--
--  Date          Author       Description
--  21-May-2007   CRW          First Draft
--  20-Jun-2007   CRW          Added the virus list received from Berend
--  26-Oct-2007   CRW          The DESCRIPTION column was removed from 
--                             the insert statements as it was moved
--                             to the MATERIAL_PROPERTIES table.
-----------------------------------------------------------------------

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'SV40'
,1
--,'Simian Virus 40'
,1
);

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'VSV'
,1 
--,'Vesicular Stomatitis Virus'
,1
);

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'SFV'
,1
--,'Semliki Forest Virus'
,1
);

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'ROTAV'
,1
--,'Rotavirus'
,1
);

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'RRV'
,1
--,'Rhesus Rotavirus'
,1
);

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'HSV1'
,1
--,'Herpes Simplex Virus 1'
,1
);

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'EV1'
,1
--,'Echovirus 1'
,1
);

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'MHV'
,1
--,'Mouse Hepatitis Virus'
,1
);

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'FLU'
,1
--,'Influenza A virus'
,1
);

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'Ad3'
,1
--,'Adenovirus 3'
,1
);

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'Ad5'
,1
--,'Adenovirus 5'
,1
);

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'VV'
,1
--,'Vaccinia Virus'
,1
);

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'YFV'
,1
--,'Yellow Fever Virus'
,1
);

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'DV'
,1
--,'Dengue Virus 1'
,1
);

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'HRV2'
,1
--,'Human respiratory virus'
,1
);

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'RV'
,(select id from material_types where code = 'VIRUS')
--,'Rhinovirus'
,1
);

insert into materials
(  id
  ,code
  ,maty_id
  ,pers_id_registerer
  )
values 
(nextval('MATERIAL_ID_SEQ')
,'RSV'
,(select id from material_types where code = 'VIRUS')
--,'Respiratory Syncytial Virus'
,1
);

----------------------------------------------------------------------
--  Purpose:  Insert an initial data set into the table EXPERIMENT_TYPES
--
--  Authors: Randy Ramin-Wright (CRW)
--
--  Change History:
--
--  Date          Author       Description
--  21-May-2007   CRW          First Draft
--
-----------------------------------------------------------------------

insert into experiment_types
(id
,code
,description)
values 
(nextval('EXPERIMENT_TYPE_ID_SEQ')
,'SIRNAHCS'
,'Small Interfering RNA High Content Screening'
);

----------------------------------------------------------------------
--  Purpose:  Insert an initial data set into the table PROCEDURE_TYPES
--
--  Authors: Randy Ramin-Wright (CRW)
--
--  Change History:
--
--  Date          Author       Description
--  14-Jun-2007   CRW          First Draft
--  26-Jun-2007   CRW          Add Experiment Sample Registration
--
-----------------------------------------------------------------------

insert into procedure_types
(id
,code
,description)
values 
(nextval('PROCEDURE_TYPE_ID_SEQ')
,'DATA ACQUISITION'
,'Data Acquisition'
);

insert into procedure_types
(id
,code
,description)
values 
(nextval('PROCEDURE_TYPE_ID_SEQ')
,'IMAGE ANALYSIS'
,'Image Analysis'
);

----------------------------------------------------------------------
--  Purpose:  Insert an initial data set into the table OBSERVABLE_TYPES
--
--  Authors: Randy Ramin-Wright (CRW)
--
--  Change History:
--
--  Date          Author       Description
--  14-Jun-2007   CRW          First Draft
--
-----------------------------------------------------------------------

insert into observable_types
(id
,code
,description)
values 
(nextval('OBSERVABLE_TYPE_ID_SEQ')
,'IMAGE'
,'Image'
);

insert into observable_types
(id
,code
,description)
values 
(nextval('OBSERVABLE_TYPE_ID_SEQ')
,'IMAGE ANALYSIS'
,'Image Analysis'
);

----------------------------------------------------------------------
--  Purpose:  Insert an initial data set into the table FILE_FORMAT_TYPES
--
--  Authors: Randy Ramin-Wright (CRW)
--
--  Change History:
--
--  Date          Author       Description
--  14-Jun-2007   CRW          First Draft
--
-----------------------------------------------------------------------

insert into file_format_types
(id
,code
,description)
values 
(nextval('FILE_FORMAT_TYPE_ID_SEQ')
,'TIFF'
,'TIFF File'
);

insert into file_format_types
(id
,code
,description)
values 
(nextval('FILE_FORMAT_TYPE_ID_SEQ')
,'3VPROPRIETARY'
,'Data Analysis 3V proprietary format'
);

insert into file_format_types
(id
,code
,description)
values 
(nextval('FILE_FORMAT_TYPE_ID_SEQ')
,'PLKPROPRIETARY'
,'Data Analysis Pelkmans group proprietary format'
);

----------------------------------------------------------------------
--  Purpose:  Insert an initial data set into the table LOCATOR_TYPES
--
--  Authors: Randy Ramin-Wright (CRW)
--
--  Change History:
--
--  Date          Author       Description
--  27-Jun-2007   CRW          First Draft
--
-----------------------------------------------------------------------

insert into locator_types
(id
,code
,description)
values 
(nextval('LOCATOR_TYPE_ID_SEQ')
,'RELATIVE LOCATION'
,'Relative Location'
);

----------------------------------------------------------------------
--  Purpose:  Insert an initial data set into the table SAMPLE_TYPES
--
--  Authors: Randy Ramin-Wright (CRW)
--
--  Change History:
--
--  Date          Author       Description
--  26-Jun-2007   CRW          First Draft
--
-----------------------------------------------------------------------

insert into sample_types
(id
,code
,description)
values 
(nextval('SAMPLE_TYPE_ID_SEQ')
,'MASTER PLATE'
,'Master Plate'
);

insert into sample_types
(id
,code
,description)
values 
(nextval('SAMPLE_TYPE_ID_SEQ')
,'DILUTION PLATE'
,'Dilution Plate'
);

insert into sample_types
(id
,code
,description)
values 
(nextval('SAMPLE_TYPE_ID_SEQ')
,'CELL PLATE'
,'Cell Plate'
);

insert into sample_types
(id
,code
,description)
values 
(nextval('SAMPLE_TYPE_ID_SEQ')
,'REINFECT PLATE'
,'Reinfection Plate'
);

insert into sample_types
(id
,code
,description)
values 
(nextval('SAMPLE_TYPE_ID_SEQ')
,'CONTROL LAYOUT'
,'Control layout'
);

-- add default organization and project to simplify refactoring phase

insert into organizations
(id
,code)
values
(nextval('ORGANIZATION_ID_SEQ')
,'DEFAULT'
);

insert into organizations
(id
,code)
values
(nextval('ORGANIZATION_ID_SEQ')
,'3V'
);

insert into organizations
(id
,code)
values
(nextval('ORGANIZATION_ID_SEQ')
,'IMSB'
);

insert into projects
(id
,code
,orga_id)
values
(nextval('PROJECT_ID_SEQ')
,'DEFAULT'
,1
);

----------------------------------------------------------------------
--  Purpose:  Insert an initial data set into the table DATA_TYPES
--
--  Authors: Randy Ramin-Wright (CRW)
--
--  Change History:
--
--  Date          Author       Description
--  25-Oct-2007   CRW          First Draft
--
-----------------------------------------------------------------------

insert into data_types
(id
,code
,description)
values 
(nextval('DATA_TYPE_ID_SEQ')
,'VARCHAR'
,'Variable length character'
);

insert into data_types
(id
,code
,description)
values 
(nextval('DATA_TYPE_ID_SEQ')
,'INTEGER'
,'Integer'
);

insert into data_types
(id
,code
,description)
values 
(nextval('DATA_TYPE_ID_SEQ')
,'REAL'
,'Real number, i.e. an inexact, variable-precision numeric type'
);


----------------------------------------------------------------------
--  Purpose:  Insert an initial data set into the table PROPERTY_TYPES
--
--  Authors: Randy Ramin-Wright (CRW)
--
--  Change History:
--
--  Date          Author       Description
--  25-Oct-2007   CRW          First Draft
--
-----------------------------------------------------------------------

insert into property_types
(id
,code
,description
,label
,daty_id)
values 
(nextval('PROPERTY_TYPE_ID_SEQ')
,'DESCRIPTION'
,'A Description'
,'Description'
,(select id from data_types where code ='VARCHAR')
);

insert into property_types
(id
,code
,description
,label
,daty_id)
values 
(nextval('PROPERTY_TYPE_ID_SEQ')
,'GENE SYMBOL'
,'Gene Symbol, e.g. BMP15'
,'Gene Symbol'
,(select id from data_types where code ='VARCHAR')
);

insert into property_types
(id
,code
,description
,label
,daty_id)
values 
(nextval('PROPERTY_TYPE_ID_SEQ')
,'NUCLEOTIDE SEQUENCE'
,'A sequence of nucleotides'
,'Nucleotide Sequence'
,(select id from data_types where code ='VARCHAR')
);

insert into property_types
(id
,code
,description
,label
,daty_id)
values 
(nextval('PROPERTY_TYPE_ID_SEQ')
,'INHIBITED GENE'
,'The Material Code of the gene that is inhibited'
,'Inhibited Gene'
,(select id from data_types where code ='INTEGER')
);

insert into property_types
(id
,code
,description
,label
,daty_id)
values 
(nextval('PROPERTY_TYPE_ID_SEQ')
,'ACCESSION NUMBER'
,'Accession Number of the material'
,'Accession Number'
,(select id from data_types where code ='VARCHAR')
);

insert into property_types
(id
,code
,description
,label
,daty_id)
values 
(nextval('PROPERTY_TYPE_ID_SEQ')
,'OFFSET'
,'Offset from the start of the sequence'
,'Offset'
,(select id from data_types where code ='VARCHAR')
);

