From 618a9d57eb0ac4641c6aab0def638974720f36dc Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Thu, 7 Aug 2014 12:47:28 +0200 Subject: [PATCH 01/31] Configurable DB user passwords --- config/DataSource.groovy.php | 4 +-- data/postgres/Makefile | 12 +++---- ddl/oracle/GLOBAL/passwords.sql.php | 18 +++++++++++ ddl/oracle/Makefile | 5 +++ ddl/postgres/GLOBAL/Makefile | 7 ++++- ddl/postgres/GLOBAL/passwords.sql.php | 31 +++++++++++++++++++ .../php/env_helper.inc.php | 3 ++ samples/oracle/gen_kettle_properties.php | 15 ++++++--- samples/postgres/gen_kettle_properties.php | 16 ++++++---- .../oracle/data-config_sanofi.xml.php | 3 +- .../postgres/data-config_rwg.xml.php | 4 +-- .../postgres/data-config_sample.xml.php | 4 +-- vars.sample | 20 ++++++++++++ 13 files changed, 117 insertions(+), 25 deletions(-) create mode 100644 ddl/oracle/GLOBAL/passwords.sql.php create mode 100644 ddl/postgres/GLOBAL/passwords.sql.php rename inc/host_fixup.php => lib/php/env_helper.inc.php (74%) diff --git a/config/DataSource.groovy.php b/config/DataSource.groovy.php index 0905bad8..77139434 100644 --- a/config/DataSource.groovy.php +++ b/config/DataSource.groovy.php @@ -1,9 +1,9 @@ - + dataSource { driverClassName = 'org.postgresql.Driver' url = 'jdbc:postgresql://:/' username = 'biomart_user' - password = 'biomart_user' + password = '' dialect = 'org.hibernate.dialect.PostgreSQLDialect' dbCreate = 'none' } diff --git a/data/postgres/Makefile b/data/postgres/Makefile index 4a454127..b438fb71 100644 --- a/data/postgres/Makefile +++ b/data/postgres/Makefile @@ -11,18 +11,18 @@ row_counts: analyze: $(PSQL_COMMAND) -c 'ANALYZE VERBOSE' -BIOMART_PSW ?= biomart -DEAPP_PSW ?= deapp -SEARCHAPP_PSW ?= searchapp +BIOMART_PWD ?= biomart +DEAPP_PWD ?= deapp +SEARCHAPP_PWD ?= searchapp $(ENV_DIR)/$(TRANSMART_LOADER)/conf/Common.properties: echo "driver_class=org.postgresql.Driver" > $@ \ && echo "url=jdbc:postgresql://localhost:$(PGPORT)/$(PGDATABASE)" >> $@ \ && echo "biomart_username=biomart" >> $@ \ - && echo "biomart_password=$(BIOMART_PSW)" >> $@ \ + && echo "biomart_password=$(BIOMART_PWD)" >> $@ \ && echo "deapp_username=deapp" >> $@ \ - && echo "deapp_password=$(DEAPP_PSW)" >> $@ \ + && echo "deapp_password=$(DEAPP_PWD)" >> $@ \ && echo "searchapp_username=searchapp" >> $@ \ - && echo "searchapp_password=$(SEARCHAPP_PSW)" >> $@ + && echo "searchapp_password=$(SEARCHAPP_PWD)" >> $@ .PHONY: row_counts analyze $(ENV_DIR)/$(TRANSMART_LOADER)/conf/Common.properties diff --git a/ddl/oracle/GLOBAL/passwords.sql.php b/ddl/oracle/GLOBAL/passwords.sql.php new file mode 100644 index 00000000..aef2424b --- /dev/null +++ b/ddl/oracle/GLOBAL/passwords.sql.php @@ -0,0 +1,18 @@ + TM_CZ_DB_NAME= TM_CZ_DB_PORT= -TM_CZ_DB_PWD=tm_cz +TM_CZ_DB_PWD= TM_CZ_DB_SERVER= TM_CZ_DB_USER=tm_cz TM_LZ_DB_NAME= TM_LZ_DB_PORT= -TM_LZ_DB_PWD=tm_lz +TM_LZ_DB_PWD= TM_LZ_DB_SERVER= TM_LZ_DB_USER=tm_lz TM_WZ_DB_NAME= TM_WZ_DB_PORT= -TM_WZ_DB_PWD=tm_wz +TM_WZ_DB_PWD= TM_WZ_DB_SERVER= TM_WZ_DB_USER=tm_wz DEAPP_DB_NAME= DEAPP_DB_PORT= DEAPP_DB_SERVER= -DEAPP_PWD=deapp +DEAPP_PWD= DEAPP_USER=deapp BIOMART_DB_NAME= BIOMART_DB_PORT= BIOMART_DB_SERVER= -BIOMART_PWD=biomart +BIOMART_PWD= BIOMART_USER=biomart diff --git a/samples/postgres/gen_kettle_properties.php b/samples/postgres/gen_kettle_properties.php index 122eaa60..38531ad9 100644 --- a/samples/postgres/gen_kettle_properties.php +++ b/samples/postgres/gen_kettle_properties.php @@ -1,26 +1,30 @@ - + TM_CZ_DB_NAME= TM_CZ_DB_PORT= -TM_CZ_DB_PWD=tm_cz +TM_CZ_DB_PWD= TM_CZ_DB_SERVER= TM_CZ_DB_USER=tm_cz TM_LZ_DB_NAME= TM_LZ_DB_PORT= -TM_LZ_DB_PWD=tm_lz +TM_LZ_DB_PWD= TM_LZ_DB_SERVER= TM_LZ_DB_USER=tm_lz TM_WZ_DB_NAME= TM_WZ_DB_PORT= -TM_WZ_DB_PWD=tm_wz +TM_WZ_DB_PWD= TM_WZ_DB_SERVER= TM_WZ_DB_USER=tm_wz DEAPP_DB_NAME= DEAPP_DB_PORT= DEAPP_DB_SERVER= -DEAPP_PWD=deapp +DEAPP_PWD= DEAPP_USER=deapp BIOMART_DB_NAME= BIOMART_DB_PORT= BIOMART_DB_SERVER= -BIOMART_PWD=biomart +BIOMART_PWD= BIOMART_USER=biomart diff --git a/solr/data-config/oracle/data-config_sanofi.xml.php b/solr/data-config/oracle/data-config_sanofi.xml.php index fdceeaf0..59feee0c 100644 --- a/solr/data-config/oracle/data-config_sanofi.xml.php +++ b/solr/data-config/oracle/data-config_sanofi.xml.php @@ -1,5 +1,6 @@ + - + diff --git a/solr/data-config/postgres/data-config_rwg.xml.php b/solr/data-config/postgres/data-config_rwg.xml.php index e6e60a9a..dd11b875 100644 --- a/solr/data-config/postgres/data-config_rwg.xml.php +++ b/solr/data-config/postgres/data-config_rwg.xml.php @@ -1,8 +1,8 @@ - + diff --git a/solr/data-config/postgres/data-config_sample.xml.php b/solr/data-config/postgres/data-config_sample.xml.php index 826e4e58..aeddfb37 100644 --- a/solr/data-config/postgres/data-config_sample.xml.php +++ b/solr/data-config/postgres/data-config_sample.xml.php @@ -1,8 +1,8 @@ - + + user="biomart_user" password="" readOnly="true" /> diff --git a/vars.sample b/vars.sample index ce20560c..425bae6b 100755 --- a/vars.sample +++ b/vars.sample @@ -58,6 +58,26 @@ KITCHEN=/path/to/data-integration/kitchen.sh #end with / TSUSER_HOME=$HOME/ +# {{{ DB user passwords +# They default to the same as the username. +# These are set when the database is created and they are used when +# connecting to the database (e.g. for ETL). +# You can reset passwords to the values specified here with: +# make -C ddl/postgres/GLOBAL load_passwords +# make -C ddl/oracle load_passwords +# Depending on whether you're using oracle or postgres. +# +#BIOMART_USER_PWD=biomart_user +#BIOMART_PWD=biomart +#DEAPP_PWD=deapp +#I2B2METADATA_PWD=i2b2metadata +#I2B2DEMODATA_PWD=i2b2demodata +#SEARCHAPP_PWD=searchapp +#TM_CZ_PWD=tm_cz +#TM_LZ_PWD=tm_lz +#TM_WZ_PWD=tm_wz +# }}} + # If your distro uses an old version of groovy, do make -C env groovy, # and uncomment this. Version 2.1.9 is known to work, versions before 2 # are known not to work From 2a1afe3503b7ebf4dd7e3a29ec216a424e921b64 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Thu, 7 Aug 2014 12:57:22 +0200 Subject: [PATCH 02/31] Rename vars-ubuntu to standard vars --- README.md | 4 ++-- env/Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 01b57ac1..887a2123 100644 --- a/README.md +++ b/README.md @@ -65,10 +65,10 @@ Start with copying the `vars.sample` file, editing it and sourcing it in: # edit file and save... . ./vars -If you ran `make -C env ubuntu_deps_regular`, you will have a `vars-ubuntu` file +If you ran `make -C env ubuntu_deps_regular`, you will have a `vars` file created for you. You can skip the previous step and do only: - . ./vars-ubuntu + . ./vars The several options are fairly self-explanatory. diff --git a/env/Makefile b/env/Makefile index c5952ef1..03957b7a 100644 --- a/env/Makefile +++ b/env/Makefile @@ -92,7 +92,7 @@ data-integration: $(KETTLE_ARCHIVE) /bin/bash -c 'mkdir -p $@/{biomart,deapp,indx,search_app,transmart}' chown -R postgres:postgres $@ -../vars-ubuntu: vars-ubuntu.php +../vars: vars-ubuntu.php php -d variables_order=E $< > $@ ubuntu_deps_root: install_ubuntu_packages /var/lib/postgresql/tablespaces From 650a90f44b30a84a6271196ed2296c16c2b79e1b Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Thu, 7 Aug 2014 15:53:00 +0200 Subject: [PATCH 03/31] Add dependencies on vars file when a generated file depends on the values of environment variables. --- .gitignore | 2 +- config/Makefile | 2 +- data/oracle/Common.properties.php | 9 +++++++++ data/oracle/Makefile | 16 ++-------------- data/postgres/Common.properties.php | 9 +++++++++ data/postgres/Makefile | 16 +++------------- lib/php/env_helper.inc.php | 4 ++++ samples/common/makefile.inc | 8 ++++---- solr/Makefile | 2 +- 9 files changed, 34 insertions(+), 34 deletions(-) create mode 100644 data/oracle/Common.properties.php create mode 100644 data/postgres/Common.properties.php diff --git a/.gitignore b/.gitignore index cad24eb9..b8f0c608 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,5 @@ *.iml /.idea /vars -/vars-ubuntu +/vars-* /private-feeds diff --git a/config/Makefile b/config/Makefile index 64c8904e..86e4ad3a 100644 --- a/config/Makefile +++ b/config/Makefile @@ -14,7 +14,7 @@ Config-extra.php BuildConfig.groovy: Config.groovy: Config-template.groovy Config-extra.php build-config.php php build-config.php > $@ -DataSource.groovy: DataSource.groovy.php +DataSource.groovy: DataSource.groovy.php ../vars php -d 'variables_order=E' $< > $@ TSCONFIG = $(TSUSER_HOME).grails/transmartConfig/ diff --git a/data/oracle/Common.properties.php b/data/oracle/Common.properties.php new file mode 100644 index 00000000..a2c1daa5 --- /dev/null +++ b/data/oracle/Common.properties.php @@ -0,0 +1,9 @@ + +driver_class=oracle.jdbc.driver.OracleDriver +url=jdbc:oracle:thin:@::" +biomart_username=biomart +biomart_password= +deapp_username=deapp +deapp_password= +searchapp_username=searchapp +searchapp_password= diff --git a/data/oracle/Makefile b/data/oracle/Makefile index 19218d29..8d02466d 100644 --- a/data/oracle/Makefile +++ b/data/oracle/Makefile @@ -1,20 +1,8 @@ include ../common/makefile.inc include ../../lib/makefile.inc -BIOMART_PSW ?= biomart -DEAPP_PSW ?= deapp -SEARCHAPP_PSW ?= searchapp -$(ENV_DIR)/$(TRANSMART_LOADER)/conf/Common.properties: - echo "driver_class=oracle.jdbc.driver.OracleDriver" > $@ \ - && echo "url=jdbc:oracle:thin:@$(ORAHOST):$(ORAPORT):$(ORASID)" >> $@ \ - && echo "biomart_username=biomart" >> $@ \ - && echo "biomart_password=$(BIOMART_PSW)" >> $@ \ - && echo "deapp_username=deapp" >> $@ \ - && echo "deapp_password=$(DEAPP_PSW)" >> $@ \ - && echo "searchapp_username=searchapp" >> $@ \ - && echo "searchapp_password=$(SEARCHAPP_PSW)" >> $@ - -.PHONY: $(ENV_DIR)/$(TRANSMART_LOADER)/conf/Common.properties +$(ENV_DIR)/$(TRANSMART_LOADER)/conf/Common.properties: Common.properties.php ../../vars + php -d variables_order=E $< > $@ start_pool: $(NETTY_JAR_PATH) $(JDBC_DRIVER_ORA_PATH) NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss' \ diff --git a/data/postgres/Common.properties.php b/data/postgres/Common.properties.php new file mode 100644 index 00000000..c5ca06ae --- /dev/null +++ b/data/postgres/Common.properties.php @@ -0,0 +1,9 @@ + +driver_class=org.postgresql.Driver +url=jdbc:postgresql://:/ +biomart_username=biomart +biomart_password= +deapp_username=deapp +deapp_password= +searchapp_username=searchapp +searchapp_password= diff --git a/data/postgres/Makefile b/data/postgres/Makefile index b438fb71..d599ec07 100644 --- a/data/postgres/Makefile +++ b/data/postgres/Makefile @@ -11,19 +11,9 @@ row_counts: analyze: $(PSQL_COMMAND) -c 'ANALYZE VERBOSE' -BIOMART_PWD ?= biomart -DEAPP_PWD ?= deapp -SEARCHAPP_PWD ?= searchapp -$(ENV_DIR)/$(TRANSMART_LOADER)/conf/Common.properties: - echo "driver_class=org.postgresql.Driver" > $@ \ - && echo "url=jdbc:postgresql://localhost:$(PGPORT)/$(PGDATABASE)" >> $@ \ - && echo "biomart_username=biomart" >> $@ \ - && echo "biomart_password=$(BIOMART_PWD)" >> $@ \ - && echo "deapp_username=deapp" >> $@ \ - && echo "deapp_password=$(DEAPP_PWD)" >> $@ \ - && echo "searchapp_username=searchapp" >> $@ \ - && echo "searchapp_password=$(SEARCHAPP_PWD)" >> $@ +$(ENV_DIR)/$(TRANSMART_LOADER)/conf/Common.properties: Common.properties.php ../../vars + php -d variables_order=E $< > $@ -.PHONY: row_counts analyze $(ENV_DIR)/$(TRANSMART_LOADER)/conf/Common.properties +.PHONY: row_counts analyze # vim: set filetype=make: diff --git a/lib/php/env_helper.inc.php b/lib/php/env_helper.inc.php index b3d513c4..3c4722bb 100644 --- a/lib/php/env_helper.inc.php +++ b/lib/php/env_helper.inc.php @@ -8,3 +8,7 @@ $biomart_user_pwd = isset($_ENV['BIOMART_USER_PWD']) ? $_ENV['BIOMART_USER_PWD'] : 'biomart_user'; + +function get_env($key, $default) { + return isset($_ENV[$key]) ? $_ENV[$key] : $default; +} diff --git a/samples/common/makefile.inc b/samples/common/makefile.inc index 7f487297..e25d3546 100644 --- a/samples/common/makefile.inc +++ b/samples/common/makefile.inc @@ -39,13 +39,13 @@ LOAD_MIRNA_PARAMS_TARGETS := $(shell php ../studies/enumerate.php load_targets m KETTLE_TARGETS := $(LOAD_CLINICAL_TARGETS) $(LOAD_EXPRESSION_PARAMS_TARGETS) $(LOAD_ANALYSIS_PARAMS_TARGETS) $(LOAD_ACGH_PARAMS_TARGETS) $(LOAD_PROTEOMICS_PARAMS_TARGETS) $(LOAD_MIRNA_PARAMS_TARGETS) -$(KETTLE_TARGETS): write_kettle_properties +$(KETTLE_TARGETS): kettle-home/kettle.properties #these ones are here just for autocompletion: $(LOAD_ANNOTATION_TARGETS): $(LOAD_REF_ANNOTATION_TARGETS): -write_kettle_properties: gen_kettle_properties.php - php -d variables_order=E $< > kettle-home/kettle.properties +kettle-home/kettle.properties: gen_kettle_properties.php ../../vars + php -d variables_order=E $< > $@ ../studies/%: $(MAKE) -C ../studies $* @@ -152,6 +152,6 @@ load_mirna_%: ../studies/%/mirna.params ../studies/%/mirna load_mirna_annotation clean: rm -f logs/*.log kettle-home/kettle.properties -.PHONY: write_kettle_properties clean +.PHONY: clean # vim: ft=make : diff --git a/solr/Makefile b/solr/Makefile index 89fce8d6..21907ca4 100644 --- a/solr/Makefile +++ b/solr/Makefile @@ -64,7 +64,7 @@ solr/%/conf/schema.xml: solr/% schemas/schema_%.xml test -d solr/$* || $(MAKE) solr/$* #solr/$* is touched on each solr run cp schemas/schema_$*.xml $@ -solr/%/conf/data-config.xml: data-config/$(DBSUBDIR)/data-config_%.xml.php +solr/%/conf/data-config.xml: data-config/$(DBSUBDIR)/data-config_%.xml.php ../../vars test -d solr/$* || $(MAKE) solr/$* #solr/$* is touched on each solr run php -d variables_order=E $< > $@ From 4ff7ae52039f5603252de070490e0d327f2be80a Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Thu, 7 Aug 2014 17:25:39 +0200 Subject: [PATCH 04/31] vars.sample: add export to passwords --- vars.sample | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vars.sample b/vars.sample index 425bae6b..74a58898 100755 --- a/vars.sample +++ b/vars.sample @@ -67,15 +67,15 @@ TSUSER_HOME=$HOME/ # make -C ddl/oracle load_passwords # Depending on whether you're using oracle or postgres. # -#BIOMART_USER_PWD=biomart_user -#BIOMART_PWD=biomart -#DEAPP_PWD=deapp -#I2B2METADATA_PWD=i2b2metadata -#I2B2DEMODATA_PWD=i2b2demodata -#SEARCHAPP_PWD=searchapp -#TM_CZ_PWD=tm_cz -#TM_LZ_PWD=tm_lz -#TM_WZ_PWD=tm_wz +#export BIOMART_USER_PWD=biomart_user +#export BIOMART_PWD=biomart +#export DEAPP_PWD=deapp +#export I2B2METADATA_PWD=i2b2metadata +#export I2B2DEMODATA_PWD=i2b2demodata +#export SEARCHAPP_PWD=searchapp +#export TM_CZ_PWD=tm_cz +#export TM_LZ_PWD=tm_lz +#export TM_WZ_PWD=tm_wz # }}} # If your distro uses an old version of groovy, do make -C env groovy, From ea5537f05c0296c99633ee0f7a90a1b1629c849b Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 8 Aug 2014 15:18:12 +0200 Subject: [PATCH 05/31] Fix wrong R rpath when LIBnn=lib64 Done this by forcing LIBnn=lib --- R/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/R/Makefile b/R/Makefile index 72c0dec3..b0efd999 100644 --- a/R/Makefile +++ b/R/Makefile @@ -15,6 +15,7 @@ build/Makefile: $(R_SOURCE) CFLAGS="$(R_FLAGS)" \ CXXFLAGS="$(R_FLAGS)" \ FFLAGS="$(R_FLAGS)" \ + LIBnn=lib \ LDFLAGS="-Wl,-rpath=$(R_PREFIX)/lib/R/lib,--enable-new-dtags" \ ../$(R_SOURCE)/configure --prefix=$(R_PREFIX) \ --enable-R-shlib --with-readline \ From ddd7410821a70954ed79a47d988169222bb72519 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 8 Aug 2014 16:08:22 +0200 Subject: [PATCH 06/31] Support diff biomart_user password in solr/rwg --- solr/data-config/oracle/data-config_rwg.xml.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/solr/data-config/oracle/data-config_rwg.xml.php b/solr/data-config/oracle/data-config_rwg.xml.php index becf4256..fa84a875 100644 --- a/solr/data-config/oracle/data-config_rwg.xml.php +++ b/solr/data-config/oracle/data-config_rwg.xml.php @@ -1,5 +1,9 @@ + - + ::" user="biomart_user" password="" /> - - - - - - - - - - - - - - +"> + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + From 8da1b88d2f87134c2298bfc6667083db808d2fe8 Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Mon, 11 Aug 2014 12:24:18 +0100 Subject: [PATCH 08/31] Missing newline for all passwords --- samples/oracle/gen_kettle_properties.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/oracle/gen_kettle_properties.php b/samples/oracle/gen_kettle_properties.php index 4a44288d..e006a381 100644 --- a/samples/oracle/gen_kettle_properties.php +++ b/samples/oracle/gen_kettle_properties.php @@ -5,26 +5,26 @@ function get($key, $default) { ?> TM_CZ_DB_NAME= TM_CZ_DB_PORT= -TM_CZ_DB_PWD= +TM_CZ_DB_PWD= TM_CZ_DB_SERVER= TM_CZ_DB_USER=tm_cz TM_LZ_DB_NAME= TM_LZ_DB_PORT= -TM_LZ_DB_PWD= +TM_LZ_DB_PWD= TM_LZ_DB_SERVER= TM_LZ_DB_USER=tm_lz TM_WZ_DB_NAME= TM_WZ_DB_PORT= -TM_WZ_DB_PWD= +TM_WZ_DB_PWD= TM_WZ_DB_SERVER= TM_WZ_DB_USER=tm_wz DEAPP_DB_NAME= DEAPP_DB_PORT= DEAPP_DB_SERVER= -DEAPP_PWD= +DEAPP_PWD= DEAPP_USER=deapp BIOMART_DB_NAME= BIOMART_DB_PORT= BIOMART_DB_SERVER= -BIOMART_PWD= +BIOMART_PWD= BIOMART_USER=biomart From eabdd6297c01588006e55ee7db6f3b889b79b01d Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Mon, 11 Aug 2014 12:24:18 +0100 Subject: [PATCH 09/31] Missing newline for all passwords (cherry-pick) Cherry-pick from london_hackathon branch. --- samples/oracle/gen_kettle_properties.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/oracle/gen_kettle_properties.php b/samples/oracle/gen_kettle_properties.php index 4a44288d..e006a381 100644 --- a/samples/oracle/gen_kettle_properties.php +++ b/samples/oracle/gen_kettle_properties.php @@ -5,26 +5,26 @@ function get($key, $default) { ?> TM_CZ_DB_NAME= TM_CZ_DB_PORT= -TM_CZ_DB_PWD= +TM_CZ_DB_PWD= TM_CZ_DB_SERVER= TM_CZ_DB_USER=tm_cz TM_LZ_DB_NAME= TM_LZ_DB_PORT= -TM_LZ_DB_PWD= +TM_LZ_DB_PWD= TM_LZ_DB_SERVER= TM_LZ_DB_USER=tm_lz TM_WZ_DB_NAME= TM_WZ_DB_PORT= -TM_WZ_DB_PWD= +TM_WZ_DB_PWD= TM_WZ_DB_SERVER= TM_WZ_DB_USER=tm_wz DEAPP_DB_NAME= DEAPP_DB_PORT= DEAPP_DB_SERVER= -DEAPP_PWD= +DEAPP_PWD= DEAPP_USER=deapp BIOMART_DB_NAME= BIOMART_DB_PORT= BIOMART_DB_SERVER= -BIOMART_PWD= +BIOMART_PWD= BIOMART_USER=biomart From b92b45eff4d2091b410c0c31e8a4dcf195e84b1d Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Mon, 11 Aug 2014 15:46:59 +0200 Subject: [PATCH 10/31] Fix missing LF chars in pg/gen_kettle_properties --- samples/postgres/gen_kettle_properties.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/postgres/gen_kettle_properties.php b/samples/postgres/gen_kettle_properties.php index 38531ad9..c6dc8d45 100644 --- a/samples/postgres/gen_kettle_properties.php +++ b/samples/postgres/gen_kettle_properties.php @@ -5,26 +5,26 @@ function get($key, $default) { ?> TM_CZ_DB_NAME= TM_CZ_DB_PORT= -TM_CZ_DB_PWD= +TM_CZ_DB_PWD= TM_CZ_DB_SERVER= TM_CZ_DB_USER=tm_cz TM_LZ_DB_NAME= TM_LZ_DB_PORT= -TM_LZ_DB_PWD= +TM_LZ_DB_PWD= TM_LZ_DB_SERVER= TM_LZ_DB_USER=tm_lz TM_WZ_DB_NAME= TM_WZ_DB_PORT= -TM_WZ_DB_PWD= +TM_WZ_DB_PWD= TM_WZ_DB_SERVER= TM_WZ_DB_USER=tm_wz DEAPP_DB_NAME= DEAPP_DB_PORT= DEAPP_DB_SERVER= -DEAPP_PWD= +DEAPP_PWD= DEAPP_USER=deapp BIOMART_DB_NAME= BIOMART_DB_PORT= BIOMART_DB_SERVER= -BIOMART_PWD= +BIOMART_PWD= BIOMART_USER=biomart From 870f1bf0f6f5d2cd8587ec919a25cec8bd7fa2da Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Mon, 11 Aug 2014 16:39:19 +0200 Subject: [PATCH 11/31] Fix ubuntu_deps_regular target --- env/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/env/Makefile b/env/Makefile index 03957b7a..d94393cc 100644 --- a/env/Makefile +++ b/env/Makefile @@ -96,7 +96,7 @@ data-integration: $(KETTLE_ARCHIVE) php -d variables_order=E $< > $@ ubuntu_deps_root: install_ubuntu_packages /var/lib/postgresql/tablespaces -ubuntu_deps_regular: update_etl data-integration ../vars-ubuntu groovy +ubuntu_deps_regular: update_etl data-integration ../vars groovy .DELETE_ON_ERROR: From 9ee4999769d7bd2c59f863903c671ea8959e09f8 Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Mon, 11 Aug 2014 17:08:18 +0100 Subject: [PATCH 12/31] use varchar2 to avoid size limit --- ddl/oracle/biomart/bio_experiment.sql | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ddl/oracle/biomart/bio_experiment.sql b/ddl/oracle/biomart/bio_experiment.sql index d1bdccd1..68a5808d 100644 --- a/ddl/oracle/biomart/bio_experiment.sql +++ b/ddl/oracle/biomart/bio_experiment.sql @@ -3,18 +3,18 @@ -- CREATE TABLE "BIOMART"."BIO_EXPERIMENT" ( "BIO_EXPERIMENT_ID" NUMBER(18,0) NOT NULL ENABLE, -"BIO_EXPERIMENT_TYPE" NVARCHAR2(200), -"TITLE" NVARCHAR2(1000), -"DESCRIPTION" NVARCHAR2(4000), -"DESIGN" NVARCHAR2(2000), +"BIO_EXPERIMENT_TYPE" VARCHAR2(200), +"TITLE" VARCHAR2(1000), +"DESCRIPTION" VARCHAR2(4000), +"DESIGN" VARCHAR2(2000), "START_DATE" DATE, "COMPLETION_DATE" DATE, -"PRIMARY_INVESTIGATOR" NVARCHAR2(400), -"CONTACT_FIELD" NVARCHAR2(400), -"ETL_ID" NVARCHAR2(100), +"PRIMARY_INVESTIGATOR" VARCHAR2(400), +"CONTACT_FIELD" VARCHAR2(400), +"ETL_ID" VARCHAR2(100), "STATUS" VARCHAR2(100 BYTE), -"OVERALL_DESIGN" NVARCHAR2(2000), -"ACCESSION" NVARCHAR2(100), +"OVERALL_DESIGN" VARCHAR2(2000), +"ACCESSION" VARCHAR2(100), "ENTRYDT" DATE, "UPDATED" DATE, "INSTITUTION" VARCHAR2(400 BYTE), From 3311c9b5a2e302af6aa21044ae853d35fb2d581b Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Mon, 11 Aug 2014 17:09:09 +0100 Subject: [PATCH 13/31] biomart missing table --- ddl/oracle/biomart/items.json | 7 +++++++ ddl/oracle/biomart/mesh_all.sql | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ddl/oracle/biomart/items.json b/ddl/oracle/biomart/items.json index 25b8e5e2..ca5f8a92 100644 --- a/ddl/oracle/biomart/items.json +++ b/ddl/oracle/biomart/items.json @@ -5242,6 +5242,13 @@ "name" : "MESH" }, "file" : "biomart/mesh.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "MESH_ALL" + }, + "file" : "biomart/mesh_all.sql" }, { "item" : { "type" : "TABLE", diff --git a/ddl/oracle/biomart/mesh_all.sql b/ddl/oracle/biomart/mesh_all.sql index fac7a800..631a9daa 100644 --- a/ddl/oracle/biomart/mesh_all.sql +++ b/ddl/oracle/biomart/mesh_all.sql @@ -6,7 +6,7 @@ "MH" VARCHAR2(200 BYTE), PRIMARY KEY ("UI") USING INDEX - TABLESPACE "BIOMART" ENABLE + TABLESPACE "TRANSMART" ENABLE ) SEGMENT CREATION IMMEDIATE NOCOMPRESS NOLOGGING - TABLESPACE "BIOMART" ; + TABLESPACE "TRANSMART" ; From fb909983f4db0ea3cd7ea743078052a60cd7daff Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Mon, 11 Aug 2014 17:09:30 +0100 Subject: [PATCH 14/31] biomart_user missing tables --- ddl/oracle/biomart_user/gene_ontology.sql | 2 +- .../biomart_user/gene_ontology_data.sql | 6 +- ddl/oracle/biomart_user/items.json | 71 +++++++++++++++++++ 3 files changed, 75 insertions(+), 4 deletions(-) diff --git a/ddl/oracle/biomart_user/gene_ontology.sql b/ddl/oracle/biomart_user/gene_ontology.sql index 4b112b54..272e8b5e 100644 --- a/ddl/oracle/biomart_user/gene_ontology.sql +++ b/ddl/oracle/biomart_user/gene_ontology.sql @@ -6,4 +6,4 @@ "DESCR" VARCHAR2(500 BYTE) ) SEGMENT CREATION IMMEDIATE NOCOMPRESS LOGGING - TABLESPACE "BIOMART" ; + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/biomart_user/gene_ontology_data.sql b/ddl/oracle/biomart_user/gene_ontology_data.sql index de18416e..f9d944bf 100644 --- a/ddl/oracle/biomart_user/gene_ontology_data.sql +++ b/ddl/oracle/biomart_user/gene_ontology_data.sql @@ -8,14 +8,14 @@ "ORGANISM" VARCHAR2(100 BYTE) ) SEGMENT CREATION IMMEDIATE NOCOMPRESS LOGGING - TABLESPACE "BIOMART" ; + TABLESPACE "TRANSMART" ; -- -- Type: INDEX; Owner: BIOMART_USER; Name: IDX_GOD_SYMBOL -- CREATE INDEX "BIOMART_USER"."IDX_GOD_SYMBOL" ON "BIOMART_USER"."GENE_ONTOLOGY_DATA" (UPPER("GENE_SYMBOL")) -TABLESPACE "BIOMART" ; +TABLESPACE "TRANSMART" ; -- -- Type: INDEX; Owner: BIOMART_USER; Name: IDX_GOD_ORGANISM -- CREATE BITMAP INDEX "BIOMART_USER"."IDX_GOD_ORGANISM" ON "BIOMART_USER"."GENE_ONTOLOGY_DATA" (UPPER("ORGANISM")) -TABLESPACE "BIOMART" ; +TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/biomart_user/items.json b/ddl/oracle/biomart_user/items.json index 431d409f..3e60e502 100644 --- a/ddl/oracle/biomart_user/items.json +++ b/ddl/oracle/biomart_user/items.json @@ -2944,6 +2944,28 @@ "owner" : "I2B2METADATA", "name" : "I2B2_TRIAL_NODES" } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "BIOMART_USER", + "name" : "IDX_GOD_ORGANISM" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART_USER", + "name" : "GENE_ONTOLOGY_DATA" + } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "BIOMART_USER", + "name" : "IDX_GOD_SYMBOL" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART_USER", + "name" : "GENE_ONTOLOGY_DATA" + } ] }, { "child" : { "type" : "SYNONYM", @@ -4603,6 +4625,27 @@ } ] } ], "fileAssignments" : [ { + "item" : { + "type" : "TABLE", + "owner" : "BIOMART_USER", + "name" : "GENE_ONTOLOGY" + }, + "file" : "biomart_user/gene_ontology.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "BIOMART_USER", + "name" : "GENE_ONTOLOGY" + }, + "file" : "biomart_user/gene_ontology.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "BIOMART_USER", + "name" : "GENE_ONTOLOGY_DATA" + }, + "file" : "biomart_user/gene_ontology_data.sql" + }, { "item" : { "type" : "VIEW", "owner" : "BIOMART_USER", @@ -4644,6 +4687,34 @@ "name" : "CONCEPT_CD_TAB" }, "file" : "biomart_user/_misc.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "BIOMART_USER", + "name" : "GENE_ONTOLOGY" + }, + "file" : "biomart_user/gene_ontology.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "BIOMART_USER", + "name" : "GENE_ONTOLOGY_DATA" + }, + "file" : "biomart_user/gene_ontology_data.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "BIOMART_USER", + "name" : "IDX_GOD_ORGANISM" + }, + "file" : "biomart_user/gene_ontology_data.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "BIOMART_USER", + "name" : "IDX_GOD_SYMBOL" + }, + "file" : "biomart_user/gene_ontology_data.sql" }, { "item" : { "type" : "TYPE", From 5ebc7b01ed8530e204a136ecc62b81161fa228af Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Mon, 11 Aug 2014 17:10:18 +0100 Subject: [PATCH 15/31] merge test server update --- ddl/oracle/deapp/de_variant_population_data.sql | 7 +------ ddl/oracle/deapp/de_variant_population_info.sql | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/ddl/oracle/deapp/de_variant_population_data.sql b/ddl/oracle/deapp/de_variant_population_data.sql index 78023cf8..be3676e0 100644 --- a/ddl/oracle/deapp/de_variant_population_data.sql +++ b/ddl/oracle/deapp/de_variant_population_data.sql @@ -42,9 +42,4 @@ for each row begin end; / ALTER TRIGGER "DEAPP"."TRG_DE_VARIANT_PD_ID" ENABLE; - --- --- Type: REF_CONSTRAINT; Owner: DEAPP; Name: DE_VARIANT_POPULATION_DATA_FK --- -ALTER TABLE "DEAPP"."DE_VARIANT_POPULATION_DATA" ADD CONSTRAINT "DE_VARIANT_POPULATION_DATA_FK" FOREIGN KEY ("DATASET_ID") - REFERENCES "DEAPP"."DE_VARIANT_DATASET" ("DATASET_ID") ENABLE; + diff --git a/ddl/oracle/deapp/de_variant_population_info.sql b/ddl/oracle/deapp/de_variant_population_info.sql index 0e953db4..8284530a 100644 --- a/ddl/oracle/deapp/de_variant_population_info.sql +++ b/ddl/oracle/deapp/de_variant_population_info.sql @@ -43,9 +43,4 @@ end; / ALTER TRIGGER "DEAPP"."TRG_DE_VP_INFO_ID" ENABLE; - --- --- Type: REF_CONSTRAINT; Owner: DEAPP; Name: DE_VARIANT_POPULATION_INFO_FK --- -ALTER TABLE "DEAPP"."DE_VARIANT_POPULATION_INFO" ADD CONSTRAINT "DE_VARIANT_POPULATION_INFO_FK" FOREIGN KEY ("DATASET_ID") - REFERENCES "DEAPP"."DE_VARIANT_DATASET" ("DATASET_ID") ENABLE; + From 39412a9dbf9c6efbc75b293f1ea2d2c59ff94637 Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Mon, 11 Aug 2014 17:10:39 +0100 Subject: [PATCH 16/31] deapp missing table --- ddl/oracle/deapp/items.json | 7 +++++++ ddl/oracle/deapp/kegg_data.sql | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ddl/oracle/deapp/items.json b/ddl/oracle/deapp/items.json index c1544883..990dd6aa 100644 --- a/ddl/oracle/deapp/items.json +++ b/ddl/oracle/deapp/items.json @@ -2744,6 +2744,13 @@ "name" : "KEGG" }, "file" : "deapp/kegg.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "KEGG_DATA" + }, + "file" : "deapp/kegg_data.sql" }, { "item" : { "type" : "TABLE", diff --git a/ddl/oracle/deapp/kegg_data.sql b/ddl/oracle/deapp/kegg_data.sql index d24d9207..f48dca7e 100644 --- a/ddl/oracle/deapp/kegg_data.sql +++ b/ddl/oracle/deapp/kegg_data.sql @@ -7,4 +7,4 @@ "GENE" VARCHAR2(200 BYTE) ) SEGMENT CREATION IMMEDIATE NOCOMPRESS LOGGING - TABLESPACE "DEAPP" ; + TABLESPACE "TRANSMART" ; From 1f6b311781219c613e9a0598fd955d60497179fc Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Mon, 11 Aug 2014 17:11:12 +0100 Subject: [PATCH 17/31] use transmart tablespace --- ddl/oracle/searchapp/report.sql | 2 +- ddl/oracle/searchapp/report_item.sql | 2 +- ddl/oracle/searchapp/subset.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ddl/oracle/searchapp/report.sql b/ddl/oracle/searchapp/report.sql index 00c5490b..7f340d0b 100644 --- a/ddl/oracle/searchapp/report.sql +++ b/ddl/oracle/searchapp/report.sql @@ -10,5 +10,5 @@ "CREATE_DATE" TIMESTAMP (6), "STUDY" VARCHAR2(200 BYTE) ) SEGMENT CREATION DEFERRED - TABLESPACE "SEARCH_APP" ; + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/searchapp/report_item.sql b/ddl/oracle/searchapp/report_item.sql index 2d35db2e..aa7366cf 100644 --- a/ddl/oracle/searchapp/report_item.sql +++ b/ddl/oracle/searchapp/report_item.sql @@ -6,5 +6,5 @@ "REPORT_ID" NUMBER(18,0), "CODE" VARCHAR2(200 BYTE) ) SEGMENT CREATION DEFERRED - TABLESPACE "SEARCH_APP" ; + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/searchapp/subset.sql b/ddl/oracle/searchapp/subset.sql index 4c41753b..90583e82 100644 --- a/ddl/oracle/searchapp/subset.sql +++ b/ddl/oracle/searchapp/subset.sql @@ -12,5 +12,5 @@ "QUERY_MASTER_ID_2" NUMBER, "STUDY" VARCHAR2(200 BYTE) ) SEGMENT CREATION IMMEDIATE - TABLESPACE "SEARCH_APP" ; + TABLESPACE "TRANSMART" ; From 07d5c57f55e74e423df3b4e6c4b10e378d4f7472 Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Tue, 12 Aug 2014 10:42:34 +0100 Subject: [PATCH 18/31] tm_wz updates from test server --- ddl/oracle/tm_wz/de_subject_rbm_data.sql | 27 ++++ ddl/oracle/tm_wz/i2b2_load_path.sql | 10 ++ .../tm_wz/i2b2_load_path_with_count.sql | 10 ++ ddl/oracle/tm_wz/items.json | 152 ++++++++++++++++++ ddl/oracle/tm_wz/tmp_subject_rbm_calcs.sql | 13 ++ ddl/oracle/tm_wz/tmp_subject_rbm_logs.sql | 19 +++ ddl/oracle/tm_wz/tmp_subject_rbm_med.sql | 23 +++ ddl/oracle/tm_wz/wrk_clinical_data.sql | 9 +- ddl/oracle/tm_wz/wt_subject_acgh_region.sql | 2 +- ddl/oracle/tm_wz/wt_subject_rnaseq_region.sql | 2 +- ddl/oracle/tm_wz/wt_trial_nodes.sql | 12 ++ 11 files changed, 276 insertions(+), 3 deletions(-) create mode 100644 ddl/oracle/tm_wz/de_subject_rbm_data.sql create mode 100644 ddl/oracle/tm_wz/i2b2_load_path.sql create mode 100644 ddl/oracle/tm_wz/i2b2_load_path_with_count.sql create mode 100644 ddl/oracle/tm_wz/tmp_subject_rbm_calcs.sql create mode 100644 ddl/oracle/tm_wz/tmp_subject_rbm_logs.sql create mode 100644 ddl/oracle/tm_wz/tmp_subject_rbm_med.sql diff --git a/ddl/oracle/tm_wz/de_subject_rbm_data.sql b/ddl/oracle/tm_wz/de_subject_rbm_data.sql new file mode 100644 index 00000000..46a07c1d --- /dev/null +++ b/ddl/oracle/tm_wz/de_subject_rbm_data.sql @@ -0,0 +1,27 @@ +-- +-- Type: TABLE; Owner: TM_WZ; Name: DE_SUBJECT_RBM_DATA +-- + CREATE TABLE "TM_WZ"."DE_SUBJECT_RBM_DATA" + ( "TRIAL_NAME" VARCHAR2(100 BYTE), +"ANTIGEN_NAME" VARCHAR2(100 BYTE), +"N_VALUE" NUMBER, +"PATIENT_ID" NUMBER(38,0), +"GENE_SYMBOL" VARCHAR2(100 BYTE), +"GENE_ID" NUMBER(10,0), +"ASSAY_ID" NUMBER, +"NORMALIZED_VALUE" NUMBER(18,5), +"CONCEPT_CD" NVARCHAR2(100), +"TIMEPOINT" VARCHAR2(100 BYTE), +"DATA_UID" VARCHAR2(100 BYTE), +"VALUE" NUMBER(18,4), +"LOG_INTENSITY" NUMBER, +"MEAN_INTENSITY" NUMBER, +"STDDEV_INTENSITY" NUMBER, +"MEDIAN_INTENSITY" NUMBER, +"ZSCORE" NUMBER(18,4), +"RBM_PANEL" VARCHAR2(50 BYTE), +"UNIT" VARCHAR2(50 CHAR), +"ID" NUMBER(38,0) NOT NULL ENABLE + ) SEGMENT CREATION IMMEDIATE +NOCOMPRESS LOGGING + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_wz/i2b2_load_path.sql b/ddl/oracle/tm_wz/i2b2_load_path.sql new file mode 100644 index 00000000..002a8fc9 --- /dev/null +++ b/ddl/oracle/tm_wz/i2b2_load_path.sql @@ -0,0 +1,10 @@ +-- +-- Type: TABLE; Owner: TM_WZ; Name: I2B2_LOAD_PATH +-- + CREATE TABLE "TM_WZ"."I2B2_LOAD_PATH" + ( "PATH" VARCHAR2(700 BYTE), +"RECORD_ID" ROWID, + PRIMARY KEY ("PATH", "RECORD_ID") ENABLE + ) ORGANIZATION INDEX NOCOMPRESS + TABLESPACE "TRANSMART" +PCTTHRESHOLD 50; diff --git a/ddl/oracle/tm_wz/i2b2_load_path_with_count.sql b/ddl/oracle/tm_wz/i2b2_load_path_with_count.sql new file mode 100644 index 00000000..dacf37f8 --- /dev/null +++ b/ddl/oracle/tm_wz/i2b2_load_path_with_count.sql @@ -0,0 +1,10 @@ +-- +-- Type: TABLE; Owner: TM_WZ; Name: I2B2_LOAD_PATH_WITH_COUNT +-- + CREATE TABLE "TM_WZ"."I2B2_LOAD_PATH_WITH_COUNT" + ( "C_FULLNAME" VARCHAR2(700 BYTE), +"NBR_CHILDREN" NUMBER, + PRIMARY KEY ("C_FULLNAME") ENABLE + ) ORGANIZATION INDEX NOCOMPRESS + TABLESPACE "TRANSMART" +PCTTHRESHOLD 50; diff --git a/ddl/oracle/tm_wz/items.json b/ddl/oracle/tm_wz/items.json index 1367cbb8..ec3cba0f 100644 --- a/ddl/oracle/tm_wz/items.json +++ b/ddl/oracle/tm_wz/items.json @@ -6,6 +6,60 @@ "name" : "BIO_ASSAY_ANALYSIS_DATA_NEW" }, "parents" : [ ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "DE_SUBJECT_RBM_DATA" + }, + "parents" : [ ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "I2B2_LOAD_PATH" + }, + "parents" : [ ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "I2B2_LOAD_PATH_WITH_COUNT" + }, + "parents" : [ ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "TM_WZ", + "name" : "IDX_WRK_CD" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "WRK_CLINICAL_DATA" + } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "TM_WZ", + "name" : "IDX_WTN_LOAD_CLINICAL" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "WT_TRIAL_NODES" + } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "TM_WZ", + "name" : "IDX_WT_TRIALNODES" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "WT_TRIAL_NODES" + } ] }, { "child" : { "type" : "TABLE", @@ -13,6 +67,34 @@ "name" : "TMP_ASSAY_ANALYSIS_METRICS" }, "parents" : [ ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "TMP_SUBJECT_RBM_CALCS" + }, + "parents" : [ ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "TMP_SUBJECT_RBM_LOGS" + }, + "parents" : [ ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "TMP_SUBJECT_RBM_MED" + }, + "parents" : [ ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_WZ", + "name" : "UTIL_GRANT_ALL" + }, + "parents" : [ ] }, { "child" : { "type" : "TABLE", @@ -487,6 +569,48 @@ "name" : "BIO_ASSAY_ANALYSIS_DATA_NEW" }, "file" : "tm_wz/bio_assay_analysis_data_new.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "DE_SUBJECT_RBM_DATA" + }, + "file" : "tm_wz/de_subject_rbm_data.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "I2B2_LOAD_PATH" + }, + "file" : "tm_wz/i2b2_load_path.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "I2B2_LOAD_PATH_WITH_COUNT" + }, + "file" : "tm_wz/i2b2_load_path_with_count.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "TM_WZ", + "name" : "IDX_WRK_CD" + }, + "file" : "tm_wz/wrk_clinical_data.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "TM_WZ", + "name" : "IDX_WTN_LOAD_CLINICAL" + }, + "file" : "tm_wz/wt_trial_nodes.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "TM_WZ", + "name" : "IDX_WT_TRIALNODES" + }, + "file" : "tm_wz/wt_trial_nodes.sql" }, { "item" : { "type" : "TABLE", @@ -494,6 +618,34 @@ "name" : "TMP_ASSAY_ANALYSIS_METRICS" }, "file" : "tm_wz/tmp_assay_analysis_metrics.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "TMP_SUBJECT_RBM_CALCS" + }, + "file" : "tm_wz/tmp_subject_rbm_calcs.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "TMP_SUBJECT_RBM_LOGS" + }, + "file" : "tm_wz/tmp_subject_rbm_logs.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "TMP_SUBJECT_RBM_MED" + }, + "file" : "tm_wz/tmp_subject_rbm_med.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_WZ", + "name" : "UTIL_GRANT_ALL" + }, + "file" : "tm_wz/procedures/util_grant_all.sql" }, { "item" : { "type" : "TABLE", diff --git a/ddl/oracle/tm_wz/tmp_subject_rbm_calcs.sql b/ddl/oracle/tm_wz/tmp_subject_rbm_calcs.sql new file mode 100644 index 00000000..ec2bcea7 --- /dev/null +++ b/ddl/oracle/tm_wz/tmp_subject_rbm_calcs.sql @@ -0,0 +1,13 @@ +-- +-- Type: TABLE; Owner: TM_WZ; Name: TMP_SUBJECT_RBM_CALCS +-- + CREATE TABLE "TM_WZ"."TMP_SUBJECT_RBM_CALCS" + ( "TRIAL_NAME" VARCHAR2(100 BYTE), +"GENE_SYMBOL" VARCHAR2(100 BYTE), +"ANTIGEN_NAME" VARCHAR2(100 BYTE), +"MEAN_INTENSITY" NUMBER, +"MEDIAN_INTENSITY" NUMBER, +"STDDEV_INTENSITY" NUMBER + ) SEGMENT CREATION DEFERRED +NOCOMPRESS LOGGING + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_wz/tmp_subject_rbm_logs.sql b/ddl/oracle/tm_wz/tmp_subject_rbm_logs.sql new file mode 100644 index 00000000..8029528a --- /dev/null +++ b/ddl/oracle/tm_wz/tmp_subject_rbm_logs.sql @@ -0,0 +1,19 @@ +-- +-- Type: TABLE; Owner: TM_WZ; Name: TMP_SUBJECT_RBM_LOGS +-- + CREATE TABLE "TM_WZ"."TMP_SUBJECT_RBM_LOGS" + ( "TRIAL_NAME" VARCHAR2(100 BYTE), +"ANTIGEN_NAME" VARCHAR2(100 BYTE), +"N_VALUE" NUMBER, +"PATIENT_ID" NUMBER(38,0), +"GENE_SYMBOL" VARCHAR2(100 BYTE), +"GENE_ID" NUMBER(10,0), +"ASSAY_ID" NUMBER, +"NORMALIZED_VALUE" NUMBER(18,5), +"CONCEPT_CD" NVARCHAR2(100), +"TIMEPOINT" VARCHAR2(100 BYTE), +"VALUE" NUMBER(18,4), +"LOG_INTENSITY" NUMBER + ) SEGMENT CREATION DEFERRED +NOCOMPRESS LOGGING + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_wz/tmp_subject_rbm_med.sql b/ddl/oracle/tm_wz/tmp_subject_rbm_med.sql new file mode 100644 index 00000000..ce2b096d --- /dev/null +++ b/ddl/oracle/tm_wz/tmp_subject_rbm_med.sql @@ -0,0 +1,23 @@ +-- +-- Type: TABLE; Owner: TM_WZ; Name: TMP_SUBJECT_RBM_MED +-- + CREATE TABLE "TM_WZ"."TMP_SUBJECT_RBM_MED" + ( "TRIAL_NAME" VARCHAR2(100 BYTE), +"ANTIGEN_NAME" VARCHAR2(100 BYTE), +"N_VALUE" NUMBER, +"PATIENT_ID" NUMBER(38,0), +"GENE_SYMBOL" VARCHAR2(100 BYTE), +"GENE_ID" NUMBER(10,0), +"ASSAY_ID" NUMBER, +"NORMALIZED_VALUE" NUMBER(18,5), +"CONCEPT_CD" NVARCHAR2(100), +"TIMEPOINT" VARCHAR2(100 BYTE), +"LOG_INTENSITY" NUMBER, +"VALUE" NUMBER(18,4), +"MEAN_INTENSITY" NUMBER, +"STDDEV_INTENSITY" NUMBER, +"MEDIAN_INTENSITY" NUMBER, +"ZSCORE" NUMBER + ) SEGMENT CREATION DEFERRED +NOCOMPRESS LOGGING + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_wz/wrk_clinical_data.sql b/ddl/oracle/tm_wz/wrk_clinical_data.sql index 4cf871a5..d60f4d17 100644 --- a/ddl/oracle/tm_wz/wrk_clinical_data.sql +++ b/ddl/oracle/tm_wz/wrk_clinical_data.sql @@ -34,5 +34,12 @@ "DATE_TIMESTAMP" DATE, "SAMPLE_CD" VARCHAR2(200 BYTE) ) SEGMENT CREATION IMMEDIATE - TABLESPACE "TRANSMART" ; +NOCOMPRESS NOLOGGING + TABLESPACE "TRANSMART" + CACHE ; +-- +-- Type: INDEX; Owner: TM_WZ; Name: IDX_WRK_CD +-- +CREATE INDEX "TM_WZ"."IDX_WRK_CD" ON "TM_WZ"."WRK_CLINICAL_DATA" ("DATA_TYPE", "DATA_VALUE", "VISIT_NAME", "DATA_LABEL", "CATEGORY_CD", "USUBJID") +TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_wz/wt_subject_acgh_region.sql b/ddl/oracle/tm_wz/wt_subject_acgh_region.sql index 480fa620..381c5e80 100644 --- a/ddl/oracle/tm_wz/wt_subject_acgh_region.sql +++ b/ddl/oracle/tm_wz/wt_subject_acgh_region.sql @@ -22,6 +22,6 @@ "SAMPLE_TYPE" VARCHAR2(200 BYTE), "PLATFORM" VARCHAR2(200 BYTE), "TISSUE_TYPE" VARCHAR2(200 BYTE) - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_wz/wt_subject_rnaseq_region.sql b/ddl/oracle/tm_wz/wt_subject_rnaseq_region.sql index f3f93371..0a195b16 100644 --- a/ddl/oracle/tm_wz/wt_subject_rnaseq_region.sql +++ b/ddl/oracle/tm_wz/wt_subject_rnaseq_region.sql @@ -14,6 +14,6 @@ "SAMPLE_TYPE" VARCHAR2(200 BYTE), "PLATFORM" VARCHAR2(200 BYTE), "TISSUE_TYPE" VARCHAR2(200 BYTE) - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_wz/wt_trial_nodes.sql b/ddl/oracle/tm_wz/wt_trial_nodes.sql index 47ae993e..70bf17c3 100644 --- a/ddl/oracle/tm_wz/wt_trial_nodes.sql +++ b/ddl/oracle/tm_wz/wt_trial_nodes.sql @@ -20,3 +20,15 @@ ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; +-- +-- Type: INDEX; Owner: TM_WZ; Name: IDX_WT_TRIALNODES +-- +CREATE INDEX "TM_WZ"."IDX_WT_TRIALNODES" ON "TM_WZ"."WT_TRIAL_NODES" ("LEAF_NODE", "NODE_NAME") +TABLESPACE "TRANSMART" ; + +-- +-- Type: INDEX; Owner: TM_WZ; Name: IDX_WTN_LOAD_CLINICAL +-- +CREATE INDEX "TM_WZ"."IDX_WTN_LOAD_CLINICAL" ON "TM_WZ"."WT_TRIAL_NODES" ("LEAF_NODE", "CATEGORY_CD", "DATA_LABEL") +TABLESPACE "TRANSMART" ; + From dbc11f3df62702b49c177e5c23d5030014b0dc8b Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Tue, 12 Aug 2014 10:43:33 +0100 Subject: [PATCH 19/31] biomart_stage update from test server --- ddl/oracle/biomart_stage/bio_assay_analysis_gwas.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ddl/oracle/biomart_stage/bio_assay_analysis_gwas.sql b/ddl/oracle/biomart_stage/bio_assay_analysis_gwas.sql index 5fac9666..527d2449 100644 --- a/ddl/oracle/biomart_stage/bio_assay_analysis_gwas.sql +++ b/ddl/oracle/biomart_stage/bio_assay_analysis_gwas.sql @@ -7,7 +7,8 @@ "RS_ID" NVARCHAR2(50), "P_VALUE_CHAR" VARCHAR2(100 BYTE), "ETL_ID" NUMBER(18,0), -"EXT_DATA" VARCHAR2(4000 BYTE) +"EXT_DATA" VARCHAR2(4000 BYTE), +"LOG10_PVAL_CHAR" VARCHAR2(100 BYTE) ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; From ebdab7082c6516999aff327f4f968afd88613b6b Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Tue, 12 Aug 2014 10:44:01 +0100 Subject: [PATCH 20/31] biomart_user update from test server --- ddl/oracle/biomart_user/_cross.sql | 20 +- ddl/oracle/biomart_user/_misc.sql | 6 +- ddl/oracle/biomart_user/items.json | 1101 ++++++++++++++++++++++++---- 3 files changed, 957 insertions(+), 170 deletions(-) diff --git a/ddl/oracle/biomart_user/_cross.sql b/ddl/oracle/biomart_user/_cross.sql index 11bab54c..0943fad6 100644 --- a/ddl/oracle/biomart_user/_cross.sql +++ b/ddl/oracle/biomart_user/_cross.sql @@ -1,7 +1,7 @@ -- -- Type: VIEW; Owner: BIOMART_USER; Name: BROWSE_ANALYSES_VIEW -- - CREATE OR REPLACE FORCE VIEW "BIOMART_USER"."BROWSE_ANALYSES_VIEW" ("ID", "TITLE", "DESCRIPTION", "MEASUREMENT_TYPE", "PLATFORM_NAME", "VENDOR", "TECHNOLOGY") AS + CREATE OR REPLACE FORCE EDITIONABLE VIEW "BIOMART_USER"."BROWSE_ANALYSES_VIEW" ("ID", "TITLE", "DESCRIPTION", "MEASUREMENT_TYPE", "PLATFORM_NAME", "VENDOR", "TECHNOLOGY") AS select fd.unique_id , baa.analysis_name as title @@ -22,11 +22,15 @@ where ata.object_type in ('BIO_ASSAY_PLATFORM') and ff.active_ind = 1 group by fd.unique_id, baa.analysis_name, baa.long_description; - +-- +-- Type: INDEX; Owner: BIOMART_USER; Name: OBSERVATION_FACT_PD +-- +CREATE INDEX "BIOMART_USER"."OBSERVATION_FACT_PD" ON "I2B2DEMODATA"."OBSERVATION_FACT" ("PATIENT_NUM") +TABLESPACE "BIOMART" ; -- -- Type: VIEW; Owner: BIOMART_USER; Name: BROWSE_STUDIES_VIEW -- - CREATE OR REPLACE FORCE VIEW "BIOMART_USER"."BROWSE_STUDIES_VIEW" ("ID", "TITLE", "DESCRIPTION", "DESIGN", "BIOMARKER_TYPE", "ACCESS_TYPE", "ACCESSION", "INSTITUTION", "COUNTRY", "DISEASE", "COMPOUND", "STUDY_OBJECTIVE", "ORGANISM", "STUDY_PHASE") AS + CREATE OR REPLACE FORCE EDITIONABLE VIEW "BIOMART_USER"."BROWSE_STUDIES_VIEW" ("ID", "TITLE", "DESCRIPTION", "DESIGN", "BIOMARKER_TYPE", "ACCESS_TYPE", "ACCESSION", "INSTITUTION", "COUNTRY", "DISEASE", "COMPOUND", "STUDY_OBJECTIVE", "ORGANISM", "STUDY_PHASE") AS SELECT fd.unique_id , exp.title @@ -75,11 +79,10 @@ left outer join (select id, disease, compound, study_objective, species, phase f ) )x on x.id = fd.unique_id where ff.active_ind = 1; - -- -- Type: VIEW; Owner: BIOMART_USER; Name: BROWSE_PROGRAMS_VIEW -- - CREATE OR REPLACE FORCE VIEW "BIOMART_USER"."BROWSE_PROGRAMS_VIEW" ("ID", "TITLE", "DESCRIPTION", "DISEASE", "OBSERVATION", "PATHWAY", "GENE", "THERAPEUTIC_DOMAIN", "INSTITUTION", "TARGET") AS + CREATE OR REPLACE FORCE EDITIONABLE VIEW "BIOMART_USER"."BROWSE_PROGRAMS_VIEW" ("ID", "TITLE", "DESCRIPTION", "DISEASE", "OBSERVATION", "PATHWAY", "GENE", "THERAPEUTIC_DOMAIN", "INSTITUTION", "TARGET") AS select fd.unique_id , f.folder_name as title , f.description @@ -176,11 +179,10 @@ left outer join ) ) x on x.id = fd.unique_id where f.folder_type = 'PROGRAM' and f.active_ind = 1; - -- -- Type: VIEW; Owner: BIOMART_USER; Name: BROWSE_FOLDERS_VIEW -- - CREATE OR REPLACE FORCE VIEW "BIOMART_USER"."BROWSE_FOLDERS_VIEW" ("ID", "TITLE", "DESCRIPTION", "FILE_TYPE") AS + CREATE OR REPLACE FORCE EDITIONABLE VIEW "BIOMART_USER"."BROWSE_FOLDERS_VIEW" ("ID", "TITLE", "DESCRIPTION", "FILE_TYPE") AS select fd.unique_id , f.folder_name as title , f.description @@ -192,11 +194,10 @@ where f.folder_type = 'FOLDER' and f.active_ind = 1 and ata.object_type='BIO_CONCEPT_CODE' and ata.object_uid like 'FILE_TYPE%' group by fd.unique_id, f.folder_name, f.description; - -- -- Type: VIEW; Owner: BIOMART_USER; Name: BROWSE_ASSAYS_VIEW -- - CREATE OR REPLACE FORCE VIEW "BIOMART_USER"."BROWSE_ASSAYS_VIEW" ("ID", "TITLE", "DESCRIPTION", "MEASUREMENT_TYPE", "PLATFORM_NAME", "VENDOR", "TECHNOLOGY", "GENE", "MIRNA", "BIOMARKER_TYPE") AS + CREATE OR REPLACE FORCE EDITIONABLE VIEW "BIOMART_USER"."BROWSE_ASSAYS_VIEW" ("ID", "TITLE", "DESCRIPTION", "MEASUREMENT_TYPE", "PLATFORM_NAME", "VENDOR", "TECHNOLOGY", "GENE", "MIRNA", "BIOMARKER_TYPE") AS select DISTINCT fd.unique_id , f.folder_name as title , f.description @@ -244,4 +245,3 @@ group by fd.unique_id, f.folder_name, f.description; ) x on x.id = fd.unique_id where f.folder_type = 'ASSAY' and f.active_ind = 1 group by fd.unique_id, f.folder_name, f.description, x.gene, x.mirna, x.biomarker_type; - diff --git a/ddl/oracle/biomart_user/_misc.sql b/ddl/oracle/biomart_user/_misc.sql index a90efc38..e9f45370 100644 --- a/ddl/oracle/biomart_user/_misc.sql +++ b/ddl/oracle/biomart_user/_misc.sql @@ -1,14 +1,12 @@ -- -- Type: TYPE; Owner: BIOMART_USER; Name: CONCEPT_CD_TAB -- - CREATE OR REPLACE TYPE "BIOMART_USER"."CONCEPT_CD_TAB" IS TABLE OF VARCHAR2(50) + CREATE OR REPLACE EDITIONABLE TYPE "BIOMART_USER"."CONCEPT_CD_TAB" IS TABLE OF VARCHAR2(50) / - -- -- Type: TYPE; Owner: BIOMART_USER; Name: PATIENTS_TAB -- - CREATE OR REPLACE TYPE "BIOMART_USER"."PATIENTS_TAB" IS TABLE OF NUMBER(10,0) + CREATE OR REPLACE EDITIONABLE TYPE "BIOMART_USER"."PATIENTS_TAB" IS TABLE OF NUMBER(10,0) / - diff --git a/ddl/oracle/biomart_user/items.json b/ddl/oracle/biomart_user/items.json index 3e60e502..f9afa9d5 100644 --- a/ddl/oracle/biomart_user/items.json +++ b/ddl/oracle/biomart_user/items.json @@ -1,5 +1,16 @@ { "dependencies" : [ { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "ADD_ONTOLOGY_NODE" + }, + "parents" : [ { + "type" : "PROCEDURE", + "owner" : "I2B2METADATA", + "name" : "ADD_ONTOLOGY_NODE" + } ] + }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", @@ -21,6 +32,17 @@ "owner" : "AMAPP", "name" : "AM_TAG_ASSOCIATION" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "AM_TAG_DISPLAY_VW" + }, + "parents" : [ { + "type" : "VIEW", + "owner" : "AMAPP", + "name" : "AM_TAG_DISPLAY_VW" + } ] }, { "child" : { "type" : "SYNONYM", @@ -76,6 +98,17 @@ "owner" : "BIOMART", "name" : "ANNOTATION" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "ANNOTATION_DEAPP" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "ANNOTATION_DEAPP" + } ] }, { "child" : { "type" : "SYNONYM", @@ -241,17 +274,6 @@ "owner" : "BIOMART", "name" : "BIO_ASSAY_ANALYSIS_EXT" } ] - }, { - "child" : { - "type" : "SYNONYM", - "owner" : "BIOMART_USER", - "name" : "BIO_ASSAY_ANALYSIS_GWAS" - }, - "parents" : [ { - "type" : "TABLE", - "owner" : "BIOMART", - "name" : "BIO_ASSAY_ANALYSIS_GWAS" - } ] }, { "child" : { "type" : "SYNONYM", @@ -494,6 +516,17 @@ "owner" : "BIOMART", "name" : "BIO_CLINICAL_TRIAL_DESIGN" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "BIO_CLINICAL_TRIAL_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "BIO_CLINICAL_TRIAL_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -527,6 +560,13 @@ "owner" : "BIOMART", "name" : "BIO_CONCEPT_CODE" } ] + }, { + "child" : { + "type" : "FUNCTION", + "owner" : "BIOMART_USER", + "name" : "BIO_CONCEPT_CODE_UID" + }, + "parents" : [ ] }, { "child" : { "type" : "SYNONYM", @@ -604,6 +644,17 @@ "owner" : "BIOMART", "name" : "BIO_DATA_COMPOUND" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "BIO_DATA_COMPOUND_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "BIO_DATA_COMPOUND_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -714,6 +765,17 @@ "owner" : "BIOMART", "name" : "BIO_DATA_UID" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "BIO_DATA_UID_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "BIO_DATA_UID_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -736,6 +798,17 @@ "owner" : "BIOMART", "name" : "BIO_EXPERIMENT" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "BIO_EXPERIMENT_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "BIO_EXPERIMENT_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -857,6 +930,17 @@ "owner" : "BIOMART", "name" : "BIO_MARKER_CORREL_MV" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "BIO_MARKER_EXP_ANALYSIS_MV" + }, + "parents" : [ { + "type" : "VIEW", + "owner" : "BIOMART", + "name" : "BIO_MARKER_EXP_ANALYSIS_MV" + } ] }, { "child" : { "type" : "SYNONYM", @@ -956,6 +1040,17 @@ "owner" : "BIOMART", "name" : "BIO_TAXONOMY" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "BIRN" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "I2B2METADATA", + "name" : "BIRN" + } ] }, { "child" : { "type" : "VIEW", @@ -1119,6 +1214,17 @@ "owner" : "FMAPP", "name" : "FM_FOLDER_ASSOCIATION" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "CATEGORY_PATH_EXCLUDED_WORDS" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "CATEGORY_PATH_EXCLUDED_WORDS" + } ] }, { "child" : { "type" : "SYNONYM", @@ -1192,6 +1298,17 @@ "owner" : "I2B2DEMODATA", "name" : "CONCEPT_DIMENSION_BK" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "CONCEPT_DIMENSION_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "CONCEPT_DIMENSION_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -1225,6 +1342,83 @@ "owner" : "I2B2DEMODATA", "name" : "CRC_DB_LOOKUP" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "CREATE_TEMP_CONCEPT_TABLE" + }, + "parents" : [ { + "type" : "PROCEDURE", + "owner" : "I2B2DEMODATA", + "name" : "CREATE_TEMP_CONCEPT_TABLE" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "CREATE_TEMP_EID_TABLE" + }, + "parents" : [ { + "type" : "PROCEDURE", + "owner" : "I2B2DEMODATA", + "name" : "CREATE_TEMP_EID_TABLE" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "CREATE_TEMP_PATIENT_TABLE" + }, + "parents" : [ { + "type" : "PROCEDURE", + "owner" : "I2B2DEMODATA", + "name" : "CREATE_TEMP_PATIENT_TABLE" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "CREATE_TEMP_PID_TABLE" + }, + "parents" : [ { + "type" : "PROCEDURE", + "owner" : "I2B2DEMODATA", + "name" : "CREATE_TEMP_PID_TABLE" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "CREATE_TEMP_PROVIDER_TABLE" + }, + "parents" : [ { + "type" : "PROCEDURE", + "owner" : "I2B2DEMODATA", + "name" : "CREATE_TEMP_PROVIDER_TABLE" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "CREATE_TEMP_TABLE" + }, + "parents" : [ { + "type" : "PROCEDURE", + "owner" : "I2B2DEMODATA", + "name" : "CREATE_TEMP_TABLE" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "CREATE_TEMP_VISIT_TABLE" + }, + "parents" : [ { + "type" : "PROCEDURE", + "owner" : "I2B2DEMODATA", + "name" : "CREATE_TEMP_VISIT_TABLE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -1735,271 +1929,414 @@ "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DATAMART_REPORT" + "name" : "CZ_FORM_LAYOUT" }, "parents" : [ { "type" : "TABLE", - "owner" : "I2B2DEMODATA", - "name" : "DATAMART_REPORT" + "owner" : "TM_CZ", + "name" : "CZ_FORM_LAYOUT" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DD" + "name" : "CZ_JOB_AUDIT" }, "parents" : [ { "type" : "TABLE", - "owner" : "BIOMART", - "name" : "DD" + "owner" : "TM_CZ", + "name" : "CZ_JOB_AUDIT" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DEAPP_ANNOTATION" + "name" : "CZ_JOB_ERROR" }, "parents" : [ { "type" : "TABLE", - "owner" : "DEAPP", - "name" : "DEAPP_ANNOTATION" + "owner" : "TM_CZ", + "name" : "CZ_JOB_ERROR" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_CHROMOSOMAL_REGION" + "name" : "CZ_JOB_MASTER" }, "parents" : [ { "type" : "TABLE", - "owner" : "DEAPP", - "name" : "DE_CHROMOSOMAL_REGION" + "owner" : "TM_CZ", + "name" : "CZ_JOB_MASTER" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_CHROMO_REGION_ID_SEQ" + "name" : "CZ_JOB_MESSAGE" }, "parents" : [ { - "type" : "SEQUENCE", - "owner" : "DEAPP", - "name" : "DE_CHROMO_REGION_ID_SEQ" + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "CZ_JOB_MESSAGE" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_CONCEPT_VISIT" + "name" : "CZ_PERSON" }, "parents" : [ { "type" : "TABLE", - "owner" : "DEAPP", - "name" : "DE_CONCEPT_VISIT" + "owner" : "TM_CZ", + "name" : "CZ_PERSON" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_ENCOUNTER_LEVEL" + "name" : "CZ_TEST" }, "parents" : [ { "type" : "TABLE", - "owner" : "DEAPP", - "name" : "DE_ENCOUNTER_LEVEL" + "owner" : "TM_CZ", + "name" : "CZ_TEST" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_ENCOUNTER_TYPE" + "name" : "CZ_TEST_CATEGORY" }, "parents" : [ { "type" : "TABLE", - "owner" : "DEAPP", - "name" : "DE_ENCOUNTER_TYPE" + "owner" : "TM_CZ", + "name" : "CZ_TEST_CATEGORY" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_GPL_INFO" + "name" : "CZ_TEST_RESULT" }, "parents" : [ { "type" : "TABLE", - "owner" : "DEAPP", - "name" : "DE_GPL_INFO" + "owner" : "TM_CZ", + "name" : "CZ_TEST_RESULT" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_METABOLITE_ANNOTATION" + "name" : "CZ_XTRIAL_CTRL_VOCAB" }, "parents" : [ { "type" : "TABLE", - "owner" : "DEAPP", - "name" : "DE_METABOLITE_ANNOTATION" + "owner" : "TM_CZ", + "name" : "CZ_XTRIAL_CTRL_VOCAB" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_METABOLITE_SUB_PATHWAYS" + "name" : "CZ_XTRIAL_EXCLUSION" }, "parents" : [ { "type" : "TABLE", - "owner" : "DEAPP", - "name" : "DE_METABOLITE_SUB_PATHWAYS" + "owner" : "TM_CZ", + "name" : "CZ_XTRIAL_EXCLUSION" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_METABOLITE_SUB_PWAY_METAB" + "name" : "DATAMART_REPORT" }, "parents" : [ { "type" : "TABLE", - "owner" : "DEAPP", - "name" : "DE_METABOLITE_SUB_PWAY_METAB" + "owner" : "I2B2DEMODATA", + "name" : "DATAMART_REPORT" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_METABOLITE_SUPER_PATHWAYS" + "name" : "DD" }, "parents" : [ { "type" : "TABLE", - "owner" : "DEAPP", - "name" : "DE_METABOLITE_SUPER_PATHWAYS" + "owner" : "BIOMART", + "name" : "DD" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_MRNA_ANNOTATION" + "name" : "DEAPP_ANNOTATION" }, "parents" : [ { "type" : "TABLE", "owner" : "DEAPP", - "name" : "DE_MRNA_ANNOTATION" + "name" : "DEAPP_ANNOTATION" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_MRNA_ANNOTATION_BKP" + "name" : "DE_CHROMOSOMAL_REGION" }, "parents" : [ { "type" : "TABLE", "owner" : "DEAPP", - "name" : "DE_MRNA_ANNOTATION_BKP" + "name" : "DE_CHROMOSOMAL_REGION" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_OBS_ENROLL_DAYS" + "name" : "DE_CHROMO_REGION_ID_SEQ" }, "parents" : [ { - "type" : "TABLE", + "type" : "SEQUENCE", "owner" : "DEAPP", - "name" : "DE_OBS_ENROLL_DAYS" + "name" : "DE_CHROMO_REGION_ID_SEQ" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_PARENT_CD_SEQ" + "name" : "DE_CONCEPT_VISIT" }, "parents" : [ { - "type" : "SEQUENCE", + "type" : "TABLE", "owner" : "DEAPP", - "name" : "DE_PARENT_CD_SEQ" + "name" : "DE_CONCEPT_VISIT" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_PATHWAY" + "name" : "DE_ENCOUNTER_LEVEL" }, "parents" : [ { "type" : "TABLE", "owner" : "DEAPP", - "name" : "DE_PATHWAY" + "name" : "DE_ENCOUNTER_LEVEL" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_PATHWAY_GENE" + "name" : "DE_ENCOUNTER_TYPE" }, "parents" : [ { "type" : "TABLE", "owner" : "DEAPP", - "name" : "DE_PATHWAY_GENE" + "name" : "DE_ENCOUNTER_TYPE" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_PROTEIN_ANNOTATION" + "name" : "DE_GPL_INFO" }, "parents" : [ { "type" : "TABLE", "owner" : "DEAPP", - "name" : "DE_PROTEIN_ANNOTATION" + "name" : "DE_GPL_INFO" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_QPCR_MIRNA_ANNOTATION" + "name" : "DE_GPL_INFO_RELEASE" }, "parents" : [ { "type" : "TABLE", - "owner" : "DEAPP", - "name" : "DE_QPCR_MIRNA_ANNOTATION" + "owner" : "TM_CZ", + "name" : "DE_GPL_INFO_RELEASE" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_RBM_ANNOTATION" + "name" : "DE_METABOLITE_ANNOTATION" }, "parents" : [ { "type" : "TABLE", "owner" : "DEAPP", - "name" : "DE_RBM_ANNOTATION" + "name" : "DE_METABOLITE_ANNOTATION" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_RBM_DATA_ANNOTATION_JOIN" + "name" : "DE_METABOLITE_SUB_PATHWAYS" }, "parents" : [ { "type" : "TABLE", "owner" : "DEAPP", - "name" : "DE_RBM_DATA_ANNOTATION_JOIN" + "name" : "DE_METABOLITE_SUB_PATHWAYS" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_RC_SNP_INFO" + "name" : "DE_METABOLITE_SUB_PWAY_METAB" }, "parents" : [ { "type" : "TABLE", "owner" : "DEAPP", - "name" : "DE_RC_SNP_INFO" + "name" : "DE_METABOLITE_SUB_PWAY_METAB" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "DE_RC_SNP_INFO_SEQ" + "name" : "DE_METABOLITE_SUPER_PATHWAYS" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_METABOLITE_SUPER_PATHWAYS" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_MRNA_ANNOTATION" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_MRNA_ANNOTATION" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_MRNA_ANNOTATION_BKP" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_MRNA_ANNOTATION_BKP" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_MRNA_ANNOTATION_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "DE_MRNA_ANNOTATION_RELEASE" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_OBS_ENROLL_DAYS" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_OBS_ENROLL_DAYS" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_PARENT_CD_SEQ" + }, + "parents" : [ { + "type" : "SEQUENCE", + "owner" : "DEAPP", + "name" : "DE_PARENT_CD_SEQ" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_PATHWAY" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_PATHWAY" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_PATHWAY_GENE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_PATHWAY_GENE" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_PROTEIN_ANNOTATION" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_PROTEIN_ANNOTATION" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_QPCR_MIRNA_ANNOTATION" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_QPCR_MIRNA_ANNOTATION" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_RBM_ANNOTATION" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_RBM_ANNOTATION" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_RBM_DATA_ANNOTATION_JOIN" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_RBM_DATA_ANNOTATION_JOIN" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_RC_SNP_INFO" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_RC_SNP_INFO" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_RC_SNP_INFO_SEQ" }, "parents" : [ { "type" : "SEQUENCE", @@ -2072,6 +2409,17 @@ "owner" : "DEAPP", "name" : "DE_SNP_DATA_BY_PATIENT" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_SNP_DATA_BY_PATIENT_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "DE_SNP_DATA_BY_PATIENT_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -2083,6 +2431,17 @@ "owner" : "DEAPP", "name" : "DE_SNP_DATA_BY_PROBE" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_SNP_DATA_BY_PROBE_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "DE_SNP_DATA_BY_PROBE_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -2105,6 +2464,17 @@ "owner" : "DEAPP", "name" : "DE_SNP_DATA_DATASET_LOC_BK" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_SNP_DATA_DS_LOC_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "DE_SNP_DATA_DS_LOC_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -2116,6 +2486,17 @@ "owner" : "DEAPP", "name" : "DE_SNP_GENE_MAP" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_SNP_GENE_MAP_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "DE_SNP_GENE_MAP_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -2127,6 +2508,17 @@ "owner" : "DEAPP", "name" : "DE_SNP_INFO" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_SNP_INFO_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "DE_SNP_INFO_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -2138,6 +2530,17 @@ "owner" : "DEAPP", "name" : "DE_SNP_PROBE" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_SNP_PROBE_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "DE_SNP_PROBE_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -2160,6 +2563,17 @@ "owner" : "DEAPP", "name" : "DE_SNP_PROBE_SORTED_DEF_BK" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_SNP_PROBE_SORT_DEF_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "DE_SNP_PROBE_SORT_DEF_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -2259,6 +2673,17 @@ "owner" : "DEAPP", "name" : "DE_SUBJECT_MIRNA_DATA" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_SUBJECT_MRNA_DATA_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "DE_SUBJECT_MRNA_DATA_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -2292,6 +2717,17 @@ "owner" : "DEAPP", "name" : "DE_SUBJECT_RBM_DATA" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_SUBJECT_RBM_DATA_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "DE_SUBJECT_RBM_DATA_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -2380,6 +2816,28 @@ "owner" : "DEAPP", "name" : "DE_SUBJECT_SNP_DATASET_GSK" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_SUBJ_PROTEIN_DATA_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "DE_SUBJ_PROTEIN_DATA_RELEASE" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DE_SUBJ_SAMPLE_MAP_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "DE_SUBJ_SAMPLE_MAP_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -2600,6 +3058,17 @@ "owner" : "I2B2DEMODATA", "name" : "DR$OF_CTX_BLOB$R" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "DUMP_TABLE_TO_CSV" + }, + "parents" : [ { + "type" : "PROCEDURE", + "owner" : "DEAPP", + "name" : "DUMP_TABLE_TO_CSV" + } ] }, { "child" : { "type" : "SYNONYM", @@ -2622,6 +3091,17 @@ "owner" : "I2B2DEMODATA", "name" : "ENCOUNTER_MAPPING" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "FACETED_SEARCH" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "FACETED_SEARCH" + } ] }, { "child" : { "type" : "SYNONYM", @@ -2823,6 +3303,17 @@ "owner" : "DEAPP", "name" : "HAPLOVIEW_DATA" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "HAPLOVIEW_DATA_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "HAPLOVIEW_DATA_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -2891,80 +3382,191 @@ } ] }, { "child" : { - "type" : "SYNONYM", + "type" : "PROCEDURE", + "owner" : "BIOMART_USER", + "name" : "I2B2_LOAD_EQTL_TOP50" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS" + }, { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS_EQTL" + }, { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASY_ANALYSIS_EQTL_TOP50" + }, { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_RC_SNP_INFO" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "I2B2_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "I2B2_RELEASE" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "I2B2_SECURE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "I2B2METADATA", + "name" : "I2B2_SECURE" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "I2B2_SECURE_BK" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "I2B2METADATA", + "name" : "I2B2_SECURE_BK" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "I2B2_SECURE_BK1" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "I2B2METADATA", + "name" : "I2B2_SECURE_BK1" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "I2B2_TAGS" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "I2B2METADATA", + "name" : "I2B2_TAGS" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "I2B2_TAGS_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "I2B2_TAGS_RELEASE" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "I2B2_TRIAL_NODES" + }, + "parents" : [ { + "type" : "VIEW", + "owner" : "I2B2METADATA", + "name" : "I2B2_TRIAL_NODES" + } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "BIOMART_USER", + "name" : "IDX_GOD_ORGANISM" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART_USER", + "name" : "GENE_ONTOLOGY_DATA" + } ] + }, { + "child" : { + "type" : "INDEX", "owner" : "BIOMART_USER", - "name" : "I2B2_SECURE" + "name" : "IDX_GOD_SYMBOL" }, "parents" : [ { "type" : "TABLE", - "owner" : "I2B2METADATA", - "name" : "I2B2_SECURE" + "owner" : "BIOMART_USER", + "name" : "GENE_ONTOLOGY_DATA" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "I2B2_SECURE_BK" + "name" : "INSERT_CONCEPT_FROMTEMP" }, "parents" : [ { - "type" : "TABLE", - "owner" : "I2B2METADATA", - "name" : "I2B2_SECURE_BK" + "type" : "PROCEDURE", + "owner" : "I2B2DEMODATA", + "name" : "INSERT_CONCEPT_FROMTEMP" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "I2B2_SECURE_BK1" + "name" : "INSERT_EID_MAP_FROMTEMP" }, "parents" : [ { - "type" : "TABLE", - "owner" : "I2B2METADATA", - "name" : "I2B2_SECURE_BK1" + "type" : "PROCEDURE", + "owner" : "I2B2DEMODATA", + "name" : "INSERT_EID_MAP_FROMTEMP" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "I2B2_TAGS" + "name" : "INSERT_ENCOUNTERVISIT_FROMTEMP" }, "parents" : [ { - "type" : "TABLE", - "owner" : "I2B2METADATA", - "name" : "I2B2_TAGS" + "type" : "PROCEDURE", + "owner" : "I2B2DEMODATA", + "name" : "INSERT_ENCOUNTERVISIT_FROMTEMP" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "I2B2_TRIAL_NODES" + "name" : "INSERT_PATIENT_MAP_FROMTEMP" }, "parents" : [ { - "type" : "VIEW", - "owner" : "I2B2METADATA", - "name" : "I2B2_TRIAL_NODES" + "type" : "PROCEDURE", + "owner" : "I2B2DEMODATA", + "name" : "INSERT_PATIENT_MAP_FROMTEMP" } ] }, { "child" : { - "type" : "INDEX", + "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "IDX_GOD_ORGANISM" + "name" : "INSERT_PID_MAP_FROMTEMP" }, "parents" : [ { - "type" : "TABLE", - "owner" : "BIOMART_USER", - "name" : "GENE_ONTOLOGY_DATA" + "type" : "PROCEDURE", + "owner" : "I2B2DEMODATA", + "name" : "INSERT_PID_MAP_FROMTEMP" } ] }, { "child" : { - "type" : "INDEX", + "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "IDX_GOD_SYMBOL" + "name" : "INSERT_PROVIDER_FROMTEMP" }, "parents" : [ { - "type" : "TABLE", - "owner" : "BIOMART_USER", - "name" : "GENE_ONTOLOGY_DATA" + "type" : "PROCEDURE", + "owner" : "I2B2DEMODATA", + "name" : "INSERT_PROVIDER_FROMTEMP" } ] }, { "child" : { @@ -3036,78 +3638,78 @@ "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "KEGG_DEF" + "name" : "LISTSIG_GENES" }, "parents" : [ { - "type" : "TABLE", - "owner" : "DEAPP", - "name" : "KEGG_DEF" + "type" : "VIEW", + "owner" : "SEARCHAPP", + "name" : "LISTSIG_GENES" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "LISTSIG_GENES" + "name" : "LZ_SRC_ANALYSIS_METADATA" }, "parents" : [ { - "type" : "VIEW", - "owner" : "SEARCHAPP", - "name" : "LISTSIG_GENES" + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LZ_SRC_ANALYSIS_METADATA" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "MAP" + "name" : "LZ_SRC_STUDY_METADATA" }, "parents" : [ { "type" : "TABLE", - "owner" : "I2B2DEMODATA", - "name" : "MAP" + "owner" : "TM_LZ", + "name" : "LZ_SRC_STUDY_METADATA" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "MASTER_QUERY_GLOBAL_TEMP" + "name" : "MAP" }, "parents" : [ { "type" : "TABLE", "owner" : "I2B2DEMODATA", - "name" : "MASTER_QUERY_GLOBAL_TEMP" + "name" : "MAP" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "MESH" + "name" : "MASTER_QUERY_GLOBAL_TEMP" }, "parents" : [ { "type" : "TABLE", - "owner" : "BIOMART", - "name" : "MESH" + "owner" : "I2B2DEMODATA", + "name" : "MASTER_QUERY_GLOBAL_TEMP" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "MESH_DESCRIPTOR" + "name" : "MESH_ALL" }, "parents" : [ { "type" : "TABLE", "owner" : "BIOMART", - "name" : "MESH_DESCRIPTOR" + "name" : "MESH_ALL" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "MESH_ENTRY" + "name" : "MESH_DESCRIPTOR" }, "parents" : [ { "type" : "TABLE", "owner" : "BIOMART", - "name" : "MESH_ENTRY" + "name" : "MESH_DESCRIPTOR" } ] }, { "child" : { @@ -3230,6 +3832,17 @@ "owner" : "I2B2DEMODATA", "name" : "NEWS_UPDATES" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "NODE_CURATION" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "NODE_CURATION" + } ] }, { "child" : { "type" : "SYNONYM", @@ -3252,6 +3865,28 @@ "owner" : "I2B2DEMODATA", "name" : "OBSERVATION_FACT_BK" } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "BIOMART_USER", + "name" : "OBSERVATION_FACT_PD" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "I2B2DEMODATA", + "name" : "OBSERVATION_FACT" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "OBSERVATION_FACT_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "OBSERVATION_FACT_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -3303,6 +3938,17 @@ "owner" : "I2B2DEMODATA", "name" : "PATIENT_DIMENSION" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "PATIENT_DIMENSION_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "PATIENT_DIMENSION_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -3380,6 +4026,28 @@ "owner" : "SEARCHAPP", "name" : "PLUGIN_SEQ" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "PROBESET_DEAPP" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "PROBESET_DEAPP" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "PROBESET_DEAPP_20120206" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "PROBESET_DEAPP_20120206" + } ] }, { "child" : { "type" : "SYNONYM", @@ -3699,6 +4367,17 @@ "owner" : "DEAPP", "name" : "RBM_ANNOTATION_ID" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "REMOVE_TEMP_TABLE" + }, + "parents" : [ { + "type" : "PROCEDURE", + "owner" : "I2B2DEMODATA", + "name" : "REMOVE_TEMP_TABLE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -3743,6 +4422,17 @@ "owner" : "I2B2DEMODATA", "name" : "SAMPLE_CATEGORIES" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "SAMPLE_CATEGORIES_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "SAMPLE_CATEGORIES_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -3886,6 +4576,17 @@ "owner" : "SEARCHAPP", "name" : "SEARCH_BIO_MKR_CORREL_FST_VIEW" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "SEARCH_BIO_MKR_CORREL_VIEW" + }, + "parents" : [ { + "type" : "VIEW", + "owner" : "SEARCHAPP", + "name" : "SEARCH_BIO_MKR_CORREL_VIEW" + } ] }, { "child" : { "type" : "SYNONYM", @@ -4029,6 +4730,17 @@ "owner" : "SEARCHAPP", "name" : "SEARCH_SECURE_OBJECT_PATH" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "SEARCH_SECURE_OBJECT_RELEASE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "SEARCH_SECURE_OBJECT_RELEASE" + } ] }, { "child" : { "type" : "SYNONYM", @@ -4260,6 +4972,17 @@ "owner" : "I2B2DEMODATA", "name" : "SEQ_ENCOUNTER_NUM" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "SEQ_ETL_ID" + }, + "parents" : [ { + "type" : "SEQUENCE", + "owner" : "TM_LZ", + "name" : "SEQ_ETL_ID" + } ] }, { "child" : { "type" : "SYNONYM", @@ -4381,6 +5104,17 @@ "owner" : "I2B2DEMODATA", "name" : "SOURCE_MASTER" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "SP_XTAB" + }, + "parents" : [ { + "type" : "PROCEDURE", + "owner" : "I2B2DEMODATA", + "name" : "SP_XTAB" + } ] }, { "child" : { "type" : "SYNONYM", @@ -4491,6 +5225,17 @@ "owner" : "I2B2DEMODATA", "name" : "TIMERS" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "TJEA_JUNK" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "TJEA_JUNK" + } ] }, { "child" : { "type" : "SYNONYM", @@ -4502,6 +5247,17 @@ "owner" : "BIOMART", "name" : "TMP_BIO_MARKER" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "TMP_NUM_DATA_TYPES" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "TMP_NUM_DATA_TYPES" + } ] }, { "child" : { "type" : "SYNONYM", @@ -4568,6 +5324,39 @@ "owner" : "I2B2METADATA", "name" : "TMP_SECURE_TOKEN" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "TMP_SUBJECT_INFO" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "TMP_SUBJECT_INFO" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "TMP_TRIAL_DATA" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "TMP_TRIAL_DATA" + } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "BIOMART_USER", + "name" : "TMP_TRIAL_NODES" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "TMP_TRIAL_NODES" + } ] }, { "child" : { "type" : "SYNONYM", @@ -4583,68 +5372,54 @@ "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "UPLOAD_STATUS" + "name" : "UPDATE_OBSERVATION_FACT" }, "parents" : [ { - "type" : "TABLE", + "type" : "PROCEDURE", "owner" : "I2B2DEMODATA", - "name" : "UPLOAD_STATUS" + "name" : "UPDATE_OBSERVATION_FACT" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "VISIT_DIMENSION" + "name" : "UPLOAD_STATUS" }, "parents" : [ { "type" : "TABLE", "owner" : "I2B2DEMODATA", - "name" : "VISIT_DIMENSION" + "name" : "UPLOAD_STATUS" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "VW_FACETED_SEARCH" + "name" : "VISIT_DIMENSION" }, "parents" : [ { - "type" : "VIEW", - "owner" : "BIOMART", - "name" : "VW_FACETED_SEARCH" + "type" : "TABLE", + "owner" : "I2B2DEMODATA", + "name" : "VISIT_DIMENSION" } ] }, { "child" : { "type" : "SYNONYM", "owner" : "BIOMART_USER", - "name" : "VW_FACETED_SEARCH_DISEASE" + "name" : "VW_FACETED_SEARCH" }, "parents" : [ { "type" : "VIEW", "owner" : "BIOMART", - "name" : "VW_FACETED_SEARCH_DISEASE" + "name" : "VW_FACETED_SEARCH" } ] } ], "fileAssignments" : [ { "item" : { - "type" : "TABLE", - "owner" : "BIOMART_USER", - "name" : "GENE_ONTOLOGY" - }, - "file" : "biomart_user/gene_ontology.sql" - }, { - "item" : { - "type" : "TABLE", - "owner" : "BIOMART_USER", - "name" : "GENE_ONTOLOGY" - }, - "file" : "biomart_user/gene_ontology.sql" - }, { - "item" : { - "type" : "TABLE", + "type" : "FUNCTION", "owner" : "BIOMART_USER", - "name" : "GENE_ONTOLOGY_DATA" + "name" : "BIO_CONCEPT_CODE_UID" }, - "file" : "biomart_user/gene_ontology_data.sql" + "file" : "biomart_user/functions/bio_concept_code_uid.sql" }, { "item" : { "type" : "VIEW", @@ -4701,6 +5476,13 @@ "name" : "GENE_ONTOLOGY_DATA" }, "file" : "biomart_user/gene_ontology_data.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "BIOMART_USER", + "name" : "I2B2_LOAD_EQTL_TOP50" + }, + "file" : "biomart_user/procedures/i2b2_load_eqtl_top50.sql" }, { "item" : { "type" : "INDEX", @@ -4715,6 +5497,13 @@ "name" : "IDX_GOD_SYMBOL" }, "file" : "biomart_user/gene_ontology_data.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "BIOMART_USER", + "name" : "OBSERVATION_FACT_PD" + }, + "file" : "biomart_user/_cross.sql" }, { "item" : { "type" : "TYPE", @@ -4723,4 +5512,4 @@ }, "file" : "biomart_user/_misc.sql" } ] -} +} \ No newline at end of file From b0aae0e7e02b83a56648bf192fc1caef2091369b Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Tue, 12 Aug 2014 10:45:25 +0100 Subject: [PATCH 21/31] biomart_user functions and procedures from test server --- .../functions/bio_concept_code_uid.sql | 14 ++ .../procedures/i2b2_load_eqtl_top50.sql | 156 ++++++++++++++++++ 2 files changed, 170 insertions(+) create mode 100644 ddl/oracle/biomart_user/functions/bio_concept_code_uid.sql create mode 100644 ddl/oracle/biomart_user/procedures/i2b2_load_eqtl_top50.sql diff --git a/ddl/oracle/biomart_user/functions/bio_concept_code_uid.sql b/ddl/oracle/biomart_user/functions/bio_concept_code_uid.sql new file mode 100644 index 00000000..e3789290 --- /dev/null +++ b/ddl/oracle/biomart_user/functions/bio_concept_code_uid.sql @@ -0,0 +1,14 @@ +-- +-- Type: FUNCTION; Owner: BIOMART_USER; Name: BIO_CONCEPT_CODE_UID +-- + CREATE OR REPLACE EDITIONABLE FUNCTION "BIOMART_USER"."BIO_CONCEPT_CODE_UID" ( + CODE_TYPE_NAME VARCHAR2, + BIO_CONCEPT_CODE VARCHAR2 +) RETURN VARCHAR2 AS +BEGIN + -- $Id$ + -- Creates uid for bio_concept_code. + + RETURN nvl(CODE_TYPE_NAME,'ERROR') || ':' || nvl(BIO_CONCEPT_CODE, 'ERROR'); +END bio_concept_code_uid; +/ diff --git a/ddl/oracle/biomart_user/procedures/i2b2_load_eqtl_top50.sql b/ddl/oracle/biomart_user/procedures/i2b2_load_eqtl_top50.sql new file mode 100644 index 00000000..6e201814 --- /dev/null +++ b/ddl/oracle/biomart_user/procedures/i2b2_load_eqtl_top50.sql @@ -0,0 +1,156 @@ +-- +-- Type: PROCEDURE; Owner: BIOMART_USER; Name: I2B2_LOAD_EQTL_TOP50 +-- + CREATE OR REPLACE EDITIONABLE PROCEDURE "BIOMART_USER"."I2B2_LOAD_EQTL_TOP50" +(i_bio_assay_analysis_id number +,i_job_id number := null +) + AS + --Audit variables + newJobFlag INTEGER(1); + databaseName VARCHAR(100); + procedureName VARCHAR(100); + jobID number(18,0); + stepCt number(18,0); + + v_sqlText varchar2(2000); + +BEGIN + --Set Audit Parameters + newJobFlag := 0; -- False (Default) + jobID := i_job_id; + + SELECT sys_context('USERENV', 'CURRENT_SCHEMA') INTO databaseName FROM dual; + procedureName := $$PLSQL_UNIT; + + --Audit JOB Initialization + --If Job ID does not exist, then this is a single procedure run and we need to create it + IF(jobID IS NULL or jobID < 1) + THEN + newJobFlag := 1; -- True + cz_start_audit (procedureName, databaseName, jobID); + END IF; + + stepCt := 1; + cz_write_audit(jobID,databaseName,procedureName,'Starting ' || procedureName,0,stepCt,'Done'); + + -- delete existing data from bio_asy_analysis_eqtl_top50 + + delete from biomart.bio_asy_analysis_eqtl_top50 + where bio_assay_analysis_id = i_bio_assay_analysis_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Delete data for analysis from biomart.bio_asy_analysis_eqtls_top50',SQL%ROWCOUNT,stepCt,'Done'); + commit; + +/* + -- disable indexes + + for eqtl_idx in (select index_name + ,table_name + from all_indexes + where owner = 'BIOMART' + and table_name = 'BIO_ASY_ANALYSIS_EQTL_TOP50') + loop + v_sqlText := 'alter index ' || eqtl_idx.index_name || ' unusable'; + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Disabling index ' || eqtl_idx.index_name || ' on ' || eqtl_idx.table_name,0,stepCt,'Done'); + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Disabling complete',0,stepCt,'Done'); + end loop; +*/ + + -- insert analysis into bio_asy_analysis_eqtl_top50 + + insert into biomart.bio_asy_analysis_eqtl_top50 + (bio_assay_analysis_id + ,analysis + ,chrom + ,pos + ,rsgene + ,rsid + ,pvalue + ,logpvalue + ,extdata + ,rnum + ,intronexon + ,recombinationrate + ,regulome + ) + select a.bio_assay_analysis_id + ,a.analysis + ,info.chrom + ,info.pos + ,a.gene + ,a.rsid + ,a.pvalue + ,a.logpvalue + ,a.extdata + ,a.rnum + ,info.exon_intron as intronexon + ,info.recombination_rate as recombinationrate + ,info.regulome_score as regulome + from (select b.bio_assay_analysis_id + ,b.analysis + ,b.rsid + ,b.pvalue + ,b.logpvalue + ,b.extdata + ,b.gene + ,b.cis_trans + ,b.distance_from_gene + ,b.rnum + from (select eqtl.bio_assay_analysis_id + ,baa.analysis_name as analysis + ,eqtl.rs_id as rsid + ,eqtl.p_value as pvalue + ,eqtl.log_p_value as logpvalue + ,eqtl.ext_data as extdata + ,eqtl.gene + ,eqtl.cis_trans + ,eqtl.distance_from_gene + ,row_number () over (order by eqtl.p_value asc, eqtl.rs_id asc) as rnum + from biomart.bio_assay_analysis_eqtl eqtl + inner join biomart.bio_assay_analysis baa + on baa.bio_assay_analysis_id = eqtl.bio_assay_analysis_id + where eqtl.bio_assay_analysis_id = i_bio_assay_analysis_id) b + where b.rnum < 500) a + inner join deapp.de_rc_snp_info info + on a.rsid = info.rs_id + and hg_version='19'; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Insert data for analysis from biomart.bio_asy_analysis_eaqtl_top50',SQL%ROWCOUNT,stepCt,'Done'); + commit; + +/* + -- rebuild indexes + + for eqtl_idx in (select index_name + ,table_name + from all_indexes + where owner = 'BIOMART' + and table_name = 'BIO_ASY_ANALYSIS_EQTL_TOP50') + loop + v_sqlText := 'alter index ' || eqtl_idx.index_name || ' rebuild'; + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Rebuilding index ' || eqtl_idx.index_name || ' on ' || eqtl_idx.table_name,0,stepCt,'Done'); + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Rebuilding complete',SQL%ROWCOUNT,stepCt,'Done'); + end loop; +*/ + + cz_write_audit(jobID,databaseName,procedureName,'End ' || procedureName,0,stepCt,'Done'); + stepCt := stepCt + 1; + + cz_end_audit(jobID, 'Success'); + + exception + when others then + --Handle errors. + cz_error_handler (jobID, procedureName); + --End Proc + cz_end_audit (jobID, 'FAIL'); + +END I2B2_LOAD_eqtl_TOP50; +/ From 07ac6c8486e8452247afcf2f7029bd6bd871e8e6 Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Tue, 12 Aug 2014 10:50:28 +0100 Subject: [PATCH 22/31] i2b2demodata updates from test server --- ddl/oracle/i2b2metadata/i2b2.sql | 7 ++++++- ddl/oracle/i2b2metadata/items.json | 20 ++++++++++++++++++- .../procedures/add_ontology_node.sql | 11 ++++++++-- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/ddl/oracle/i2b2metadata/i2b2.sql b/ddl/oracle/i2b2metadata/i2b2.sql index 882d20c0..224c2343 100644 --- a/ddl/oracle/i2b2metadata/i2b2.sql +++ b/ddl/oracle/i2b2metadata/i2b2.sql @@ -36,7 +36,6 @@ LOB ("C_METADATAXML") STORE AS BASICFILE ( LOB ("C_COMMENT") STORE AS BASICFILE ( TABLESPACE "TRANSMART" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10 NOCACHE NOLOGGING ) ; - -- -- Type: INDEX; Owner: I2B2METADATA; Name: I2B2_INDX1 -- @@ -70,6 +69,12 @@ end; / ALTER TRIGGER "I2B2METADATA"."TRG_I2B2_ID" ENABLE; +-- +-- Type: INDEX; Owner: I2B2METADATA; Name: IDX_I2B2_FULLNAME_BASECODE +-- +CREATE INDEX "I2B2METADATA"."IDX_I2B2_FULLNAME_BASECODE" ON "I2B2METADATA"."I2B2" ("C_FULLNAME", "C_BASECODE") +TABLESPACE "TRANSMART" ; + -- -- Type: INDEX; Owner: I2B2METADATA; Name: META_APPLIED_PATH_I2B2_IDX -- diff --git a/ddl/oracle/i2b2metadata/items.json b/ddl/oracle/i2b2metadata/items.json index 450a170c..288732be 100644 --- a/ddl/oracle/i2b2metadata/items.json +++ b/ddl/oracle/i2b2metadata/items.json @@ -103,6 +103,17 @@ "owner" : "I2B2METADATA", "name" : "I2B2" } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "I2B2METADATA", + "name" : "IDX_I2B2_FULLNAME_BASECODE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "I2B2METADATA", + "name" : "I2B2" + } ] }, { "child" : { "type" : "INDEX", @@ -350,6 +361,13 @@ "name" : "I2B2_TRIAL_NODES" }, "file" : "i2b2metadata/views/i2b2_trial_nodes.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "I2B2METADATA", + "name" : "IDX_I2B2_FULLNAME_BASECODE" + }, + "file" : "i2b2metadata/i2b2.sql" }, { "item" : { "type" : "INDEX", @@ -477,4 +495,4 @@ }, "file" : "i2b2metadata/ont_process_status.sql" } ] -} +} \ No newline at end of file diff --git a/ddl/oracle/i2b2metadata/procedures/add_ontology_node.sql b/ddl/oracle/i2b2metadata/procedures/add_ontology_node.sql index 6eaf5e3e..e20fc4b5 100644 --- a/ddl/oracle/i2b2metadata/procedures/add_ontology_node.sql +++ b/ddl/oracle/i2b2metadata/procedures/add_ontology_node.sql @@ -95,7 +95,7 @@ begin ------------------------------------------------------------ -- add the new node into the i2b2 table ------------------------------------------------------------ - insert into i2b2metadata.i2b2( + insert into i2b2demodata.i2b2( C_HLEVEL, C_FULLNAME, C_NAME , C_SYNONYM_CD, C_VISUALATTRIBUTES, C_TOTALNUM , C_BASECODE, C_METADATAXML, C_FACTTABLECOLUMN @@ -114,5 +114,12 @@ begin commit; end; end; -/ + + + + + + + +/ From e9c3b1cc210ad85a4ab577abf7420c0d0b5390b5 Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Tue, 12 Aug 2014 10:57:54 +0100 Subject: [PATCH 23/31] update i2b2demodata from test server --- ddl/oracle/i2b2demodata/items.json | 54 ++++++++++++------- ddl/oracle/i2b2demodata/jms_transactions.sql | 8 +-- .../i2b2demodata/modifier_dimension.sql | 2 +- ddl/oracle/i2b2demodata/modifier_metadata.sql | 2 +- ddl/oracle/i2b2demodata/observation_fact.sql | 5 +- ddl/oracle/i2b2demodata/patient_dimension.sql | 7 ++- ddl/oracle/i2b2demodata/sample_dimension.sql | 14 ++--- ddl/oracle/i2b2demodata/upload_status.sql | 9 ++-- 8 files changed, 61 insertions(+), 40 deletions(-) diff --git a/ddl/oracle/i2b2demodata/items.json b/ddl/oracle/i2b2demodata/items.json index bc1563ec..14362891 100644 --- a/ddl/oracle/i2b2demodata/items.json +++ b/ddl/oracle/i2b2demodata/items.json @@ -337,6 +337,28 @@ "owner" : "I2B2DEMODATA", "name" : "OBSERVATION_FACT" } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "I2B2DEMODATA", + "name" : "IDX_OB_FACT_PATIENT_NUMBER" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "I2B2DEMODATA", + "name" : "OBSERVATION_FACT" + } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "I2B2DEMODATA", + "name" : "IDX_PD_SOURCESYSTEMCD_PNUM" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "I2B2DEMODATA", + "name" : "PATIENT_DIMENSION" + } ] }, { "child" : { "type" : "PROCEDURE", @@ -522,17 +544,6 @@ "name" : "OBSERVATION_FACT_BK" }, "parents" : [ ] - }, { - "child" : { - "type" : "INDEX", - "owner" : "I2B2DEMODATA", - "name" : "OBSERVATION_FACT_PD" - }, - "parents" : [ { - "type" : "TABLE", - "owner" : "I2B2DEMODATA", - "name" : "OBSERVATION_FACT" - } ] }, { "child" : { "type" : "TABLE", @@ -1688,6 +1699,20 @@ "name" : "IDX_OB_FACT_2" }, "file" : "i2b2demodata/observation_fact.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "I2B2DEMODATA", + "name" : "IDX_OB_FACT_PATIENT_NUMBER" + }, + "file" : "i2b2demodata/observation_fact.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "I2B2DEMODATA", + "name" : "IDX_PD_SOURCESYSTEMCD_PNUM" + }, + "file" : "i2b2demodata/patient_dimension.sql" }, { "item" : { "type" : "PROCEDURE", @@ -1849,13 +1874,6 @@ "name" : "OBSERVATION_FACT_BK" }, "file" : "i2b2demodata/observation_fact_bk.sql" - }, { - "item" : { - "type" : "INDEX", - "owner" : "I2B2DEMODATA", - "name" : "OBSERVATION_FACT_PD" - }, - "file" : "i2b2demodata/observation_fact.sql" }, { "item" : { "type" : "TABLE", diff --git a/ddl/oracle/i2b2demodata/jms_transactions.sql b/ddl/oracle/i2b2demodata/jms_transactions.sql index 8dbda32a..2ca3bec9 100644 --- a/ddl/oracle/i2b2demodata/jms_transactions.sql +++ b/ddl/oracle/i2b2demodata/jms_transactions.sql @@ -1,8 +1,8 @@ -- -- Type: TABLE; Owner: I2B2DEMODATA; Name: JMS_TRANSACTIONS -- -CREATE TABLE "I2B2DEMODATA"."JMS_TRANSACTIONS" - ( "TXID" NUMBER(*,0) - ) SEGMENT CREATION IMMEDIATE -TABLESPACE "TRANSMART" ; + CREATE TABLE "I2B2DEMODATA"."JMS_TRANSACTIONS" + ( "TXID" NUMBER(*,0) + ) SEGMENT CREATION IMMEDIATE + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/i2b2demodata/modifier_dimension.sql b/ddl/oracle/i2b2demodata/modifier_dimension.sql index e94a2a91..ad33e40c 100644 --- a/ddl/oracle/i2b2demodata/modifier_dimension.sql +++ b/ddl/oracle/i2b2demodata/modifier_dimension.sql @@ -16,7 +16,7 @@ CONSTRAINT "MODIFIER_DIMENSION_PK" PRIMARY KEY ("MODIFIER_PATH") USING INDEX TABLESPACE "TRANSMART" ENABLE - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" LOB ("MODIFIER_BLOB") STORE AS BASICFILE ( TABLESPACE "TRANSMART" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION diff --git a/ddl/oracle/i2b2demodata/modifier_metadata.sql b/ddl/oracle/i2b2demodata/modifier_metadata.sql index c61bb4b3..a1cb7f7b 100644 --- a/ddl/oracle/i2b2demodata/modifier_metadata.sql +++ b/ddl/oracle/i2b2demodata/modifier_metadata.sql @@ -6,6 +6,6 @@ "VALTYPE_CD" VARCHAR2(10 BYTE), "STD_UNITS" VARCHAR2(50 BYTE), "VISIT_IND" CHAR(1 BYTE) - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/i2b2demodata/observation_fact.sql b/ddl/oracle/i2b2demodata/observation_fact.sql index 6e2f2530..33e8c11a 100644 --- a/ddl/oracle/i2b2demodata/observation_fact.sql +++ b/ddl/oracle/i2b2demodata/observation_fact.sql @@ -33,7 +33,6 @@ LOB ("OBSERVATION_BLOB") STORE AS BASICFILE ( TABLESPACE "TRANSMART" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10 NOCACHE NOLOGGING ) ; - -- -- Type: INDEX; Owner: I2B2DEMODATA; Name: IDX_OB_FACT_2 -- @@ -67,8 +66,8 @@ CREATE SEQUENCE "I2B2DEMODATA"."SEQ_ENCOUNTER_NUM" MINVALUE 1 MAXVALUE 9999999 ALTER TRIGGER "I2B2DEMODATA"."TRG_ENCOUNTER_NUM" ENABLE; -- --- Type: INDEX; Owner: I2B2DEMODATA; Name: OBSERVATION_FACT_PD +-- Type: INDEX; Owner: I2B2DEMODATA; Name: IDX_OB_FACT_PATIENT_NUMBER -- -CREATE INDEX "I2B2DEMODATA"."OBSERVATION_FACT_PD" ON "I2B2DEMODATA"."OBSERVATION_FACT" ("PATIENT_NUM") +CREATE INDEX "I2B2DEMODATA"."IDX_OB_FACT_PATIENT_NUMBER" ON "I2B2DEMODATA"."OBSERVATION_FACT" ("PATIENT_NUM", "CONCEPT_CD") TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/i2b2demodata/patient_dimension.sql b/ddl/oracle/i2b2demodata/patient_dimension.sql index f21aa910..3a48599c 100644 --- a/ddl/oracle/i2b2demodata/patient_dimension.sql +++ b/ddl/oracle/i2b2demodata/patient_dimension.sql @@ -34,7 +34,6 @@ CREATE SEQUENCE "I2B2DEMODATA"."SEQ_PATIENT_NUM" MINVALUE 1 MAXVALUE 999999999 LOB ("PATIENT_BLOB") STORE AS BASICFILE ( TABLESPACE "TRANSMART" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10 NOCACHE NOLOGGING ) ; - -- -- Type: INDEX; Owner: I2B2DEMODATA; Name: PD_IDX_ALLPATIENTDIM -- @@ -57,3 +56,9 @@ select SEQ_PATIENT_NUM.nextval into :NEW."PATIENT_NUM" from dual; end if; / ALTER TRIGGER "I2B2DEMODATA"."TRG_PATIENT_DIMENSION" ENABLE; +-- +-- Type: INDEX; Owner: I2B2DEMODATA; Name: IDX_PD_SOURCESYSTEMCD_PNUM +-- +CREATE INDEX "I2B2DEMODATA"."IDX_PD_SOURCESYSTEMCD_PNUM" ON "I2B2DEMODATA"."PATIENT_DIMENSION" ("SOURCESYSTEM_CD", "PATIENT_NUM") +TABLESPACE "TRANSMART" ; + diff --git a/ddl/oracle/i2b2demodata/sample_dimension.sql b/ddl/oracle/i2b2demodata/sample_dimension.sql index e7266d14..78502239 100644 --- a/ddl/oracle/i2b2demodata/sample_dimension.sql +++ b/ddl/oracle/i2b2demodata/sample_dimension.sql @@ -1,11 +1,11 @@ -- -- Type: TABLE; Owner: I2B2DEMODATA; Name: SAMPLE_DIMENSION -- -CREATE TABLE "I2B2DEMODATA"."SAMPLE_DIMENSION" - ( "SAMPLE_CD" VARCHAR2(200 BYTE) NOT NULL ENABLE, -CONSTRAINT "SAMPLE_DIMENSION_PK" PRIMARY KEY ("SAMPLE_CD") -USING INDEX -TABLESPACE "TRANSMART" ENABLE - ) SEGMENT CREATION IMMEDIATE -TABLESPACE "TRANSMART" ; + CREATE TABLE "I2B2DEMODATA"."SAMPLE_DIMENSION" + ( "SAMPLE_CD" VARCHAR2(200 BYTE) NOT NULL ENABLE, + CONSTRAINT "SAMPLE_DIMENSION_PK" PRIMARY KEY ("SAMPLE_CD") + USING INDEX + TABLESPACE "TRANSMART" ENABLE + ) SEGMENT CREATION IMMEDIATE + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/i2b2demodata/upload_status.sql b/ddl/oracle/i2b2demodata/upload_status.sql index 5a9d91c2..cb325ee6 100644 --- a/ddl/oracle/i2b2demodata/upload_status.sql +++ b/ddl/oracle/i2b2demodata/upload_status.sql @@ -1,8 +1,3 @@ --- --- Type: SEQUENCE; Owner: I2B2DEMODATA; Name: SQ_UPLOADSTATUS_UPLOADID --- -CREATE SEQUENCE "I2B2DEMODATA"."SQ_UPLOADSTATUS_UPLOADID" MINVALUE 1 MAXVALUE 9999999999999 INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE ; - -- -- Type: TABLE; Owner: I2B2DEMODATA; Name: UPLOAD_STATUS -- @@ -35,6 +30,10 @@ LOB ("INPUT_FILE_NAME") STORE AS BASICFILE ( LOB ("LOG_FILE_NAME") STORE AS BASICFILE ( TABLESPACE "TRANSMART" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION NOCACHE LOGGING ) ; +-- +-- Type: SEQUENCE; Owner: I2B2DEMODATA; Name: SQ_UPLOADSTATUS_UPLOADID +-- +CREATE SEQUENCE "I2B2DEMODATA"."SQ_UPLOADSTATUS_UPLOADID" MINVALUE 1 MAXVALUE 9999999999999 INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE ; -- -- Type: TRIGGER; Owner: I2B2DEMODATA; Name: TRG_UPLOAD_STATUS_UPLOAD_ID From c95c970faf557f219a949eed234a4fe31c9e9f54 Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Tue, 12 Aug 2014 11:08:35 +0100 Subject: [PATCH 24/31] searchapp updates from oracle test server --- ddl/oracle/searchapp/_cross.sql | 13 ------ ddl/oracle/searchapp/_misc.sql | 12 +++--- ddl/oracle/searchapp/items.json | 42 ++++++++++++++++--- ddl/oracle/searchapp/saved_faceted_search.sql | 36 ++++++++-------- .../searchapp/search_auth_principal.sql | 21 +++++++++- .../search_auth_sec_object_access.sql | 24 +++++------ .../searchapp/search_auth_user_sec_access.sql | 12 +++--- ddl/oracle/searchapp/search_keyword.sql | 12 ++++++ ddl/oracle/searchapp/search_keyword_term.sql | 12 +++--- ddl/oracle/searchapp/search_taxonomy.sql | 4 +- ddl/oracle/searchapp/search_taxonomy_rels.sql | 26 ++++++------ ddl/oracle/searchapp/views/pathway_genes.sql | 11 +++++ .../views/search_bio_mkr_correl_fast_mv.sql | 3 +- 13 files changed, 146 insertions(+), 82 deletions(-) create mode 100644 ddl/oracle/searchapp/views/pathway_genes.sql diff --git a/ddl/oracle/searchapp/_cross.sql b/ddl/oracle/searchapp/_cross.sql index 0b1b4eb0..d976392a 100644 --- a/ddl/oracle/searchapp/_cross.sql +++ b/ddl/oracle/searchapp/_cross.sql @@ -40,16 +40,3 @@ FROM AND bada.bio_assay_feature_group_id = i.bio_assay_feature_group_id AND i.bio_assay_feature_group_id IS NOT NULL ); - --- --- Type: VIEW; Owner: SEARCHAPP; Name: PATHWAY_GENES --- - CREATE OR REPLACE FORCE VIEW "SEARCHAPP"."PATHWAY_GENES" ("GENE_KEYWORD_ID", "PATHWAY_KEYWORD_ID", "GENE_BIOMARKER_ID") AS - SELECT k_gene.search_keyword_id AS gene_keyword_id, - k_pathway.search_keyword_id AS pathway_keyword_id, - b.asso_bio_marker_id AS gene_biomarker_id - FROM searchapp.search_keyword k_pathway, - biomart.bio_marker_correl_mv b, - searchapp.search_keyword k_gene -WHERE ((((((b.correl_type) = 'PATHWAY_GENE') AND (b.bio_marker_id = k_pathway.bio_data_id)) AND ((k_pathway.data_category) = 'PATHWAY')) AND (b.asso_bio_marker_id = k_gene.bio_data_id)) AND ((k_gene.data_category) = 'GENE')); - diff --git a/ddl/oracle/searchapp/_misc.sql b/ddl/oracle/searchapp/_misc.sql index a9a0011b..69daa5b0 100644 --- a/ddl/oracle/searchapp/_misc.sql +++ b/ddl/oracle/searchapp/_misc.sql @@ -1,7 +1,7 @@ -- --- Type: SEQUENCE; Owner: SEARCHAPP; Name: PLUGIN_SEQ +-- Type: SEQUENCE; Owner: SEARCHAPP; Name: PLUGIN_MODULE_SEQ -- -CREATE SEQUENCE "SEARCHAPP"."PLUGIN_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ; +CREATE SEQUENCE "SEARCHAPP"."PLUGIN_MODULE_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ; -- -- Type: SEQUENCE; Owner: SEARCHAPP; Name: SEQ_SEARCH_DATA_ID @@ -9,12 +9,12 @@ CREATE SEQUENCE "SEARCHAPP"."PLUGIN_SEQ" MINVALUE 1 MAXVALUE 99999999999999999 CREATE SEQUENCE "SEARCHAPP"."SEQ_SEARCH_DATA_ID" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 3017276 CACHE 20 NOORDER NOCYCLE ; -- --- Type: SEQUENCE; Owner: SEARCHAPP; Name: PLUGIN_MODULE_SEQ +-- Type: SEQUENCE; Owner: SEARCHAPP; Name: HIBERNATE_SEQUENCE -- -CREATE SEQUENCE "SEARCHAPP"."PLUGIN_MODULE_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ; +CREATE SEQUENCE "SEARCHAPP"."HIBERNATE_SEQUENCE" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 100442 CACHE 20 NOORDER NOCYCLE ; -- --- Type: SEQUENCE; Owner: SEARCHAPP; Name: HIBERNATE_SEQUENCE +-- Type: SEQUENCE; Owner: SEARCHAPP; Name: PLUGIN_SEQ -- -CREATE SEQUENCE "SEARCHAPP"."HIBERNATE_SEQUENCE" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 100042 CACHE 20 NOORDER NOCYCLE ; +CREATE SEQUENCE "SEARCHAPP"."PLUGIN_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ; diff --git a/ddl/oracle/searchapp/items.json b/ddl/oracle/searchapp/items.json index 7f103372..482f8d1a 100644 --- a/ddl/oracle/searchapp/items.json +++ b/ddl/oracle/searchapp/items.json @@ -119,6 +119,17 @@ "name" : "HIBERNATE_SEQUENCE" }, "parents" : [ ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "SEARCHAPP", + "name" : "IDX_SK_DISPLAY_CATEGORY1" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "SEARCHAPP", + "name" : "SEARCH_KEYWORD" + } ] }, { "child" : { "type" : "VIEW", @@ -152,10 +163,6 @@ "name" : "PATHWAY_GENES" }, "parents" : [ { - "type" : "TABLE", - "owner" : "BIOMART", - "name" : "BIO_MARKER_CORREL_MV" - }, { "type" : "TABLE", "owner" : "SEARCHAPP", "name" : "SEARCH_KEYWORD" @@ -246,6 +253,17 @@ "owner" : "SEARCHAPP", "name" : "SAVED_FACETED_SEARCH" } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "SEARCHAPP", + "name" : "SCH_KWD_DT_CAT_IDX" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "SEARCHAPP", + "name" : "SEARCH_KEYWORD" + } ] }, { "child" : { "type" : "REF_CONSTRAINT", @@ -1194,6 +1212,13 @@ "name" : "HIBERNATE_SEQUENCE" }, "file" : "searchapp/_misc.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "SEARCHAPP", + "name" : "IDX_SK_DISPLAY_CATEGORY1" + }, + "file" : "searchapp/search_keyword.sql" }, { "item" : { "type" : "VIEW", @@ -1214,7 +1239,7 @@ "owner" : "SEARCHAPP", "name" : "PATHWAY_GENES" }, - "file" : "searchapp/_cross.sql" + "file" : "searchapp/views/pathway_genes.sql" }, { "item" : { "type" : "TABLE", @@ -1285,6 +1310,13 @@ "name" : "SAVED_FACETED_SEARCH_USER_ID" }, "file" : "searchapp/saved_faceted_search.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "SEARCHAPP", + "name" : "SCH_KWD_DT_CAT_IDX" + }, + "file" : "searchapp/search_keyword.sql" }, { "item" : { "type" : "REF_CONSTRAINT", diff --git a/ddl/oracle/searchapp/saved_faceted_search.sql b/ddl/oracle/searchapp/saved_faceted_search.sql index 4cddba44..1fed4cc1 100644 --- a/ddl/oracle/searchapp/saved_faceted_search.sql +++ b/ddl/oracle/searchapp/saved_faceted_search.sql @@ -1,8 +1,3 @@ --- --- Type: SEQUENCE; Owner: SEARCHAPP; Name: SEQ_SAVED_FACETED_SEARCH_ID --- -CREATE SEQUENCE "SEARCHAPP"."SEQ_SAVED_FACETED_SEARCH_ID" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 278 CACHE 20 NOORDER NOCYCLE ; - -- -- Type: TABLE; Owner: SEARCHAPP; Name: SAVED_FACETED_SEARCH -- @@ -25,20 +20,10 @@ CREATE SEQUENCE "SEARCHAPP"."SEQ_SAVED_FACETED_SEARCH_ID" MINVALUE 1 MAXVALUE TABLESPACE "TRANSMART" ; -- --- Type: TRIGGER; Owner: SEARCHAPP; Name: TRG_UPD_SAVED_FACETED_SEARCH +-- Type: SEQUENCE; Owner: SEARCHAPP; Name: SEQ_SAVED_FACETED_SEARCH_ID -- - CREATE OR REPLACE TRIGGER "SEARCHAPP"."TRG_UPD_SAVED_FACETED_SEARCH" -before insert on searchapp.saved_faceted_search -for each row begin - if inserting then - if :NEW.modified_dt is null then - :NEW.modified_dt := sysdate; - end if; - end if; -end; -/ -ALTER TRIGGER "SEARCHAPP"."TRG_UPD_SAVED_FACETED_SEARCH" ENABLE; - +CREATE SEQUENCE "SEARCHAPP"."SEQ_SAVED_FACETED_SEARCH_ID" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 278 CACHE 20 NOORDER NOCYCLE ; + -- -- Type: TRIGGER; Owner: SEARCHAPP; Name: TRG_SAVED_FACETED_SEARCH_ID -- @@ -60,3 +45,18 @@ ALTER TRIGGER "SEARCHAPP"."TRG_SAVED_FACETED_SEARCH_ID" ENABLE; ALTER TABLE "SEARCHAPP"."SAVED_FACETED_SEARCH" ADD CONSTRAINT "SAVED_FACETED_SEARCH_USER_ID" FOREIGN KEY ("USER_ID") REFERENCES "SEARCHAPP"."SEARCH_AUTH_USER" ("ID") ENABLE; +-- +-- Type: TRIGGER; Owner: SEARCHAPP; Name: TRG_UPD_SAVED_FACETED_SEARCH +-- + CREATE OR REPLACE TRIGGER "SEARCHAPP"."TRG_UPD_SAVED_FACETED_SEARCH" +before insert on searchapp.saved_faceted_search +for each row begin + if inserting then + if :NEW.modified_dt is null then + NEW.modified_dt = sysdate; + end if; + end if; +end; +/ +ALTER TRIGGER "SEARCHAPP"."TRG_UPD_SAVED_FACETED_SEARCH" ENABLE; + diff --git a/ddl/oracle/searchapp/search_auth_principal.sql b/ddl/oracle/searchapp/search_auth_principal.sql index f90ecad7..7886b69a 100644 --- a/ddl/oracle/searchapp/search_auth_principal.sql +++ b/ddl/oracle/searchapp/search_auth_principal.sql @@ -14,5 +14,24 @@ USING INDEX TABLESPACE "TRANSMART" ENABLE ) SEGMENT CREATION IMMEDIATE - TABLESPACE "TRANSMART" ; + TABLESPACE "TRANSMART" ; +-- +-- Type: TRIGGER; Owner: SEARCHAPP; Name: TRG_SEARCH_AU_PRCPL_ID +-- + CREATE OR REPLACE TRIGGER "SEARCHAPP"."TRG_SEARCH_AU_PRCPL_ID" + before insert on SEARCH_AUTH_PRINCIPAL + for each row begin + if inserting then + if(:NEW.ID is null or :NEW.ID = -2000) then + select SEQ_SEARCH_DATA_ID.nextval into :NEW.ID from dual; + end if; end if; end; + + + + + + +/ +ALTER TRIGGER "SEARCHAPP"."TRG_SEARCH_AU_PRCPL_ID" ENABLE; + diff --git a/ddl/oracle/searchapp/search_auth_sec_object_access.sql b/ddl/oracle/searchapp/search_auth_sec_object_access.sql index 31759d86..8f86e156 100644 --- a/ddl/oracle/searchapp/search_auth_sec_object_access.sql +++ b/ddl/oracle/searchapp/search_auth_sec_object_access.sql @@ -12,18 +12,24 @@ ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; --- --- Type: REF_CONSTRAINT; Owner: SEARCHAPP; Name: SCH_SEC_S_A_L_FK --- -ALTER TABLE "SEARCHAPP"."SEARCH_AUTH_SEC_OBJECT_ACCESS" ADD CONSTRAINT "SCH_SEC_S_A_L_FK" FOREIGN KEY ("SECURE_ACCESS_LEVEL_ID") - REFERENCES "SEARCHAPP"."SEARCH_SEC_ACCESS_LEVEL" ("SEARCH_SEC_ACCESS_LEVEL_ID") ENABLE; - -- -- Type: REF_CONSTRAINT; Owner: SEARCHAPP; Name: SCH_SEC_S_O_FK -- ALTER TABLE "SEARCHAPP"."SEARCH_AUTH_SEC_OBJECT_ACCESS" ADD CONSTRAINT "SCH_SEC_S_O_FK" FOREIGN KEY ("SECURE_OBJECT_ID") REFERENCES "SEARCHAPP"."SEARCH_SECURE_OBJECT" ("SEARCH_SECURE_OBJECT_ID") ENABLE; +-- +-- Type: REF_CONSTRAINT; Owner: SEARCHAPP; Name: SCH_SEC_A_U_FK +-- +ALTER TABLE "SEARCHAPP"."SEARCH_AUTH_SEC_OBJECT_ACCESS" ADD CONSTRAINT "SCH_SEC_A_U_FK" FOREIGN KEY ("AUTH_PRINCIPAL_ID") + REFERENCES "SEARCHAPP"."SEARCH_AUTH_PRINCIPAL" ("ID") ENABLE; + +-- +-- Type: REF_CONSTRAINT; Owner: SEARCHAPP; Name: SCH_SEC_S_A_L_FK +-- +ALTER TABLE "SEARCHAPP"."SEARCH_AUTH_SEC_OBJECT_ACCESS" ADD CONSTRAINT "SCH_SEC_S_A_L_FK" FOREIGN KEY ("SECURE_ACCESS_LEVEL_ID") + REFERENCES "SEARCHAPP"."SEARCH_SEC_ACCESS_LEVEL" ("SEARCH_SEC_ACCESS_LEVEL_ID") ENABLE; + -- -- Type: TRIGGER; Owner: SEARCHAPP; Name: TRG_SEARCH_AU_OBJ_ACCESS_ID -- @@ -37,9 +43,3 @@ ALTER TABLE "SEARCHAPP"."SEARCH_AUTH_SEC_OBJECT_ACCESS" ADD CONSTRAINT "SCH_SEC_ / ALTER TRIGGER "SEARCHAPP"."TRG_SEARCH_AU_OBJ_ACCESS_ID" ENABLE; --- --- Type: REF_CONSTRAINT; Owner: SEARCHAPP; Name: SCH_SEC_A_U_FK --- -ALTER TABLE "SEARCHAPP"."SEARCH_AUTH_SEC_OBJECT_ACCESS" ADD CONSTRAINT "SCH_SEC_A_U_FK" FOREIGN KEY ("AUTH_PRINCIPAL_ID") - REFERENCES "SEARCHAPP"."SEARCH_AUTH_PRINCIPAL" ("ID") ENABLE; - diff --git a/ddl/oracle/searchapp/search_auth_user_sec_access.sql b/ddl/oracle/searchapp/search_auth_user_sec_access.sql index 7c4249a2..3b4c7372 100644 --- a/ddl/oracle/searchapp/search_auth_user_sec_access.sql +++ b/ddl/oracle/searchapp/search_auth_user_sec_access.sql @@ -18,6 +18,12 @@ ALTER TABLE "SEARCHAPP"."SEARCH_AUTH_USER_SEC_ACCESS" ADD CONSTRAINT "SEARCH_SEC_S_A_L_FK" FOREIGN KEY ("SEARCH_SEC_ACCESS_LEVEL_ID") REFERENCES "SEARCHAPP"."SEARCH_SEC_ACCESS_LEVEL" ("SEARCH_SEC_ACCESS_LEVEL_ID") ENABLE; +-- +-- Type: REF_CONSTRAINT; Owner: SEARCHAPP; Name: SEARCH_SEC_S_O_FK +-- +ALTER TABLE "SEARCHAPP"."SEARCH_AUTH_USER_SEC_ACCESS" ADD CONSTRAINT "SEARCH_SEC_S_O_FK" FOREIGN KEY ("SEARCH_SECURE_OBJECT_ID") + REFERENCES "SEARCHAPP"."SEARCH_SECURE_OBJECT" ("SEARCH_SECURE_OBJECT_ID") ENABLE; + -- -- Type: TRIGGER; Owner: SEARCHAPP; Name: TRG_SEARCH_A_U_SEC_ACCESS_ID -- @@ -35,12 +41,6 @@ ALTER TABLE "SEARCHAPP"."SEARCH_AUTH_USER_SEC_ACCESS" ADD CONSTRAINT "SEARCH_SEC / ALTER TRIGGER "SEARCHAPP"."TRG_SEARCH_A_U_SEC_ACCESS_ID" ENABLE; --- --- Type: REF_CONSTRAINT; Owner: SEARCHAPP; Name: SEARCH_SEC_S_O_FK --- -ALTER TABLE "SEARCHAPP"."SEARCH_AUTH_USER_SEC_ACCESS" ADD CONSTRAINT "SEARCH_SEC_S_O_FK" FOREIGN KEY ("SEARCH_SECURE_OBJECT_ID") - REFERENCES "SEARCHAPP"."SEARCH_SECURE_OBJECT" ("SEARCH_SECURE_OBJECT_ID") ENABLE; - -- -- Type: REF_CONSTRAINT; Owner: SEARCHAPP; Name: SEARCH_SEC_A_U_FK -- diff --git a/ddl/oracle/searchapp/search_keyword.sql b/ddl/oracle/searchapp/search_keyword.sql index c6f52058..a0b1cd35 100644 --- a/ddl/oracle/searchapp/search_keyword.sql +++ b/ddl/oracle/searchapp/search_keyword.sql @@ -19,6 +19,18 @@ ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; +-- +-- Type: INDEX; Owner: SEARCHAPP; Name: SCH_KWD_DT_CAT_IDX +-- +CREATE INDEX "SEARCHAPP"."SCH_KWD_DT_CAT_IDX" ON "SEARCHAPP"."SEARCH_KEYWORD" ("DATA_CATEGORY") +TABLESPACE "INDX" ; + +-- +-- Type: INDEX; Owner: SEARCHAPP; Name: IDX_SK_DISPLAY_CATEGORY1 +-- +CREATE BITMAP INDEX "SEARCHAPP"."IDX_SK_DISPLAY_CATEGORY1" ON "SEARCHAPP"."SEARCH_KEYWORD" ("DATA_CATEGORY", "DISPLAY_DATA_CATEGORY") +TABLESPACE "INDX" +PARALLEL ; -- -- Type: INDEX; Owner: SEARCHAPP; Name: SEARCH_KEYWORD_INDEX3 -- diff --git a/ddl/oracle/searchapp/search_keyword_term.sql b/ddl/oracle/searchapp/search_keyword_term.sql index 940c1d80..a4f5c9fd 100644 --- a/ddl/oracle/searchapp/search_keyword_term.sql +++ b/ddl/oracle/searchapp/search_keyword_term.sql @@ -14,6 +14,12 @@ ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; +-- +-- Type: INDEX; Owner: SEARCHAPP; Name: SEARCH_KW_TERM_SKID_IDX +-- +CREATE INDEX "SEARCHAPP"."SEARCH_KW_TERM_SKID_IDX" ON "SEARCHAPP"."SEARCH_KEYWORD_TERM" ("SEARCH_KEYWORD_ID") +TABLESPACE "TRANSMART" ; + -- -- Type: TRIGGER; Owner: SEARCHAPP; Name: TRG_SEARCH_KEYWORD_TERM_ID -- @@ -29,12 +35,6 @@ / ALTER TRIGGER "SEARCHAPP"."TRG_SEARCH_KEYWORD_TERM_ID" ENABLE; --- --- Type: INDEX; Owner: SEARCHAPP; Name: SEARCH_KW_TERM_SKID_IDX --- -CREATE INDEX "SEARCHAPP"."SEARCH_KW_TERM_SKID_IDX" ON "SEARCHAPP"."SEARCH_KEYWORD_TERM" ("SEARCH_KEYWORD_ID") -TABLESPACE "TRANSMART" ; - -- -- Type: REF_CONSTRAINT; Owner: SEARCHAPP; Name: SEARCH_KW_FK -- diff --git a/ddl/oracle/searchapp/search_taxonomy.sql b/ddl/oracle/searchapp/search_taxonomy.sql index ca3591cd..05448a2e 100644 --- a/ddl/oracle/searchapp/search_taxonomy.sql +++ b/ddl/oracle/searchapp/search_taxonomy.sql @@ -10,15 +10,17 @@ CONSTRAINT "SEARCH_TAXONOMY_PK" PRIMARY KEY ("TERM_ID") USING INDEX TABLESPACE "TRANSMART" ENABLE - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; + -- -- Type: REF_CONSTRAINT; Owner: SEARCHAPP; Name: FK_SEARCH_TAX_SEARCH_KEYWORD -- ALTER TABLE "SEARCHAPP"."SEARCH_TAXONOMY" ADD CONSTRAINT "FK_SEARCH_TAX_SEARCH_KEYWORD" FOREIGN KEY ("SEARCH_KEYWORD_ID") REFERENCES "SEARCHAPP"."SEARCH_KEYWORD" ("SEARCH_KEYWORD_ID") ENABLE; + -- -- Type: TRIGGER; Owner: SEARCHAPP; Name: TRG_SEARCH_TAXONOMY_TERM_ID -- diff --git a/ddl/oracle/searchapp/search_taxonomy_rels.sql b/ddl/oracle/searchapp/search_taxonomy_rels.sql index 5621819f..c75b8800 100644 --- a/ddl/oracle/searchapp/search_taxonomy_rels.sql +++ b/ddl/oracle/searchapp/search_taxonomy_rels.sql @@ -11,9 +11,21 @@ CONSTRAINT "U_CHILD_ID_PARENT_ID" UNIQUE ("CHILD_ID", "PARENT_ID") USING INDEX TABLESPACE "TRANSMART" ENABLE - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; +-- +-- Type: REF_CONSTRAINT; Owner: SEARCHAPP; Name: FK_SEARCH_TAX_RELS_PARENT +-- +ALTER TABLE "SEARCHAPP"."SEARCH_TAXONOMY_RELS" ADD CONSTRAINT "FK_SEARCH_TAX_RELS_PARENT" FOREIGN KEY ("PARENT_ID") + REFERENCES "SEARCHAPP"."SEARCH_TAXONOMY" ("TERM_ID") ENABLE; + +-- +-- Type: REF_CONSTRAINT; Owner: SEARCHAPP; Name: FK_SEARCH_TAX_RELS_CHILD +-- +ALTER TABLE "SEARCHAPP"."SEARCH_TAXONOMY_RELS" ADD CONSTRAINT "FK_SEARCH_TAX_RELS_CHILD" FOREIGN KEY ("CHILD_ID") + REFERENCES "SEARCHAPP"."SEARCH_TAXONOMY" ("TERM_ID") ENABLE; + -- -- Type: TRIGGER; Owner: SEARCHAPP; Name: TRG_SEARCH_TAXONOMY_RELS_ID -- @@ -29,15 +41,3 @@ end; / ALTER TRIGGER "SEARCHAPP"."TRG_SEARCH_TAXONOMY_RELS_ID" ENABLE; --- --- Type: REF_CONSTRAINT; Owner: SEARCHAPP; Name: FK_SEARCH_TAX_RELS_PARENT --- -ALTER TABLE "SEARCHAPP"."SEARCH_TAXONOMY_RELS" ADD CONSTRAINT "FK_SEARCH_TAX_RELS_PARENT" FOREIGN KEY ("PARENT_ID") - REFERENCES "SEARCHAPP"."SEARCH_TAXONOMY" ("TERM_ID") ENABLE; - --- --- Type: REF_CONSTRAINT; Owner: SEARCHAPP; Name: FK_SEARCH_TAX_RELS_CHILD --- -ALTER TABLE "SEARCHAPP"."SEARCH_TAXONOMY_RELS" ADD CONSTRAINT "FK_SEARCH_TAX_RELS_CHILD" FOREIGN KEY ("CHILD_ID") - REFERENCES "SEARCHAPP"."SEARCH_TAXONOMY" ("TERM_ID") ENABLE; - diff --git a/ddl/oracle/searchapp/views/pathway_genes.sql b/ddl/oracle/searchapp/views/pathway_genes.sql new file mode 100644 index 00000000..a28693eb --- /dev/null +++ b/ddl/oracle/searchapp/views/pathway_genes.sql @@ -0,0 +1,11 @@ +-- +-- Type: VIEW; Owner: SEARCHAPP; Name: PATHWAY_GENES +-- + CREATE OR REPLACE FORCE EDITIONABLE VIEW "SEARCHAPP"."PATHWAY_GENES" ("GENE_KEYWORD_ID", "PATHWAY_KEYWORD_ID", "GENE_BIOMARKER_ID") AS + SELECT k_gene.search_keyword_id AS gene_keyword_id, + k_pathway.search_keyword_id AS pathway_keyword_id, + b.asso_bio_marker_id AS gene_biomarker_id + FROM searchapp.search_keyword k_pathway, + biomart.bio_marker_correl_mv b, + searchapp.search_keyword k_gene +WHERE ((((((b.correl_type) = 'PATHWAY_GENE') AND (b.bio_marker_id = k_pathway.bio_data_id)) AND ((k_pathway.data_category) = 'PATHWAY')) AND (b.asso_bio_marker_id = k_gene.bio_data_id)) AND ((k_gene.data_category) = 'GENE')); diff --git a/ddl/oracle/searchapp/views/search_bio_mkr_correl_fast_mv.sql b/ddl/oracle/searchapp/views/search_bio_mkr_correl_fast_mv.sql index f13d4132..35d8c16c 100644 --- a/ddl/oracle/searchapp/views/search_bio_mkr_correl_fast_mv.sql +++ b/ddl/oracle/searchapp/views/search_bio_mkr_correl_fast_mv.sql @@ -2,7 +2,8 @@ -- Type: MATERIALIZED_VIEW; Owner: SEARCHAPP; Name: SEARCH_BIO_MKR_CORREL_FAST_MV -- CREATE MATERIALIZED VIEW "SEARCHAPP"."SEARCH_BIO_MKR_CORREL_FAST_MV" ("DOMAIN_OBJECT_ID", "ASSO_BIO_MARKER_ID", "CORREL_TYPE", "VALUE_METRIC", "MV_ID") - ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS NOLOGGING + ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 + NOCOMPRESS NOLOGGING TABLESPACE "TRANSMART" BUILD IMMEDIATE USING INDEX From 2dd60474c3f062bf3c05f33df038906b86c49e0a Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Tue, 12 Aug 2014 11:11:00 +0100 Subject: [PATCH 25/31] deapp updates from oracle test server --- ddl/oracle/deapp/de_chromosomal_region.sql | 2 +- ddl/oracle/deapp/de_encounter_level.sql | 2 +- ddl/oracle/deapp/de_encounter_type.sql | 2 +- ddl/oracle/deapp/de_gene_info.sql | 46 ++++ ddl/oracle/deapp/de_gene_source.sql | 36 ++++ ddl/oracle/deapp/de_rc_snp_info.sql | 5 +- ddl/oracle/deapp/de_snp_calls_by_gsm.sql | 11 +- ddl/oracle/deapp/de_snp_copy_number.sql | 11 +- ddl/oracle/deapp/de_snp_gene_map.sql | 12 ++ ddl/oracle/deapp/de_subject_acgh_data.sql | 4 +- .../deapp/de_subject_microarray_data.sql | 37 ++-- .../deapp/de_subject_microarray_data_new.sql | 7 +- .../deapp/de_subject_microarray_logs.sql | 4 +- ddl/oracle/deapp/de_subject_rnaseq_data.sql | 4 +- .../deapp/de_subject_sample_mapping.sql | 6 + ddl/oracle/deapp/de_variant_dataset.sql | 3 +- ddl/oracle/deapp/de_variant_metadata.sql | 3 +- .../deapp/de_variant_population_data.sql | 4 +- .../deapp/de_variant_population_info.sql | 4 +- .../deapp/de_variant_subject_detail.sql | 9 +- ddl/oracle/deapp/de_variant_subject_idx.sql | 2 +- .../deapp/de_variant_subject_summary.sql | 2 +- ddl/oracle/deapp/items.json | 196 +++++++++++++++++- ddl/oracle/deapp/kegg_def.sql | 4 +- 24 files changed, 356 insertions(+), 60 deletions(-) create mode 100644 ddl/oracle/deapp/de_gene_info.sql create mode 100644 ddl/oracle/deapp/de_gene_source.sql diff --git a/ddl/oracle/deapp/de_chromosomal_region.sql b/ddl/oracle/deapp/de_chromosomal_region.sql index 8803ee33..2903edff 100644 --- a/ddl/oracle/deapp/de_chromosomal_region.sql +++ b/ddl/oracle/deapp/de_chromosomal_region.sql @@ -16,7 +16,7 @@ CONSTRAINT "DE_CHROMOSOMAL_REGION_PKEY" PRIMARY KEY ("REGION_ID") USING INDEX TABLESPACE "TRANSMART" ENABLE - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; -- diff --git a/ddl/oracle/deapp/de_encounter_level.sql b/ddl/oracle/deapp/de_encounter_level.sql index 4b7fa431..fd84d35f 100644 --- a/ddl/oracle/deapp/de_encounter_level.sql +++ b/ddl/oracle/deapp/de_encounter_level.sql @@ -5,6 +5,6 @@ ( "STUDY_ID" VARCHAR2(50 BYTE), "CONCEPT_ID" VARCHAR2(500 BYTE), "LINK_TYPE" VARCHAR2(50 BYTE) - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/deapp/de_encounter_type.sql b/ddl/oracle/deapp/de_encounter_type.sql index 3704d88a..886248c5 100644 --- a/ddl/oracle/deapp/de_encounter_type.sql +++ b/ddl/oracle/deapp/de_encounter_type.sql @@ -6,6 +6,6 @@ "LINK_TYPE" VARCHAR2(50 BYTE), "LINK_VALUE" VARCHAR2(200 BYTE), "ENCOUNTER_NUM" NUMBER(38,0) - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/deapp/de_gene_info.sql b/ddl/oracle/deapp/de_gene_info.sql new file mode 100644 index 00000000..59269241 --- /dev/null +++ b/ddl/oracle/deapp/de_gene_info.sql @@ -0,0 +1,46 @@ +-- +-- Type: TABLE; Owner: DEAPP; Name: DE_GENE_INFO +-- + CREATE TABLE "DEAPP"."DE_GENE_INFO" + ( "GENE_INFO_ID" NUMBER(22,0), +"GENE_SOURCE_ID" NUMBER(5,0) NOT NULL ENABLE, +"ENTREZ_ID" NUMBER(10,0), +"GENE_SYMBOL" VARCHAR2(255 BYTE) NOT NULL ENABLE, +"GENE_NAME" VARCHAR2(255 BYTE), +"CHROM" VARCHAR2(16 BYTE) NOT NULL ENABLE, +"CHROM_START" NUMBER, +"CHROM_STOP" NUMBER, +"STRAND" NUMBER(2,0), + UNIQUE ("GENE_SOURCE_ID", "GENE_SYMBOL") + USING INDEX + TABLESPACE "TRANSMART" ENABLE, + PRIMARY KEY ("GENE_INFO_ID") + USING INDEX + TABLESPACE "TRANSMART" ENABLE + ) SEGMENT CREATION IMMEDIATE +NOCOMPRESS NOLOGGING + TABLESPACE "TRANSMART" ; + +-- +-- Type: REF_CONSTRAINT; Owner: DEAPP; Name: SYS_C0029766 +-- +ALTER TABLE "DEAPP"."DE_GENE_INFO" ADD FOREIGN KEY ("GENE_SOURCE_ID") + REFERENCES "DEAPP"."DE_GENE_SOURCE" ("GENE_SOURCE_ID") ON DELETE CASCADE ENABLE; + +-- +-- Type: TRIGGER; Owner: DEAPP; Name: TRG_DE_GENE_INFO_ID +-- + CREATE OR REPLACE TRIGGER "DEAPP"."TRG_DE_GENE_INFO_ID" +BEFORE + INSERT ON DEAPP.DE_GENE_INFO FOR EACH ROW +BEGIN + IF inserting THEN + IF :NEW.GENE_INFO_ID IS NULL THEN + SELECT DEAPP.SEQ_GENE_INFO_ID.nextval INTO :NEW.GENE_INFO_ID FROM dual; + END IF; + END IF; +END; + +/ +ALTER TRIGGER "DEAPP"."TRG_DE_GENE_INFO_ID" ENABLE; + diff --git a/ddl/oracle/deapp/de_gene_source.sql b/ddl/oracle/deapp/de_gene_source.sql new file mode 100644 index 00000000..68b01ad6 --- /dev/null +++ b/ddl/oracle/deapp/de_gene_source.sql @@ -0,0 +1,36 @@ +-- +-- Type: TABLE; Owner: DEAPP; Name: DE_GENE_SOURCE +-- + CREATE TABLE "DEAPP"."DE_GENE_SOURCE" + ( "GENE_SOURCE_ID" NUMBER(5,0), +"GENE_SOURCE_NAME" VARCHAR2(255 BYTE) NOT NULL ENABLE, +"VERSION" VARCHAR2(32 BYTE), +"RELEASE_DATE" DATE, +"URL" VARCHAR2(255 BYTE), + UNIQUE ("GENE_SOURCE_NAME") + USING INDEX + TABLESPACE "TRANSMART" ENABLE, + PRIMARY KEY ("GENE_SOURCE_ID") + USING INDEX + TABLESPACE "TRANSMART" ENABLE + ) SEGMENT CREATION IMMEDIATE +NOCOMPRESS NOLOGGING + TABLESPACE "TRANSMART" ; + +-- +-- Type: TRIGGER; Owner: DEAPP; Name: TRG_DE_GENE_SOURCE_ID +-- + CREATE OR REPLACE TRIGGER "DEAPP"."TRG_DE_GENE_SOURCE_ID" +BEFORE + INSERT ON DEAPP.DE_GENE_SOURCE FOR EACH ROW +BEGIN + IF inserting THEN + IF :NEW.GENE_SOURCE_ID IS NULL THEN + SELECT DEAPP.SEQ_GENE_SOURCE_ID.nextval INTO :NEW.GENE_SOURCE_ID FROM dual; + END IF; + END IF; +END; + +/ +ALTER TRIGGER "DEAPP"."TRG_DE_GENE_SOURCE_ID" ENABLE; + diff --git a/ddl/oracle/deapp/de_rc_snp_info.sql b/ddl/oracle/deapp/de_rc_snp_info.sql index 7b824371..7e24d62c 100644 --- a/ddl/oracle/deapp/de_rc_snp_info.sql +++ b/ddl/oracle/deapp/de_rc_snp_info.sql @@ -32,8 +32,9 @@ CREATE SEQUENCE "DEAPP"."DE_RC_SNP_INFO_SEQ" MINVALUE 1 MAXVALUE 9999999999999 "ENTREZ_ID" VARCHAR2(50 BYTE), "RECOMBINATION_RATE" NUMBER(18,6), "RECOMBINATION_MAP" NUMBER(18,6), -"REGULOME_SCORE" VARCHAR2(10 BYTE) - ) SEGMENT CREATION DEFERRED +"REGULOME_SCORE" VARCHAR2(10 BYTE), +"EXON_INTRON" VARCHAR2(10 BYTE) + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; -- diff --git a/ddl/oracle/deapp/de_snp_calls_by_gsm.sql b/ddl/oracle/deapp/de_snp_calls_by_gsm.sql index a2eb6419..b93298cd 100644 --- a/ddl/oracle/deapp/de_snp_calls_by_gsm.sql +++ b/ddl/oracle/deapp/de_snp_calls_by_gsm.sql @@ -9,15 +9,14 @@ "SNP_CALLS" VARCHAR2(4 BYTE) ) TABLESPACE "TRANSMART" - PARTITION BY LIST ("PATIENT_NUM") -(PARTITION "NULL_PARTITION" VALUES (NULL) - TABLESPACE "TRANSMART" NOCOMPRESS ) ; - + PARTITION BY HASH ("PATIENT_NUM") +(PARTITION "SYS_P387" SEGMENT CREATION DEFERRED + TABLESPACE "TRANSMART" +NOCOMPRESS ) ; -- -- Type: INDEX; Owner: DEAPP; Name: IDX_SNP_CALLS_BY_GSM_PG -- CREATE BITMAP INDEX "DEAPP"."IDX_SNP_CALLS_BY_GSM_PG" ON "DEAPP"."DE_SNP_CALLS_BY_GSM" ("PATIENT_NUM", "GSM_NUM") LOCAL -(PARTITION "NULL_PARTITION" +(PARTITION "SYS_P388" TABLESPACE "TRANSMART" ) ; - diff --git a/ddl/oracle/deapp/de_snp_copy_number.sql b/ddl/oracle/deapp/de_snp_copy_number.sql index 75a8ece5..c41475b8 100644 --- a/ddl/oracle/deapp/de_snp_copy_number.sql +++ b/ddl/oracle/deapp/de_snp_copy_number.sql @@ -10,15 +10,14 @@ "COPY_NUMBER" NUMBER(2,0) ) TABLESPACE "TRANSMART" - PARTITION BY LIST ("PATIENT_NUM") -(PARTITION "NULL_PARTITION" VALUES (NULL) - TABLESPACE "TRANSMART" NOCOMPRESS ) ; - + PARTITION BY HASH ("PATIENT_NUM") +(PARTITION "SYS_P389" SEGMENT CREATION DEFERRED + TABLESPACE "TRANSMART" +NOCOMPRESS ) ; -- -- Type: INDEX; Owner: DEAPP; Name: IDX_SNP_COPY_NUMBER_PS -- CREATE BITMAP INDEX "DEAPP"."IDX_SNP_COPY_NUMBER_PS" ON "DEAPP"."DE_SNP_COPY_NUMBER" ("PATIENT_NUM", "SNP_NAME") LOCAL -(PARTITION "NULL_PARTITION" +(PARTITION "SYS_P390" TABLESPACE "TRANSMART" ) ; - diff --git a/ddl/oracle/deapp/de_snp_gene_map.sql b/ddl/oracle/deapp/de_snp_gene_map.sql index 35486282..93dfa165 100644 --- a/ddl/oracle/deapp/de_snp_gene_map.sql +++ b/ddl/oracle/deapp/de_snp_gene_map.sql @@ -8,6 +8,18 @@ ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; +-- +-- Type: INDEX; Owner: DEAPP; Name: SNP_NAME_IDX1 +-- +CREATE INDEX "DEAPP"."SNP_NAME_IDX1" ON "DEAPP"."DE_SNP_GENE_MAP" ("SNP_NAME") +TABLESPACE "INDX" ; + +-- +-- Type: INDEX; Owner: DEAPP; Name: ENTREZ_IDX1 +-- +CREATE INDEX "DEAPP"."ENTREZ_IDX1" ON "DEAPP"."DE_SNP_GENE_MAP" ("ENTREZ_GENE_ID") +TABLESPACE "INDX" ; + -- -- Type: REF_CONSTRAINT; Owner: DEAPP; Name: FK_SNP_GENE_MAP_SNP_ID -- diff --git a/ddl/oracle/deapp/de_subject_acgh_data.sql b/ddl/oracle/deapp/de_subject_acgh_data.sql index 718403b1..4191eb8c 100644 --- a/ddl/oracle/deapp/de_subject_acgh_data.sql +++ b/ddl/oracle/deapp/de_subject_acgh_data.sql @@ -13,11 +13,11 @@ "PROBNORM" FLOAT(126), "PROBGAIN" FLOAT(126), "PROBAMP" FLOAT(126), -"PARTITION_ID" NUMBER(*,0), +"TRIAL_SOURCE" VARCHAR2(200 BYTE), CONSTRAINT "DE_SUBJECT_ACGH_DATA_PKEY" PRIMARY KEY ("ASSAY_ID", "REGION_ID") USING INDEX TABLESPACE "TRANSMART" ENABLE - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; -- diff --git a/ddl/oracle/deapp/de_subject_microarray_data.sql b/ddl/oracle/deapp/de_subject_microarray_data.sql index f83e25bb..69670298 100644 --- a/ddl/oracle/deapp/de_subject_microarray_data.sql +++ b/ddl/oracle/deapp/de_subject_microarray_data.sql @@ -15,25 +15,36 @@ "NEW_LOG" NUMBER(18,4), "NEW_ZSCORE" NUMBER(18,4), "TRIAL_SOURCE" VARCHAR2(200 BYTE) - ) - TABLESPACE "TRANSMART" - PARTITION BY LIST ("TRIAL_NAME") -(PARTITION "NULL_PARTITION" VALUES (NULL) - TABLESPACE "TRANSMART" NOCOMPRESS ) ; + ) SEGMENT CREATION IMMEDIATE + TABLESPACE "TRANSMART" ; + +-- +-- Type: INDEX; Owner: DEAPP; Name: DE_MICROARRAY_DATA_IDX5 +-- +CREATE INDEX "DEAPP"."DE_MICROARRAY_DATA_IDX5" ON "DEAPP"."DE_SUBJECT_MICROARRAY_DATA" ("TRIAL_SOURCE") +TABLESPACE "INDX" ; -- -- Type: INDEX; Owner: DEAPP; Name: DE_MICROARRAY_DATA_IDX1 -- - CREATE INDEX "DEAPP"."DE_MICROARRAY_DATA_IDX1" ON "DEAPP"."DE_SUBJECT_MICROARRAY_DATA" ("PROBESET_ID") - TABLESPACE "INDX" LOCAL -(PARTITION "NULL_PARTITION" - TABLESPACE "INDX" ) COMPRESS 1 ; +CREATE INDEX "DEAPP"."DE_MICROARRAY_DATA_IDX1" ON "DEAPP"."DE_SUBJECT_MICROARRAY_DATA" ("TRIAL_NAME", "ASSAY_ID", "PROBESET_ID") +TABLESPACE "INDX" ; -- -- Type: INDEX; Owner: DEAPP; Name: DE_MICROARRAY_DATA_IDX2 -- - CREATE INDEX "DEAPP"."DE_MICROARRAY_DATA_IDX2" ON "DEAPP"."DE_SUBJECT_MICROARRAY_DATA" ("ASSAY_ID") - TABLESPACE "INDX" LOCAL -(PARTITION "NULL_PARTITION" - TABLESPACE "INDX" ) COMPRESS 1 ; +CREATE INDEX "DEAPP"."DE_MICROARRAY_DATA_IDX2" ON "DEAPP"."DE_SUBJECT_MICROARRAY_DATA" ("ASSAY_ID", "PROBESET_ID") +TABLESPACE "INDX" ; + +-- +-- Type: INDEX; Owner: DEAPP; Name: DE_MICROARRAY_DATA_IDX3 +-- +CREATE BITMAP INDEX "DEAPP"."DE_MICROARRAY_DATA_IDX3" ON "DEAPP"."DE_SUBJECT_MICROARRAY_DATA" ("ASSAY_ID") +TABLESPACE "INDX" ; + +-- +-- Type: INDEX; Owner: DEAPP; Name: DE_MICROARRAY_DATA_IDX4 +-- +CREATE BITMAP INDEX "DEAPP"."DE_MICROARRAY_DATA_IDX4" ON "DEAPP"."DE_SUBJECT_MICROARRAY_DATA" ("PROBESET_ID") +TABLESPACE "INDX" ; diff --git a/ddl/oracle/deapp/de_subject_microarray_data_new.sql b/ddl/oracle/deapp/de_subject_microarray_data_new.sql index 51715954..207c31a1 100644 --- a/ddl/oracle/deapp/de_subject_microarray_data_new.sql +++ b/ddl/oracle/deapp/de_subject_microarray_data_new.sql @@ -10,9 +10,6 @@ "RAW_INTENSITY" NUMBER(18,4), "LOG_INTENSITY" NUMBER(18,4), "ZSCORE" NUMBER(18,4) - ) - TABLESPACE "TRANSMART" - PARTITION BY LIST ("TRIAL_SOURCE") -(PARTITION "NULL_PARTITION" VALUES (NULL) - TABLESPACE "TRANSMART" NOCOMPRESS ) ; + ) SEGMENT CREATION DEFERRED + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/deapp/de_subject_microarray_logs.sql b/ddl/oracle/deapp/de_subject_microarray_logs.sql index 70588ff7..50364204 100644 --- a/ddl/oracle/deapp/de_subject_microarray_logs.sql +++ b/ddl/oracle/deapp/de_subject_microarray_logs.sql @@ -14,5 +14,5 @@ "TIMEPOINT" VARCHAR2(30 BYTE), "LOG_INTENSITY" NUMBER ) SEGMENT CREATION IMMEDIATE - TABLESPACE "TRANSMART" ; - +NOCOMPRESS LOGGING + TABLESPACE "DEAPP" ; diff --git a/ddl/oracle/deapp/de_subject_rnaseq_data.sql b/ddl/oracle/deapp/de_subject_rnaseq_data.sql index 73510b97..2cec5296 100644 --- a/ddl/oracle/deapp/de_subject_rnaseq_data.sql +++ b/ddl/oracle/deapp/de_subject_rnaseq_data.sql @@ -7,11 +7,11 @@ "ASSAY_ID" NUMBER NOT NULL ENABLE, "PATIENT_ID" NUMBER, "READCOUNT" NUMBER, -"PARTITION_ID" NUMBER, +"TRIAL_SOURCE" VARCHAR2(200 BYTE), CONSTRAINT "DE_SUBJECT_RNASEQ_DATA_PKEY" PRIMARY KEY ("ASSAY_ID", "REGION_ID") USING INDEX TABLESPACE "TRANSMART" ENABLE - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; -- diff --git a/ddl/oracle/deapp/de_subject_sample_mapping.sql b/ddl/oracle/deapp/de_subject_sample_mapping.sql index bac4719e..45b7c75b 100644 --- a/ddl/oracle/deapp/de_subject_sample_mapping.sql +++ b/ddl/oracle/deapp/de_subject_sample_mapping.sql @@ -32,6 +32,12 @@ ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; +-- +-- Type: INDEX; Owner: DEAPP; Name: IDX_DE_SUBJ_SMPL_TRIAL_CCODE +-- +CREATE INDEX "DEAPP"."IDX_DE_SUBJ_SMPL_TRIAL_CCODE" ON "DEAPP"."DE_SUBJECT_SAMPLE_MAPPING" ("TRIAL_NAME", "CONCEPT_CODE") +TABLESPACE "TRANSMART" ; + -- -- Type: INDEX; Owner: DEAPP; Name: DE_SUBJECT_SMPL_MPNG_IDX3 -- diff --git a/ddl/oracle/deapp/de_variant_dataset.sql b/ddl/oracle/deapp/de_variant_dataset.sql index c0d73fc1..6b39481d 100644 --- a/ddl/oracle/deapp/de_variant_dataset.sql +++ b/ddl/oracle/deapp/de_variant_dataset.sql @@ -13,12 +13,11 @@ CONSTRAINT "DATASET_ID" PRIMARY KEY ("DATASET_ID") USING INDEX TABLESPACE "TRANSMART" ENABLE - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" LOB ("METADATA_COMMENT") STORE AS BASICFILE ( TABLESPACE "TRANSMART" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION NOCACHE LOGGING ) ; - -- -- Type: REF_CONSTRAINT; Owner: DEAPP; Name: GPL_ID -- diff --git a/ddl/oracle/deapp/de_variant_metadata.sql b/ddl/oracle/deapp/de_variant_metadata.sql index 97d50ba2..181b0212 100644 --- a/ddl/oracle/deapp/de_variant_metadata.sql +++ b/ddl/oracle/deapp/de_variant_metadata.sql @@ -9,12 +9,11 @@ CONSTRAINT "DE_VARIANT_METADATA_PK" PRIMARY KEY ("DE_VARIANT_METADATA_ID") USING INDEX TABLESPACE "TRANSMART" ENABLE - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" LOB ("VALUE") STORE AS BASICFILE ( TABLESPACE "TRANSMART" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION NOCACHE LOGGING ) ; - -- -- Type: REF_CONSTRAINT; Owner: DEAPP; Name: VAR_MET_DATASET_ID -- diff --git a/ddl/oracle/deapp/de_variant_population_data.sql b/ddl/oracle/deapp/de_variant_population_data.sql index be3676e0..4ce00392 100644 --- a/ddl/oracle/deapp/de_variant_population_data.sql +++ b/ddl/oracle/deapp/de_variant_population_data.sql @@ -14,7 +14,7 @@ CONSTRAINT "DE_VAR_POPULAT_DATA_ID_IDX" PRIMARY KEY ("VARIANT_POPULATION_DATA_ID") USING INDEX TABLESPACE "TRANSMART" ENABLE - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; -- @@ -42,4 +42,4 @@ for each row begin end; / ALTER TRIGGER "DEAPP"."TRG_DE_VARIANT_PD_ID" ENABLE; - + diff --git a/ddl/oracle/deapp/de_variant_population_info.sql b/ddl/oracle/deapp/de_variant_population_info.sql index 8284530a..1e2c4f02 100644 --- a/ddl/oracle/deapp/de_variant_population_info.sql +++ b/ddl/oracle/deapp/de_variant_population_info.sql @@ -16,12 +16,11 @@ CREATE SEQUENCE "DEAPP"."DE_VARIANT_POPULATION_INFO_SEQ" MINVALUE 1 MAXVALUE 9 CONSTRAINT "DE_VAR_POPULAT_INFO_ID_IDX" PRIMARY KEY ("VARIANT_POPULATION_INFO_ID") USING INDEX TABLESPACE "TRANSMART" ENABLE - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" LOB ("DESCRIPTION") STORE AS BASICFILE ( TABLESPACE "TRANSMART" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION NOCACHE LOGGING ) ; - -- -- Type: INDEX; Owner: DEAPP; Name: VAR_POPULAT_INFO_DATASET_NAME -- @@ -43,4 +42,3 @@ end; / ALTER TRIGGER "DEAPP"."TRG_DE_VP_INFO_ID" ENABLE; - diff --git a/ddl/oracle/deapp/de_variant_subject_detail.sql b/ddl/oracle/deapp/de_variant_subject_detail.sql index 6be632c8..52c3b0bf 100644 --- a/ddl/oracle/deapp/de_variant_subject_detail.sql +++ b/ddl/oracle/deapp/de_variant_subject_detail.sql @@ -17,15 +17,14 @@ CONSTRAINT "VARIANT_SUBJECT_DETAIL_ID" PRIMARY KEY ("VARIANT_SUBJECT_DETAIL_ID") USING INDEX TABLESPACE "TRANSMART" ENABLE - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" -LOB ("INFO") STORE AS BASICFILE ( - TABLESPACE "TRANSMART" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION - NOCACHE LOGGING ) +LOB ("INFO") STORE AS SECUREFILE ( + TABLESPACE "TRANSMART" ENABLE STORAGE IN ROW CHUNK 8192 + NOCACHE LOGGING NOCOMPRESS KEEP_DUPLICATES ) LOB ("VARIANT_VALUE") STORE AS BASICFILE ( TABLESPACE "TRANSMART" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION NOCACHE LOGGING ) ; - -- -- Type: REF_CONSTRAINT; Owner: DEAPP; Name: VARIANT_SUBJECT_DETAIL_FK -- diff --git a/ddl/oracle/deapp/de_variant_subject_idx.sql b/ddl/oracle/deapp/de_variant_subject_idx.sql index 12eea20a..1d9fb2cb 100644 --- a/ddl/oracle/deapp/de_variant_subject_idx.sql +++ b/ddl/oracle/deapp/de_variant_subject_idx.sql @@ -6,7 +6,7 @@ "SUBJECT_ID" VARCHAR2(50 BYTE), "POSITION" NUMBER, "VARIANT_SUBJECT_IDX_ID" NUMBER NOT NULL ENABLE - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; -- diff --git a/ddl/oracle/deapp/de_variant_subject_summary.sql b/ddl/oracle/deapp/de_variant_subject_summary.sql index 3cdb5f50..6b63d7fb 100644 --- a/ddl/oracle/deapp/de_variant_subject_summary.sql +++ b/ddl/oracle/deapp/de_variant_subject_summary.sql @@ -23,7 +23,7 @@ CREATE SEQUENCE "DEAPP"."DE_VARIANT_SUBJECT_SUMMARY_SEQ" MINVALUE 1 MAXVALUE 9 CONSTRAINT "VARIANT_SUBJECT_SUMMARY_ID" PRIMARY KEY ("VARIANT_SUBJECT_SUMMARY_ID") USING INDEX TABLESPACE "TRANSMART" ENABLE - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; -- diff --git a/ddl/oracle/deapp/items.json b/ddl/oracle/deapp/items.json index 990dd6aa..5fd51396 100644 --- a/ddl/oracle/deapp/items.json +++ b/ddl/oracle/deapp/items.json @@ -67,6 +67,24 @@ "name" : "DE_ENCOUNTER_TYPE" }, "parents" : [ ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_GENE_INFO" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_GENE_SOURCE" + } ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_GENE_SOURCE" + }, + "parents" : [ ] }, { "child" : { "type" : "TABLE", @@ -169,6 +187,39 @@ "owner" : "DEAPP", "name" : "DE_SUBJECT_MICROARRAY_DATA" } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "DEAPP", + "name" : "DE_MICROARRAY_DATA_IDX3" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_SUBJECT_MICROARRAY_DATA" + } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "DEAPP", + "name" : "DE_MICROARRAY_DATA_IDX4" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_SUBJECT_MICROARRAY_DATA" + } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "DEAPP", + "name" : "DE_MICROARRAY_DATA_IDX5" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_SUBJECT_MICROARRAY_DATA" + } ] }, { "child" : { "type" : "TABLE", @@ -987,6 +1038,17 @@ "name" : "DUMP_TABLE_TO_CSV" }, "parents" : [ ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "DEAPP", + "name" : "ENTREZ_IDX1" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_SNP_GENE_MAP" + } ] }, { "child" : { "type" : "REF_CONSTRAINT", @@ -1154,6 +1216,17 @@ "owner" : "DEAPP", "name" : "DE_SAMPLE_SNP_DATA" } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "DEAPP", + "name" : "IDX_DE_SUBJ_SMPL_TRIAL_CCODE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_SUBJECT_SAMPLE_MAPPING" + } ] }, { "child" : { "type" : "INDEX", @@ -1434,6 +1507,28 @@ "name" : "SEQ_MRNA_PARTITION_ID" }, "parents" : [ ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "DEAPP", + "name" : "SNP_NAME_IDX1" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_SNP_GENE_MAP" + } ] + }, { + "child" : { + "type" : "REF_CONSTRAINT", + "owner" : "DEAPP", + "name" : "SYS_C0029766" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_GENE_INFO" + } ] }, { "child" : { "type" : "FUNCTION", @@ -1460,6 +1555,28 @@ "owner" : "DEAPP", "name" : "DE_CHROMO_REGION_ID_SEQ" } ] + }, { + "child" : { + "type" : "TRIGGER", + "owner" : "DEAPP", + "name" : "TRG_DE_GENE_INFO_ID" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_GENE_INFO" + } ] + }, { + "child" : { + "type" : "TRIGGER", + "owner" : "DEAPP", + "name" : "TRG_DE_GENE_SOURCE_ID" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_GENE_SOURCE" + } ] }, { "child" : { "type" : "TRIGGER", @@ -1897,6 +2014,20 @@ "name" : "DE_ENCOUNTER_TYPE" }, "file" : "deapp/de_encounter_type.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_GENE_INFO" + }, + "file" : "deapp/de_gene_info.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_GENE_SOURCE" + }, + "file" : "deapp/de_gene_source.sql" }, { "item" : { "type" : "TABLE", @@ -1967,6 +2098,27 @@ "name" : "DE_MICROARRAY_DATA_IDX2" }, "file" : "deapp/de_subject_microarray_data.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "DEAPP", + "name" : "DE_MICROARRAY_DATA_IDX3" + }, + "file" : "deapp/de_subject_microarray_data.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "DEAPP", + "name" : "DE_MICROARRAY_DATA_IDX4" + }, + "file" : "deapp/de_subject_microarray_data.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "DEAPP", + "name" : "DE_MICROARRAY_DATA_IDX5" + }, + "file" : "deapp/de_subject_microarray_data.sql" }, { "item" : { "type" : "TABLE", @@ -2597,6 +2749,13 @@ "name" : "DUMP_TABLE_TO_CSV" }, "file" : "deapp/procedures/dump_table_to_csv.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "DEAPP", + "name" : "ENTREZ_IDX1" + }, + "file" : "deapp/de_snp_gene_map.sql" }, { "item" : { "type" : "REF_CONSTRAINT", @@ -2716,6 +2875,13 @@ "name" : "IDX_DE_SAMPLE_SNP_DATA_SNP" }, "file" : "deapp/de_sample_snp_data.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "DEAPP", + "name" : "IDX_DE_SUBJ_SMPL_TRIAL_CCODE" + }, + "file" : "deapp/de_subject_sample_mapping.sql" }, { "item" : { "type" : "INDEX", @@ -2884,6 +3050,20 @@ "name" : "SEQ_MRNA_PARTITION_ID" }, "file" : "deapp/_misc.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "DEAPP", + "name" : "SNP_NAME_IDX1" + }, + "file" : "deapp/de_snp_gene_map.sql" + }, { + "item" : { + "type" : "REF_CONSTRAINT", + "owner" : "DEAPP", + "name" : "SYS_C0029766" + }, + "file" : "deapp/de_gene_info.sql" }, { "item" : { "type" : "FUNCTION", @@ -2898,6 +3078,20 @@ "name" : "TRG_DE_CHROMOSOMAL_REGION_ID" }, "file" : "deapp/de_chromosomal_region.sql" + }, { + "item" : { + "type" : "TRIGGER", + "owner" : "DEAPP", + "name" : "TRG_DE_GENE_INFO_ID" + }, + "file" : "deapp/de_gene_info.sql" + }, { + "item" : { + "type" : "TRIGGER", + "owner" : "DEAPP", + "name" : "TRG_DE_GENE_SOURCE_ID" + }, + "file" : "deapp/de_gene_source.sql" }, { "item" : { "type" : "TRIGGER", @@ -3095,4 +3289,4 @@ }, "file" : "deapp/de_variant_population_info.sql" } ] -} +} \ No newline at end of file diff --git a/ddl/oracle/deapp/kegg_def.sql b/ddl/oracle/deapp/kegg_def.sql index 447d7a2d..5bd7363d 100644 --- a/ddl/oracle/deapp/kegg_def.sql +++ b/ddl/oracle/deapp/kegg_def.sql @@ -2,8 +2,8 @@ -- Type: TABLE; Owner: DEAPP; Name: KEGG_DEF -- CREATE TABLE "DEAPP"."KEGG_DEF" - ( "PATHWAY" VARCHAR2(80 BYTE), -"DESCR" VARCHAR2(200 BYTE) + ( "PATHWAY" VARCHAR2(100 BYTE), +"DESCR" VARCHAR2(500 BYTE) ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; From 32b15eb44ecf89464d2a3ba86ef2de413044708c Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Tue, 12 Aug 2014 12:26:24 +0100 Subject: [PATCH 26/31] biomart update from oracle test server --- ddl/oracle/biomart/_cross.sql | 84 +++--- ddl/oracle/biomart/assay_analysis_data.sql | 8 +- ddl/oracle/biomart/bio_ad_hoc_property.sql | 2 +- .../bio_analysis_attribute_lineage.sql | 20 ++ .../biomart/bio_assay_analysis_eqtl.sql | 26 +- ddl/oracle/biomart/bio_assay_analysis_ext.sql | 8 +- .../biomart/bio_assay_analysis_gwas.sql | 39 ++- .../biomart/bio_asy_analysis_data_idx.sql | 2 +- .../biomart/bio_asy_analysis_eqtl_top50.sql | 5 +- .../biomart/bio_asy_analysis_gwas_top50.sql | 7 +- ddl/oracle/biomart/bio_concept_code.sql | 8 + ddl/oracle/biomart/bio_experiment.sql | 20 +- ddl/oracle/biomart/faceted_search.sql | 19 ++ ddl/oracle/biomart/gwas_partition.sql | 24 ++ ddl/oracle/biomart/items.json | 254 +++++++++++++++++- ddl/oracle/biomart/mesh.sql | 2 +- .../biomart/tmp_analysis_eqtl_top500.sql | 29 ++ .../biomart/tmp_analysis_gwas_top500.sql | 16 ++ .../biomart/views/bio_marker_correl_mv.sql | 211 +++++++-------- ddl/oracle/biomart/views/gwas_anlysis.sql | 5 + .../biomart/views/vw_faceted_search.sql | 6 +- 21 files changed, 610 insertions(+), 185 deletions(-) create mode 100644 ddl/oracle/biomart/faceted_search.sql create mode 100644 ddl/oracle/biomart/gwas_partition.sql create mode 100644 ddl/oracle/biomart/tmp_analysis_eqtl_top500.sql create mode 100644 ddl/oracle/biomart/tmp_analysis_gwas_top500.sql create mode 100644 ddl/oracle/biomart/views/gwas_anlysis.sql diff --git a/ddl/oracle/biomart/_cross.sql b/ddl/oracle/biomart/_cross.sql index 56b0217d..4225cc72 100644 --- a/ddl/oracle/biomart/_cross.sql +++ b/ddl/oracle/biomart/_cross.sql @@ -1,24 +1,47 @@ -- -- Type: VIEW; Owner: BIOMART; Name: BIO_METAB_SUBPATHWAY_VIEW -- - CREATE OR REPLACE FORCE VIEW "BIOMART"."BIO_METAB_SUBPATHWAY_VIEW" ("SUBPATHWAY_ID", "ASSO_BIO_MARKER_ID", "CORREL_TYPE") AS - SELECT - SP.id, - B.bio_marker_id, - 'SUBPATHWAY TO METABOLITE' - FROM - deapp.de_metabolite_sub_pathways SP - INNER JOIN deapp.de_metabolite_sub_pway_metab J ON (SP.id = J.sub_pathway_id) - INNER JOIN deapp.de_metabolite_annotation M ON (M.id = J.metabolite_id) - INNER JOIN biomart.bio_marker B ON ( - B.bio_marker_type = 'METABOLITE' AND -B.primary_external_id = M.hmdb_id); +CREATE OR REPLACE FORCE VIEW "BIOMART"."BIO_METAB_SUBPATHWAY_VIEW" ("SUBPATHWAY_ID", "ASSO_BIO_MARKER_ID", "CORREL_TYPE") AS +SELECT SP.id, + B.bio_marker_id, + 'SUBPATHWAY TO METABOLITE' +FROM deapp.de_metabolite_sub_pathways SP +INNER JOIN deapp.de_metabolite_sub_pway_metab J +ON (SP.id = J.sub_pathway_id) +INNER JOIN deapp.de_metabolite_annotation M +ON (M.id = J.metabolite_id) +INNER JOIN biomart.bio_marker B +ON ( B.bio_marker_type = 'METABOLITE' +AND B.primary_external_id = M.hmdb_id); +-- +-- Type: TRIGGER; Owner: BIOMART; Name: TRG_BIO_ANALYSIS_ATT_BAAL +-- + CREATE OR REPLACE TRIGGER "BIOMART"."TRG_BIO_ANALYSIS_ATT_BAAL" + after insert on "BIOMART"."BIO_ANALYSIS_ATTRIBUTE" + for each row +declare + -- local variables here +begin + if inserting then + -- create a new record in the lineage table for each ancestor of this term (including self) + insert into BIO_ANALYSIS_ATTRIBUTE_LINEAGE + (BIO_ANALYSIS_ATTRIBUTE_ID, ANCESTOR_TERM_ID, ANCESTOR_SEARCH_KEYWORD_ID) + SELECT :NEW.BIO_ANALYSIS_ATTRIBUTE_ID, skl.ancestor_id, skl.search_keyword_id + FROM searchapp.solr_keywords_lineage skl + WHERE skl.term_id = :NEW.TERM_ID; + end if; + +end TRG_BIO_ANALYSIS_ATT_BAAL; + + +/ +ALTER TRIGGER "BIOMART"."TRG_BIO_ANALYSIS_ATT_BAAL" DISABLE; -- -- Type: VIEW; Owner: BIOMART; Name: BIO_MARKER_EXP_ANALYSIS_MV -- - CREATE OR REPLACE FORCE VIEW "BIOMART"."BIO_MARKER_EXP_ANALYSIS_MV" ("BIO_MARKER_ID", "BIO_EXPERIMENT_ID", "BIO_ASSAY_ANALYSIS_ID", "MV_ID") AS - SELECT DISTINCT t4.bio_marker_id, +CREATE OR REPLACE FORCE VIEW "BIOMART"."BIO_MARKER_EXP_ANALYSIS_MV" ("BIO_MARKER_ID", "BIO_EXPERIMENT_ID", "BIO_ASSAY_ANALYSIS_ID", "MV_ID") AS +SELECT DISTINCT t4.bio_marker_id, t1.bio_experiment_id, t1.bio_assay_analysis_id, t1.bio_assay_analysis_id*100+t4.bio_marker_id @@ -26,25 +49,26 @@ FROM BIO_ASSAY_ANALYSIS_DATA t1, BIO_EXPERIMENT t2, DEAPP.DE_MRNA_ANNOTATION t3, BIO_MARKER t4 -WHERE t1.bio_experiment_id = t2.bio_experiment_id -AND t2.bio_experiment_type ='Experiment' -AND t3.probeset_id= t1.probeset_id +WHERE t1.bio_experiment_id = t2.bio_experiment_id +AND t2.bio_experiment_type ='Experiment' +AND t3.probeset_id = t1.probeset_id AND t4.primary_external_id = CAST(t3.gene_id AS VARCHAR(200)); -- -- Type: VIEW; Owner: BIOMART; Name: BIO_METAB_SUPERPATHWAY_VIEW -- - CREATE OR REPLACE FORCE VIEW "BIOMART"."BIO_METAB_SUPERPATHWAY_VIEW" ("SUPERPATHWAY_ID", "ASSO_BIO_MARKER_ID", "CORREL_TYPE") AS - SELECT - SUPP.id, - B.bio_marker_id, - 'SUPERPATHWAY TO METABOLITE' - FROM - deapp.de_metabolite_super_pathways SUPP - INNER JOIN deapp.de_metabolite_sub_pathways SUBP ON (SUPP.id = SUBP.super_pathway_id) - INNER JOIN deapp.de_metabolite_sub_pway_metab J ON (SUBP.id = J.sub_pathway_id) - INNER JOIN deapp.de_metabolite_annotation M ON (M.id = J.metabolite_id) - INNER JOIN biomart.bio_marker B ON ( - B.bio_marker_type = 'METABOLITE' AND -B.primary_external_id = M.hmdb_id); +CREATE OR REPLACE FORCE VIEW "BIOMART"."BIO_METAB_SUPERPATHWAY_VIEW" ("SUPERPATHWAY_ID", "ASSO_BIO_MARKER_ID", "CORREL_TYPE") AS +SELECT SUPP.id, + B.bio_marker_id, + 'SUPERPATHWAY TO METABOLITE' +FROM deapp.de_metabolite_super_pathways SUPP +INNER JOIN deapp.de_metabolite_sub_pathways SUBP +ON (SUPP.id = SUBP.super_pathway_id) +INNER JOIN deapp.de_metabolite_sub_pway_metab J +ON (SUBP.id = J.sub_pathway_id) +INNER JOIN deapp.de_metabolite_annotation M +ON (M.id = J.metabolite_id) +INNER JOIN biomart.bio_marker B +ON ( B.bio_marker_type = 'METABOLITE' +AND B.primary_external_id = M.hmdb_id); diff --git a/ddl/oracle/biomart/assay_analysis_data.sql b/ddl/oracle/biomart/assay_analysis_data.sql index 6a3de90a..2060b68c 100644 --- a/ddl/oracle/biomart/assay_analysis_data.sql +++ b/ddl/oracle/biomart/assay_analysis_data.sql @@ -15,7 +15,7 @@ "PREFERRED_PVALUE" NUMBER(18,5) ) TABLESPACE "TRANSMART" - PARTITION BY LIST ("BIO_EXPERIMENT_ID") -(PARTITION "NULL_PARTITION" VALUES (NULL) - TABLESPACE "TRANSMART" NOCOMPRESS ) ; - + PARTITION BY HASH ("BIO_EXPERIMENT_ID") +(PARTITION "SYS_P391" SEGMENT CREATION DEFERRED + TABLESPACE "TRANSMART" +NOCOMPRESS ) ; diff --git a/ddl/oracle/biomart/bio_ad_hoc_property.sql b/ddl/oracle/biomart/bio_ad_hoc_property.sql index f3dcebe4..55f598a7 100644 --- a/ddl/oracle/biomart/bio_ad_hoc_property.sql +++ b/ddl/oracle/biomart/bio_ad_hoc_property.sql @@ -3,7 +3,7 @@ -- CREATE TABLE "BIOMART"."BIO_AD_HOC_PROPERTY" ( "AD_HOC_PROPERTY_ID" NUMBER(22,0) NOT NULL ENABLE, -"BIO_DATA_ID" NUMBER(22,0), +"BIO_DATA_ID" NUMBER(22,0) NOT NULL ENABLE, "PROPERTY_KEY" NVARCHAR2(50), "PROPERTY_VALUE" NVARCHAR2(2000), CONSTRAINT "BIO_AD_HOC_PROPERTY_PK" PRIMARY KEY ("AD_HOC_PROPERTY_ID") diff --git a/ddl/oracle/biomart/bio_analysis_attribute_lineage.sql b/ddl/oracle/biomart/bio_analysis_attribute_lineage.sql index a4ab3719..e9eeeb58 100644 --- a/ddl/oracle/biomart/bio_analysis_attribute_lineage.sql +++ b/ddl/oracle/biomart/bio_analysis_attribute_lineage.sql @@ -12,6 +12,26 @@ ) SEGMENT CREATION DEFERRED TABLESPACE "TRANSMART" ; +-- +-- Type: TRIGGER; Owner: BIOMART; Name: TRG_BIO_ANALYSIS_ATT_LINEAGE +-- + CREATE OR REPLACE TRIGGER "BIOMART"."TRG_BIO_ANALYSIS_ATT_LINEAGE" + before insert on "BIOMART"."BIO_ANALYSIS_ATTRIBUTE_LINEAGE" + for each row +declare + -- local variables here +begin + if inserting then + if :NEW.BIO_ANALYSIS_ATT_LINEAGE_ID is null then + select SEQ_BIO_ANALYSIS_ATT_LIN_ID.nextval into :NEW.BIO_ANALYSIS_ATT_LINEAGE_ID from dual; + end if; + end if; +end TRG_BIO_ANALYSIS_ATT_LINEAGE; + + +/ +ALTER TRIGGER "BIOMART"."TRG_BIO_ANALYSIS_ATT_LINEAGE" ENABLE; + -- -- Type: TRIGGER; Owner: BIOMART; Name: TRG_BIO_ANALYSIS_AL_ID -- diff --git a/ddl/oracle/biomart/bio_assay_analysis_eqtl.sql b/ddl/oracle/biomart/bio_assay_analysis_eqtl.sql index a56204d4..aa4f55f3 100644 --- a/ddl/oracle/biomart/bio_assay_analysis_eqtl.sql +++ b/ddl/oracle/biomart/bio_assay_analysis_eqtl.sql @@ -2,8 +2,8 @@ -- Type: TABLE; Owner: BIOMART; Name: BIO_ASSAY_ANALYSIS_EQTL -- CREATE TABLE "BIOMART"."BIO_ASSAY_ANALYSIS_EQTL" - ( "BIO_ASY_ANALYSIS_EQTL_ID" NUMBER, -"BIO_ASSAY_ANALYSIS_ID" NUMBER, + ( "BIO_ASY_ANALYSIS_EQTL_ID" NUMBER NOT NULL ENABLE, +"BIO_ASSAY_ANALYSIS_ID" NUMBER NOT NULL ENABLE, "RS_ID" VARCHAR2(50 BYTE), "GENE" VARCHAR2(50 BYTE), "P_VALUE_CHAR" VARCHAR2(100 BYTE), @@ -16,3 +16,25 @@ ) SEGMENT CREATION DEFERRED TABLESPACE "TRANSMART" ; + +-- +-- Type: TRIGGER; Owner: BIOMART; Name: TRG_BIO_ASY_ANALYSIS_EQTL_ID +-- + CREATE OR REPLACE TRIGGER "BIOMART"."TRG_BIO_ASY_ANALYSIS_EQTL_ID" before insert on BIOMART.BIO_ASSAY_ANALYSIS_EQTL for each row +begin + if inserting then + if :NEW."BIO_ASY_ANALYSIS_EQTL_ID" is null then + select SEQ_BIO_DATA_ID.nextval into :NEW."BIO_ASY_ANALYSIS_EQTL_ID" from dual; + end if; + end if; +end; + +/ +ALTER TRIGGER "BIOMART"."TRG_BIO_ASY_ANALYSIS_EQTL_ID" ENABLE; + +-- +-- Type: INDEX; Owner: BIOMART; Name: BIO_ASSAY_ANALYSIS_EQTL_IDX1 +-- +CREATE INDEX "BIOMART"."BIO_ASSAY_ANALYSIS_EQTL_IDX1" ON "BIOMART"."BIO_ASSAY_ANALYSIS_EQTL" ("BIO_ASSAY_ANALYSIS_ID") +TABLESPACE "INDX" ; + diff --git a/ddl/oracle/biomart/bio_assay_analysis_ext.sql b/ddl/oracle/biomart/bio_assay_analysis_ext.sql index 1dd7d776..48d83b7b 100644 --- a/ddl/oracle/biomart/bio_assay_analysis_ext.sql +++ b/ddl/oracle/biomart/bio_assay_analysis_ext.sql @@ -16,6 +16,12 @@ "MODEL_DESC" VARCHAR2(500 BYTE), "SENSITIVE_FLAG" NUMBER(*,0), "SENSITIVE_DESC" VARCHAR2(500 BYTE) - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; +-- +-- Type: INDEX; Owner: BIOMART; Name: BIO_ASSAY_ANALYSIS_EXT_IDX1 +-- +CREATE INDEX "BIOMART"."BIO_ASSAY_ANALYSIS_EXT_IDX1" ON "BIOMART"."BIO_ASSAY_ANALYSIS_EXT" ("BIO_ASSAY_ANALYSIS_ID") +TABLESPACE "INDX" ; + diff --git a/ddl/oracle/biomart/bio_assay_analysis_gwas.sql b/ddl/oracle/biomart/bio_assay_analysis_gwas.sql index 6b123113..22ab826f 100644 --- a/ddl/oracle/biomart/bio_assay_analysis_gwas.sql +++ b/ddl/oracle/biomart/bio_assay_analysis_gwas.sql @@ -2,14 +2,33 @@ -- Type: TABLE; Owner: BIOMART; Name: BIO_ASSAY_ANALYSIS_GWAS -- CREATE TABLE "BIOMART"."BIO_ASSAY_ANALYSIS_GWAS" - ( "BIO_ASY_ANALYSIS_GWAS_ID" NUMBER, -"BIO_ASSAY_ANALYSIS_ID" NUMBER, -"RS_ID" VARCHAR2(50 BYTE), + ( "BIO_ASY_ANALYSIS_GWAS_ID" NUMBER(18,0) NOT NULL ENABLE, +"BIO_ASSAY_ANALYSIS_ID" NUMBER(18,0) NOT NULL ENABLE, +"RS_ID" NVARCHAR2(50), "P_VALUE_CHAR" VARCHAR2(100 BYTE), -"ETL_ID" NUMBER, -"EXT_DATA" VARCHAR2(4000 BYTE), -"P_VALUE" FLOAT(126), -"LOG_P_VALUE" FLOAT(126) - ) SEGMENT CREATION DEFERRED - TABLESPACE "TRANSMART" ; - +"P_VALUE" BINARY_DOUBLE, +"LOG_P_VALUE" BINARY_DOUBLE, +"ETL_ID" NUMBER(18,0), +"EXT_DATA" VARCHAR2(4000 BYTE) + ) +COMPRESS BASIC NOLOGGING + TABLESPACE "TRANSMART" + PARTITION BY LIST ("BIO_ASSAY_ANALYSIS_ID") +(PARTITION "1" VALUES (1) SEGMENT CREATION DEFERRED +COMPRESS BASIC NOLOGGING + TABLESPACE "TRANSMART" , +PARTITION "393525752" VALUES (393525752) SEGMENT CREATION IMMEDIATE +COMPRESS BASIC NOLOGGING + TABLESPACE "TRANSMART" , +PARTITION "393525754" VALUES (393525754) SEGMENT CREATION IMMEDIATE +COMPRESS BASIC NOLOGGING + TABLESPACE "TRANSMART" , +PARTITION "393525758" VALUES (393525758) SEGMENT CREATION IMMEDIATE +COMPRESS BASIC NOLOGGING + TABLESPACE "TRANSMART" , +PARTITION "393525756" VALUES (393525756) SEGMENT CREATION IMMEDIATE +COMPRESS BASIC NOLOGGING + TABLESPACE "TRANSMART" , +PARTITION "393525760" VALUES (393525760) SEGMENT CREATION IMMEDIATE +COMPRESS BASIC NOLOGGING + TABLESPACE "TRANSMART" ) ; diff --git a/ddl/oracle/biomart/bio_asy_analysis_data_idx.sql b/ddl/oracle/biomart/bio_asy_analysis_data_idx.sql index 2594dc2c..f19cf677 100644 --- a/ddl/oracle/biomart/bio_asy_analysis_data_idx.sql +++ b/ddl/oracle/biomart/bio_asy_analysis_data_idx.sql @@ -8,7 +8,7 @@ "FIELD_NAME" VARCHAR2(255 BYTE) NOT NULL ENABLE, "DISPLAY_IDX" NUMBER(10,0) NOT NULL ENABLE, "DISPLAY_NAME" VARCHAR2(255 BYTE) NOT NULL ENABLE - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; -- diff --git a/ddl/oracle/biomart/bio_asy_analysis_eqtl_top50.sql b/ddl/oracle/biomart/bio_asy_analysis_eqtl_top50.sql index d712dc46..8f8e567b 100644 --- a/ddl/oracle/biomart/bio_asy_analysis_eqtl_top50.sql +++ b/ddl/oracle/biomart/bio_asy_analysis_eqtl_top50.sql @@ -11,7 +11,10 @@ "PVALUE" FLOAT(126), "LOGPVALUE" FLOAT(126), "EXTDATA" VARCHAR2(4000 BYTE), -"RNUM" NUMBER +"RNUM" NUMBER, +"INTRONEXON" VARCHAR2(10 BYTE), +"REGULOME" VARCHAR2(10 BYTE), +"RECOMBINATIONRATE" NUMBER(18,6) ) SEGMENT CREATION DEFERRED TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/biomart/bio_asy_analysis_gwas_top50.sql b/ddl/oracle/biomart/bio_asy_analysis_gwas_top50.sql index 7941b681..bd393e8c 100644 --- a/ddl/oracle/biomart/bio_asy_analysis_gwas_top50.sql +++ b/ddl/oracle/biomart/bio_asy_analysis_gwas_top50.sql @@ -11,7 +11,10 @@ "PVALUE" FLOAT(126), "LOGPVALUE" FLOAT(126), "EXTDATA" VARCHAR2(4000 BYTE), -"RNUM" NUMBER - ) SEGMENT CREATION DEFERRED +"RNUM" NUMBER, +"INTRONEXON" VARCHAR2(10 BYTE), +"REGULOME" VARCHAR2(10 BYTE), +"RECOMBINATIONRATE" NUMBER(18,6) + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/biomart/bio_concept_code.sql b/ddl/oracle/biomart/bio_concept_code.sql index 85633dfc..a3bb434e 100644 --- a/ddl/oracle/biomart/bio_concept_code.sql +++ b/ddl/oracle/biomart/bio_concept_code.sql @@ -17,6 +17,14 @@ ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; +-- +-- Type: TRIGGER; Owner: BIOMART; Name: TMP_TRG_BIO_CONCEPT_CODE_ID +-- + CREATE OR REPLACE TRIGGER "BIOMART"."TMP_TRG_BIO_CONCEPT_CODE_ID" before insert on "BIOMART"."BIO_CONCEPT_CODE" for each row begin if inserting then if :NEW."BIO_CONCEPT_CODE_ID" is null then select SEQ_BIO_DATA_ID.nextval into :NEW."BIO_CONCEPT_CODE_ID" from dual; end if; end if; end; + +/ +ALTER TRIGGER "BIOMART"."TMP_TRG_BIO_CONCEPT_CODE_ID" ENABLE; + -- -- Type: TRIGGER; Owner: BIOMART; Name: TRG_BIO_CONCEPT_CODE_ID -- diff --git a/ddl/oracle/biomart/bio_experiment.sql b/ddl/oracle/biomart/bio_experiment.sql index 68a5808d..84a10357 100644 --- a/ddl/oracle/biomart/bio_experiment.sql +++ b/ddl/oracle/biomart/bio_experiment.sql @@ -3,18 +3,18 @@ -- CREATE TABLE "BIOMART"."BIO_EXPERIMENT" ( "BIO_EXPERIMENT_ID" NUMBER(18,0) NOT NULL ENABLE, -"BIO_EXPERIMENT_TYPE" VARCHAR2(200), -"TITLE" VARCHAR2(1000), -"DESCRIPTION" VARCHAR2(4000), -"DESIGN" VARCHAR2(2000), +"BIO_EXPERIMENT_TYPE" VARCHAR2(200 BYTE), +"TITLE" VARCHAR2(1000 BYTE), +"DESCRIPTION" VARCHAR2(4000 BYTE), +"DESIGN" VARCHAR2(2000 BYTE), "START_DATE" DATE, "COMPLETION_DATE" DATE, -"PRIMARY_INVESTIGATOR" VARCHAR2(400), -"CONTACT_FIELD" VARCHAR2(400), -"ETL_ID" VARCHAR2(100), +"PRIMARY_INVESTIGATOR" VARCHAR2(400 BYTE), +"CONTACT_FIELD" VARCHAR2(400 BYTE), +"ETL_ID" VARCHAR2(100 BYTE), "STATUS" VARCHAR2(100 BYTE), -"OVERALL_DESIGN" VARCHAR2(2000), -"ACCESSION" VARCHAR2(100), +"OVERALL_DESIGN" VARCHAR2(2000 BYTE), +"ACCESSION" VARCHAR2(100 BYTE), "ENTRYDT" DATE, "UPDATED" DATE, "INSTITUTION" VARCHAR2(400 BYTE), @@ -34,14 +34,12 @@ CREATE INDEX "BIOMART"."BIO_EXP_ACEN_IDX" ON "BIOMART"."BIO_EXPERIMENT" ("ACCESSION") TABLESPACE "INDX" PARALLEL 4 ; - -- -- Type: INDEX; Owner: BIOMART; Name: BIO_EXP_TYPE_IDX -- CREATE INDEX "BIOMART"."BIO_EXP_TYPE_IDX" ON "BIOMART"."BIO_EXPERIMENT" ("BIO_EXPERIMENT_TYPE") TABLESPACE "INDX" PARALLEL 4 ; - -- -- Type: TRIGGER; Owner: BIOMART; Name: TRG_BIO_EXPERIMENT_ID -- diff --git a/ddl/oracle/biomart/faceted_search.sql b/ddl/oracle/biomart/faceted_search.sql new file mode 100644 index 00000000..fdaabbd9 --- /dev/null +++ b/ddl/oracle/biomart/faceted_search.sql @@ -0,0 +1,19 @@ +-- +-- Type: TABLE; Owner: BIOMART; Name: FACETED_SEARCH +-- + CREATE TABLE "BIOMART"."FACETED_SEARCH" + ( "ANALYSIS_ID" NUMBER(18,0), +"STUDY" NUMBER(18,0), +"STUDY_ID" NUMBER(18,0), +"DISEASE" NVARCHAR2(510), +"ANALYSES" NVARCHAR2(200), +"DATA_TYPE" VARCHAR2(50 BYTE), +"PLATFORM" VARCHAR2(20 BYTE), +"OBSERVATION" NVARCHAR2(200), +"FACET_ID" NUMBER(10,0), + PRIMARY KEY ("FACET_ID") + USING INDEX + TABLESPACE "BIOMART" ENABLE + ) SEGMENT CREATION IMMEDIATE +NOCOMPRESS NOLOGGING + TABLESPACE "BIOMART" ; diff --git a/ddl/oracle/biomart/gwas_partition.sql b/ddl/oracle/biomart/gwas_partition.sql new file mode 100644 index 00000000..bad1ba74 --- /dev/null +++ b/ddl/oracle/biomart/gwas_partition.sql @@ -0,0 +1,24 @@ +-- +-- Type: TABLE; Owner: BIOMART; Name: GWAS_PARTITION +-- + CREATE TABLE "BIOMART"."GWAS_PARTITION" + ( "BIO_ASY_ANALYSIS_GWAS_ID" NUMBER(18,0) NOT NULL ENABLE, +"BIO_ASSAY_ANALYSIS_ID" NUMBER(18,0) NOT NULL ENABLE, +"RS_ID" NVARCHAR2(50), +"P_VALUE_CHAR" VARCHAR2(100 BYTE), +"P_VALUE" BINARY_DOUBLE, +"LOG_P_VALUE" BINARY_DOUBLE, +"ETL_ID" NUMBER(18,0), +"EXT_DATA" VARCHAR2(4000 BYTE) + ) +COMPRESS BASIC NOLOGGING + TABLESPACE "BIOMART" + PARTITION BY LIST ("BIO_ASSAY_ANALYSIS_ID") +(PARTITION "1" VALUES (1) SEGMENT CREATION DEFERRED +COMPRESS BASIC NOLOGGING + TABLESPACE "BIOMART" ) ; +-- +-- Type: REF_CONSTRAINT; Owner: BIOMART; Name: BIO_AA_GWAS_FK +-- +ALTER TABLE "BIOMART"."GWAS_PARTITION" ADD CONSTRAINT "BIO_AA_GWAS_FK" FOREIGN KEY ("BIO_ASSAY_ANALYSIS_ID") + REFERENCES "BIOMART"."BIO_ASSAY_ANALYSIS" ("BIO_ASSAY_ANALYSIS_ID") ENABLE; diff --git a/ddl/oracle/biomart/items.json b/ddl/oracle/biomart/items.json index ca5f8a92..82d8280d 100644 --- a/ddl/oracle/biomart/items.json +++ b/ddl/oracle/biomart/items.json @@ -232,6 +232,17 @@ "name" : "BIOMARKER_PATHWAY_UID" }, "parents" : [ ] + }, { + "child" : { + "type" : "REF_CONSTRAINT", + "owner" : "BIOMART", + "name" : "BIO_AA_GWAS_FK" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "GWAS_PARTITION" + } ] }, { "child" : { "type" : "TABLE", @@ -405,6 +416,17 @@ "name" : "BIO_ASSAY_ANALYSIS_EQTL" }, "parents" : [ ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS_EQTL_IDX1" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS_EQTL" + } ] }, { "child" : { "type" : "TABLE", @@ -412,6 +434,17 @@ "name" : "BIO_ASSAY_ANALYSIS_EXT" }, "parents" : [ ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS_EXT_IDX1" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS_EXT" + } ] }, { "child" : { "type" : "TABLE", @@ -2428,6 +2461,13 @@ "owner" : "BIOMART", "name" : "BIO_CONTENT" } ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "FACETED_SEARCH" + }, + "parents" : [ ] }, { "child" : { "type" : "FUNCTION", @@ -2470,6 +2510,28 @@ "name" : "GSE_PROBESET" }, "parents" : [ ] + }, { + "child" : { + "type" : "VIEW", + "owner" : "BIOMART", + "name" : "GWAS_ANLYSIS" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS" + } ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "GWAS_PARTITION" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS" + } ] }, { "child" : { "type" : "TABLE", @@ -2593,6 +2655,20 @@ "name" : "TESTS" }, "parents" : [ ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "TMP_ANALYSIS_EQTL_TOP500" + }, + "parents" : [ ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "TMP_ANALYSIS_GWAS_TOP500" + }, + "parents" : [ ] }, { "child" : { "type" : "TABLE", @@ -2635,6 +2711,21 @@ "name" : "TMP_PROJECT_DISEASE" }, "parents" : [ ] + }, { + "child" : { + "type" : "TRIGGER", + "owner" : "BIOMART", + "name" : "TMP_TRG_BIO_CONCEPT_CODE_ID" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_CONCEPT_CODE" + }, { + "type" : "SEQUENCE", + "owner" : "BIOMART", + "name" : "SEQ_BIO_DATA_ID" + } ] }, { "child" : { "type" : "TRIGGER", @@ -2680,6 +2771,32 @@ "owner" : "BIOMART", "name" : "SEQ_BIO_DATA_ID" } ] + }, { + "child" : { + "type" : "TRIGGER", + "owner" : "BIOMART", + "name" : "TRG_BIO_ANALYSIS_ATT_BAAL" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ANALYSIS_ATTRIBUTE" + }, { + "type" : "VIEW", + "owner" : "SEARCHAPP", + "name" : "SOLR_KEYWORDS_LINEAGE" + } ] + }, { + "child" : { + "type" : "TRIGGER", + "owner" : "BIOMART", + "name" : "TRG_BIO_ANALYSIS_ATT_LINEAGE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ANALYSIS_ATTRIBUTE_LINEAGE" + } ] }, { "child" : { "type" : "TRIGGER", @@ -2834,6 +2951,21 @@ "owner" : "BIOMART", "name" : "SEQ_BIO_DATA_ID" } ] + }, { + "child" : { + "type" : "TRIGGER", + "owner" : "BIOMART", + "name" : "TRG_BIO_ASY_ANALYSIS_EQTL_ID" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS_EQTL" + }, { + "type" : "SEQUENCE", + "owner" : "BIOMART", + "name" : "SEQ_BIO_DATA_ID" + } ] }, { "child" : { "type" : "TRIGGER", @@ -3468,6 +3600,28 @@ "owner" : "BIOMART", "name" : "SEQ_CLINICAL_TRIAL_DESIGN_ID" } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "BIOMART", + "name" : "T_A_GAE_T500_IDX" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "TMP_ANALYSIS_EQTL_TOP500" + } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "BIOMART", + "name" : "T_A_GE_T500_IDX" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "TMP_ANALYSIS_EQTL_TOP500" + } ] }, { "child" : { "type" : "VIEW", @@ -3688,6 +3842,13 @@ "name" : "BIOMARKER_PATHWAY_UID" }, "file" : "biomart/functions/biomarker_pathway_uid.sql" + }, { + "item" : { + "type" : "REF_CONSTRAINT", + "owner" : "BIOMART", + "name" : "BIO_AA_GWAS_FK" + }, + "file" : "biomart/gwas_partition.sql" }, { "item" : { "type" : "TABLE", @@ -3793,6 +3954,13 @@ "name" : "BIO_ASSAY_ANALYSIS_EQTL" }, "file" : "biomart/bio_assay_analysis_eqtl.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS_EQTL_IDX1" + }, + "file" : "biomart/bio_assay_analysis_eqtl.sql" }, { "item" : { "type" : "TABLE", @@ -3800,6 +3968,13 @@ "name" : "BIO_ASSAY_ANALYSIS_EXT" }, "file" : "biomart/bio_assay_analysis_ext.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS_EXT_IDX1" + }, + "file" : "biomart/bio_assay_analysis_ext.sql" }, { "item" : { "type" : "TABLE", @@ -5172,6 +5347,13 @@ "name" : "EXT_FILE_CNT_CNT_REPO_FK" }, "file" : "biomart/bio_content.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "FACETED_SEARCH" + }, + "file" : "biomart/faceted_search.sql" }, { "item" : { "type" : "FUNCTION", @@ -5214,6 +5396,20 @@ "name" : "GSE_PROBESET" }, "file" : "biomart/gse_probeset.sql" + }, { + "item" : { + "type" : "VIEW", + "owner" : "BIOMART", + "name" : "GWAS_ANLYSIS" + }, + "file" : "biomart/views/gwas_anlysis.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "GWAS_PARTITION" + }, + "file" : "biomart/gwas_partition.sql" }, { "item" : { "type" : "TABLE", @@ -5333,6 +5529,20 @@ "name" : "TESTS" }, "file" : "biomart/tests.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "TMP_ANALYSIS_EQTL_TOP500" + }, + "file" : "biomart/tmp_analysis_eqtl_top500.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "TMP_ANALYSIS_GWAS_TOP500" + }, + "file" : "biomart/tmp_analysis_gwas_top500.sql" }, { "item" : { "type" : "TABLE", @@ -5375,6 +5585,13 @@ "name" : "TMP_PROJECT_DISEASE" }, "file" : "biomart/tmp_project_disease.sql" + }, { + "item" : { + "type" : "TRIGGER", + "owner" : "BIOMART", + "name" : "TMP_TRG_BIO_CONCEPT_CODE_ID" + }, + "file" : "biomart/bio_concept_code.sql" }, { "item" : { "type" : "TRIGGER", @@ -5396,6 +5613,20 @@ "name" : "TRG_BIO_ANALYSIS_ATTRIBUTE_ID" }, "file" : "biomart/bio_analysis_attribute.sql" + }, { + "item" : { + "type" : "TRIGGER", + "owner" : "BIOMART", + "name" : "TRG_BIO_ANALYSIS_ATT_BAAL" + }, + "file" : "biomart/_cross.sql" + }, { + "item" : { + "type" : "TRIGGER", + "owner" : "BIOMART", + "name" : "TRG_BIO_ANALYSIS_ATT_LINEAGE" + }, + "file" : "biomart/bio_analysis_attribute_lineage.sql" }, { "item" : { "type" : "TRIGGER", @@ -5466,6 +5697,13 @@ "name" : "TRG_BIO_ASY_ANALYSIS_DATA_ID" }, "file" : "biomart/bio_assay_analysis_data.sql" + }, { + "item" : { + "type" : "TRIGGER", + "owner" : "BIOMART", + "name" : "TRG_BIO_ASY_ANALYSIS_EQTL_ID" + }, + "file" : "biomart/bio_assay_analysis_eqtl.sql" }, { "item" : { "type" : "TRIGGER", @@ -5760,6 +5998,20 @@ "name" : "TRIG_CLINICAL_TRIAL_DESIGN_ID " }, "file" : "biomart/ctd_full.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "BIOMART", + "name" : "T_A_GAE_T500_IDX" + }, + "file" : "biomart/tmp_analysis_eqtl_top500.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "BIOMART", + "name" : "T_A_GE_T500_IDX" + }, + "file" : "biomart/tmp_analysis_eqtl_top500.sql" }, { "item" : { "type" : "VIEW", @@ -5775,4 +6027,4 @@ }, "file" : "biomart/views/vw_faceted_search_disease.sql" } ] -} +} \ No newline at end of file diff --git a/ddl/oracle/biomart/mesh.sql b/ddl/oracle/biomart/mesh.sql index 00a91333..fed003ae 100644 --- a/ddl/oracle/biomart/mesh.sql +++ b/ddl/oracle/biomart/mesh.sql @@ -2,7 +2,7 @@ -- Type: TABLE; Owner: BIOMART; Name: MESH -- CREATE TABLE "BIOMART"."MESH" - ( "UI" VARCHAR2(20 BYTE) NOT NULL ENABLE, + ( "UI" VARCHAR2(20 BYTE), "MH" VARCHAR2(200 BYTE), "MN" VARCHAR2(200 BYTE), PRIMARY KEY ("UI") diff --git a/ddl/oracle/biomart/tmp_analysis_eqtl_top500.sql b/ddl/oracle/biomart/tmp_analysis_eqtl_top500.sql new file mode 100644 index 00000000..9f2918ee --- /dev/null +++ b/ddl/oracle/biomart/tmp_analysis_eqtl_top500.sql @@ -0,0 +1,29 @@ +-- +-- Type: TABLE; Owner: BIOMART; Name: TMP_ANALYSIS_EQTL_TOP500 +-- + CREATE TABLE "BIOMART"."TMP_ANALYSIS_EQTL_TOP500" + ( "BIO_ASY_ANALYSIS_EQTL_ID" NUMBER(22,0) NOT NULL ENABLE, +"BIO_ASSAY_ANALYSIS_ID" NUMBER(22,0) NOT NULL ENABLE, +"RS_ID" NVARCHAR2(50), +"P_VALUE" BINARY_DOUBLE, +"LOG_P_VALUE" BINARY_DOUBLE, +"ETL_ID" NUMBER(18,0), +"EXT_DATA" VARCHAR2(4000 BYTE), +"P_VALUE_CHAR" VARCHAR2(100 BYTE), +"GENE" VARCHAR2(50 BYTE), +"CIS_TRANS" VARCHAR2(10 BYTE), +"DISTANCE_FROM_GENE" VARCHAR2(10 BYTE), +"RNUM" NUMBER + ) SEGMENT CREATION IMMEDIATE +NOCOMPRESS NOLOGGING + TABLESPACE "BIOMART" ; +-- +-- Type: INDEX; Owner: BIOMART; Name: T_A_GAE_T500_IDX +-- +CREATE INDEX "BIOMART"."T_A_GAE_T500_IDX" ON "BIOMART"."TMP_ANALYSIS_EQTL_TOP500" ("BIO_ASSAY_ANALYSIS_ID") +TABLESPACE "INDX" ; +-- +-- Type: INDEX; Owner: BIOMART; Name: T_A_GE_T500_IDX +-- +CREATE INDEX "BIOMART"."T_A_GE_T500_IDX" ON "BIOMART"."TMP_ANALYSIS_EQTL_TOP500" ("RS_ID") +TABLESPACE "INDX" ; diff --git a/ddl/oracle/biomart/tmp_analysis_gwas_top500.sql b/ddl/oracle/biomart/tmp_analysis_gwas_top500.sql new file mode 100644 index 00000000..f385e2f3 --- /dev/null +++ b/ddl/oracle/biomart/tmp_analysis_gwas_top500.sql @@ -0,0 +1,16 @@ +-- +-- Type: TABLE; Owner: BIOMART; Name: TMP_ANALYSIS_GWAS_TOP500 +-- + CREATE TABLE "BIOMART"."TMP_ANALYSIS_GWAS_TOP500" + ( "BIO_ASY_ANALYSIS_GWAS_ID" NUMBER(18,0) NOT NULL ENABLE, +"BIO_ASSAY_ANALYSIS_ID" NUMBER(18,0) NOT NULL ENABLE, +"RS_ID" NVARCHAR2(50), +"P_VALUE" BINARY_DOUBLE, +"LOG_P_VALUE" BINARY_DOUBLE, +"ETL_ID" NUMBER(18,0), +"EXT_DATA" VARCHAR2(4000 BYTE), +"P_VALUE_CHAR" VARCHAR2(100 BYTE), +"RNUM" NUMBER + ) SEGMENT CREATION IMMEDIATE +NOCOMPRESS NOLOGGING + TABLESPACE "BIOMART" ; diff --git a/ddl/oracle/biomart/views/bio_marker_correl_mv.sql b/ddl/oracle/biomart/views/bio_marker_correl_mv.sql index 4e29f34e..9590a2a3 100644 --- a/ddl/oracle/biomart/views/bio_marker_correl_mv.sql +++ b/ddl/oracle/biomart/views/bio_marker_correl_mv.sql @@ -1,121 +1,98 @@ -- -- Type: MATERIALIZED_VIEW; Owner: BIOMART; Name: BIO_MARKER_CORREL_MV -- - CREATE MATERIALIZED VIEW "BIOMART"."BIO_MARKER_CORREL_MV" ("BIO_MARKER_ID", "ASSO_BIO_MARKER_ID", "CORREL_TYPE", "MV_ID") - ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING - TABLESPACE "TRANSMART" - BUILD IMMEDIATE - USING INDEX - REFRESH FORCE ON DEMAND - USING DEFAULT LOCAL ROLLBACK SEGMENT - USING ENFORCED CONSTRAINTS DISABLE QUERY REWRITE - AS SELECT DISTINCT - b.bio_marker_id, - b.bio_marker_id AS asso_bio_marker_id, - 'GENE' AS correl_type, - 1 AS mv_id - FROM - biomart.bio_marker b - WHERE - b.bio_marker_type = 'GENE' - UNION - SELECT DISTINCT - b.bio_marker_id, - b.bio_marker_id AS asso_bio_marker_id, - 'PROTEIN' AS correl_type, - 4 AS mv_id - FROM - biomart.bio_marker b - WHERE - b.bio_marker_type = 'PROTEIN' - UNION - SELECT DISTINCT - b.bio_marker_id, - b.bio_marker_id AS asso_bio_marker_id, - 'MIRNA' AS correl_type, - 7 AS mv_id - FROM - biomart.bio_marker b - WHERE - b.bio_marker_type = 'MIRNA' - UNION - SELECT DISTINCT - c.bio_data_id AS bio_marker_id, - c.asso_bio_data_id AS asso_bio_marker_id, - 'PATHWAY GENE' AS correl_type, - 2 AS mv_id - FROM - biomart.bio_marker b, - biomart.bio_data_correlation c, - biomart.bio_data_correl_descr d - WHERE - b.bio_marker_id = c.bio_data_id - AND c.bio_data_correl_descr_id = d.bio_data_correl_descr_id - AND b.primary_source_code <> 'ARIADNE' - AND d.correlation = 'PATHWAY GENE' - UNION - SELECT DISTINCT - c.bio_data_id AS bio_marker_id, - c.asso_bio_data_id AS asso_bio_marker_id, - 'HOMOLOGENE_GENE' AS correl_type, - 3 AS mv_id - FROM - biomart.bio_marker b, - biomart.bio_data_correlation c, - biomart.bio_data_correl_descr d - WHERE - b.bio_marker_id = c.bio_data_id - AND c.bio_data_correl_descr_id = d.bio_data_correl_descr_id - AND d.correlation = 'HOMOLOGENE GENE' - UNION - SELECT DISTINCT - c.bio_data_id AS bio_marker_id, - c.asso_bio_data_id AS asso_bio_marker_id, - 'PROTEIN TO GENE' AS correl_type, - 5 AS mv_id - FROM - biomart.bio_marker b, - biomart.bio_data_correlation c, - biomart.bio_data_correl_descr d - WHERE - b.bio_marker_id = c.bio_data_id - AND c.bio_data_correl_descr_id = d.bio_data_correl_descr_id - AND d.correlation = 'PROTEIN TO GENE' - UNION - SELECT DISTINCT - c.bio_data_id AS bio_marker_id, - c.asso_bio_data_id AS asso_bio_marker_id, - 'GENE TO PROTEIN' AS correl_type, - 6 AS mv_id - FROM - biomart.bio_marker b, - biomart.bio_data_correlation c, - biomart.bio_data_correl_descr d - WHERE - b.bio_marker_id = c.bio_data_id - AND c.bio_data_correl_descr_id = d.bio_data_correl_descr_id - AND d.correlation = 'GENE TO PROTEIN' - UNION - SELECT - c1.bio_data_id, - c2.asso_bio_data_id, - 'PATHWAY TO PROTEIN' as correl_type, - 8 AS mv_id - FROM - bio_data_correlation c1 - INNER JOIN bio_data_correlation c2 ON c1.asso_bio_data_id = c2.bio_data_id - INNER JOIN bio_data_correl_descr d1 ON c1.bio_data_correl_descr_id = d1.bio_data_correl_descr_id - INNER JOIN bio_data_correl_descr d2 ON c2.bio_data_correl_descr_id = d2.bio_data_correl_descr_id - WHERE d1.correlation = 'PATHWAY GENE' - AND d2.correlation = 'GENE TO PROTEIN' - UNION - SELECT DISTINCT - b.bio_marker_id, - b.bio_marker_id AS asso_bio_marker_id, - 'METABOLITE' AS correl_type, - 9 AS mv_id - FROM - biomart.bio_marker b - WHERE -b.bio_marker_type = 'METABOLITE'; + CREATE MATERIALIZED VIEW "BIOMART"."BIO_MARKER_CORREL_MV" ("BIO_MARKER_ID", "ASSO_BIO_MARKER_ID", "CORREL_TYPE", "MV_ID") + ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 + TABLESPACE "TRANSMART" + BUILD IMMEDIATE + USING INDEX + REFRESH FORCE ON DEMAND + USING DEFAULT LOCAL ROLLBACK SEGMENT + USING ENFORCED CONSTRAINTS DISABLE QUERY REWRITE + AS SELECT DISTINCT b.bio_marker_id, + b.bio_marker_id AS asso_bio_marker_id, + 'GENE' AS correl_type, + 1 AS mv_id + FROM biomart.bio_marker b + WHERE b.bio_marker_type = 'GENE' + UNION + SELECT DISTINCT b.bio_marker_id, + b.bio_marker_id AS asso_bio_marker_id, + 'PROTEIN' AS correl_type, + 4 AS mv_id + FROM biomart.bio_marker b + WHERE b.bio_marker_type = 'PROTEIN' + UNION + SELECT DISTINCT b.bio_marker_id, + b.bio_marker_id AS asso_bio_marker_id, + 'MIRNA' AS correl_type, + 7 AS mv_id + FROM biomart.bio_marker b + WHERE b.bio_marker_type = 'MIRNA' + UNION + SELECT DISTINCT c.bio_data_id AS bio_marker_id, + c.asso_bio_data_id AS asso_bio_marker_id, + 'PATHWAY GENE' AS correl_type, + 2 AS mv_id + FROM biomart.bio_marker b, + biomart.bio_data_correlation c, + biomart.bio_data_correl_descr d + WHERE b.bio_marker_id = c.bio_data_id + AND c.bio_data_correl_descr_id = d.bio_data_correl_descr_id + AND b.primary_source_code <> 'ARIADNE' + AND d.correlation = 'PATHWAY GENE' + UNION + SELECT DISTINCT c.bio_data_id AS bio_marker_id, + c.asso_bio_data_id AS asso_bio_marker_id, + 'HOMOLOGENE_GENE' AS correl_type, + 3 AS mv_id + FROM biomart.bio_marker b, + biomart.bio_data_correlation c, + biomart.bio_data_correl_descr d + WHERE b.bio_marker_id = c.bio_data_id + AND c.bio_data_correl_descr_id = d.bio_data_correl_descr_id + AND d.correlation = 'HOMOLOGENE GENE' + UNION + SELECT DISTINCT c.bio_data_id AS bio_marker_id, + c.asso_bio_data_id AS asso_bio_marker_id, + 'PROTEIN TO GENE' AS correl_type, + 5 AS mv_id + FROM biomart.bio_marker b, + biomart.bio_data_correlation c, + biomart.bio_data_correl_descr d + WHERE b.bio_marker_id = c.bio_data_id + AND c.bio_data_correl_descr_id = d.bio_data_correl_descr_id + AND d.correlation = 'PROTEIN TO GENE' + UNION + SELECT DISTINCT c.bio_data_id AS bio_marker_id, + c.asso_bio_data_id AS asso_bio_marker_id, + 'GENE TO PROTEIN' AS correl_type, + 6 AS mv_id + FROM biomart.bio_marker b, + biomart.bio_data_correlation c, + biomart.bio_data_correl_descr d + WHERE b.bio_marker_id = c.bio_data_id + AND c.bio_data_correl_descr_id = d.bio_data_correl_descr_id + AND d.correlation = 'GENE TO PROTEIN' + UNION + SELECT c1.bio_data_id, + c2.asso_bio_data_id, + 'PATHWAY TO PROTEIN' AS correl_type, + 8 AS mv_id + FROM bio_data_correlation c1 + INNER JOIN bio_data_correlation c2 + ON c1.asso_bio_data_id = c2.bio_data_id + INNER JOIN bio_data_correl_descr d1 + ON c1.bio_data_correl_descr_id = d1.bio_data_correl_descr_id + INNER JOIN bio_data_correl_descr d2 + ON c2.bio_data_correl_descr_id = d2.bio_data_correl_descr_id + WHERE d1.correlation = 'PATHWAY GENE' + AND d2.correlation = 'GENE TO PROTEIN' + UNION + SELECT DISTINCT b.bio_marker_id, + b.bio_marker_id AS asso_bio_marker_id, + 'METABOLITE' AS correl_type, + 9 AS mv_id + FROM biomart.bio_marker b + WHERE b.bio_marker_type = 'METABOLITE'; diff --git a/ddl/oracle/biomart/views/gwas_anlysis.sql b/ddl/oracle/biomart/views/gwas_anlysis.sql new file mode 100644 index 00000000..742fc6f8 --- /dev/null +++ b/ddl/oracle/biomart/views/gwas_anlysis.sql @@ -0,0 +1,5 @@ +-- +-- Type: VIEW; Owner: BIOMART; Name: GWAS_ANLYSIS +-- +CREATE OR REPLACE FORCE EDITIONABLE VIEW "BIOMART"."GWAS_ANLYSIS" ("BIO_ASSAY_ANALYSIS_ID", "ETL_ID", "ANALYSIS_NAME", "BIO_ASSAY_DATA_TYPE") AS +SELECT to_char(bio_assay_analysis_id) bio_assay_analysis_id, etl_id, analysis_name, bio_assay_data_type from biomart.bio_assay_analysis where bio_assay_data_type not in ('Gene Expression'); diff --git a/ddl/oracle/biomart/views/vw_faceted_search.sql b/ddl/oracle/biomart/views/vw_faceted_search.sql index a80463ab..24feb530 100644 --- a/ddl/oracle/biomart/views/vw_faceted_search.sql +++ b/ddl/oracle/biomart/views/vw_faceted_search.sql @@ -6,7 +6,7 @@ ,be.bio_experiment_id as STUDY ,be.bio_experiment_id as STUDY_ID ,ba.analysis_type as ANALYSES -,ba.bio_assay_data_type as DATA_TYPE +,ba.bio_assay_data_type as DATA_TYPE ,bplat.platform_accession as PLATFORM ,bplat.platform_description as PLATFORM_DESCRIPTION ,bplat.platform_vendor as PLATFORM_VENDOR @@ -37,7 +37,7 @@ ,bae.research_unit as RESEARCH_UNIT ,row_number() over (order by ba.bio_assay_analysis_id) as FACET_ID from bio_assay_analysis ba -Join bio_experiment be +Join bio_experiment be on ba.etl_id = be.accession left outer join bio_assay_analysis_ext bae on bae.bio_assay_analysis_id = ba.bio_assay_analysis_id @@ -51,5 +51,5 @@ left outer join bio_observation bpobs on bdpobs.bio_observation_id = bpobs.bio_observation_id left outer join bio_asy_analysis_pltfm baap on baap.bio_asy_analysis_pltfm_id = ba.bio_asy_analysis_pltfm_id -WHERE lower(be.bio_experiment_type) = 'experiment'; +where lower(be.bio_experiment_type) = 'experiment'; From e544d34be93317e129d00cfe7186442375e02f0d Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Tue, 12 Aug 2014 12:47:23 +0100 Subject: [PATCH 27/31] tm_lz updates from oracle test server --- ddl/oracle/tm_lz/items.json | 116 ++++++++++++++++++ ddl/oracle/tm_lz/lt_chromosomal_region.sql | 2 +- ddl/oracle/tm_lz/lt_snp_calls_by_gsm.sql | 10 ++ ddl/oracle/tm_lz/lt_snp_copy_number.sql | 12 ++ ddl/oracle/tm_lz/lt_snp_gene_map.sql | 9 ++ ddl/oracle/tm_lz/lt_src_acgh_data.sql | 2 +- ddl/oracle/tm_lz/lt_src_cel_files.sql | 8 +- ddl/oracle/tm_lz/lt_src_clinical_data.sql | 10 +- ddl/oracle/tm_lz/lt_src_rnaseq_data.sql | 2 +- ddl/oracle/tm_lz/lt_src_study_metadata.sql | 2 +- ddl/oracle/tm_lz/lz_src_analysis_metadata.sql | 4 +- ddl/oracle/tm_lz/rwg_analysis_data_ext.sql | 2 +- ddl/oracle/tm_lz/rwg_analysis_ext.sql | 4 +- ddl/oracle/tm_lz/rwg_cohorts_ext.sql | 2 +- ddl/oracle/tm_lz/rwg_samples_ext.sql | 2 +- 15 files changed, 171 insertions(+), 16 deletions(-) create mode 100644 ddl/oracle/tm_lz/lt_snp_calls_by_gsm.sql create mode 100644 ddl/oracle/tm_lz/lt_snp_copy_number.sql create mode 100644 ddl/oracle/tm_lz/lt_snp_gene_map.sql diff --git a/ddl/oracle/tm_lz/items.json b/ddl/oracle/tm_lz/items.json index 57a44cf2..52fb2fcb 100644 --- a/ddl/oracle/tm_lz/items.json +++ b/ddl/oracle/tm_lz/items.json @@ -6,6 +6,52 @@ "name" : "CLINICAL_TRIAL_METADATA_EXT" }, "parents" : [ ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_LZ", + "name" : "I2B2_LOAD_CLINICAL_DATA_BACKUP" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_OBS_ENROLL_DAYS" + }, { + "type" : "TABLE", + "owner" : "I2B2DEMODATA", + "name" : "OBSERVATION_FACT" + }, { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LT_SRC_CLINICAL_DATA" + }, { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LT_SRC_SUBJ_ENROLL_DATE" + }, { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LZ_SRC_CLINICAL_DATA" + }, { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "WRK_CLINICAL_DATA" + }, { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "WT_TRIAL_NODES" + } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "TM_LZ", + "name" : "IDX_SCD_STUDY" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LT_SRC_CLINICAL_DATA" + } ] }, { "child" : { "type" : "TABLE", @@ -55,6 +101,27 @@ "name" : "LT_RNASEQ_ANNOTATION" }, "parents" : [ ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LT_SNP_CALLS_BY_GSM" + }, + "parents" : [ ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LT_SNP_COPY_NUMBER" + }, + "parents" : [ ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LT_SNP_GENE_MAP" + }, + "parents" : [ ] }, { "child" : { "type" : "TABLE", @@ -463,6 +530,13 @@ "owner" : "TM_LZ", "name" : "SEQ_ETL_ID" } ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_LZ", + "name" : "UTIL_GRANT_ALL" + }, + "parents" : [ ] }, { "child" : { "type" : "TABLE", @@ -485,6 +559,20 @@ "name" : "CLINICAL_TRIAL_METADATA_EXT" }, "file" : "tm_lz/clinical_trial_metadata_ext.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_LZ", + "name" : "I2B2_LOAD_CLINICAL_DATA_BACKUP" + }, + "file" : "tm_lz/procedures/i2b2_load_clinical_data_backup.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "TM_LZ", + "name" : "IDX_SCD_STUDY" + }, + "file" : "tm_lz/lt_src_clinical_data.sql" }, { "item" : { "type" : "TABLE", @@ -534,6 +622,27 @@ "name" : "LT_RNASEQ_ANNOTATION" }, "file" : "tm_lz/lt_rnaseq_annotation.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LT_SNP_CALLS_BY_GSM" + }, + "file" : "tm_lz/lt_snp_calls_by_gsm.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LT_SNP_COPY_NUMBER" + }, + "file" : "tm_lz/lt_snp_copy_number.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LT_SNP_GENE_MAP" + }, + "file" : "tm_lz/lt_snp_gene_map.sql" }, { "item" : { "type" : "TABLE", @@ -926,6 +1035,13 @@ "name" : "TRG_LZ_SRC_ANALYSIS_META_ID" }, "file" : "tm_lz/lz_src_analysis_metadata.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_LZ", + "name" : "UTIL_GRANT_ALL" + }, + "file" : "tm_lz/procedures/util_grant_all.sql" }, { "item" : { "type" : "TABLE", diff --git a/ddl/oracle/tm_lz/lt_chromosomal_region.sql b/ddl/oracle/tm_lz/lt_chromosomal_region.sql index 741e986c..f2e0e85e 100644 --- a/ddl/oracle/tm_lz/lt_chromosomal_region.sql +++ b/ddl/oracle/tm_lz/lt_chromosomal_region.sql @@ -21,7 +21,7 @@ CREATE SEQUENCE "TM_LZ"."LT_CHROMO_REGION_ID_SEQ" MINVALUE 1 MAXVALUE 99999999 CONSTRAINT "LT_CHROMOSOMAL_REGION_PKEY" PRIMARY KEY ("REGION_ID") USING INDEX TABLESPACE "TRANSMART" ENABLE - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; -- diff --git a/ddl/oracle/tm_lz/lt_snp_calls_by_gsm.sql b/ddl/oracle/tm_lz/lt_snp_calls_by_gsm.sql new file mode 100644 index 00000000..b87d9e70 --- /dev/null +++ b/ddl/oracle/tm_lz/lt_snp_calls_by_gsm.sql @@ -0,0 +1,10 @@ +-- +-- Type: TABLE; Owner: TM_LZ; Name: LT_SNP_CALLS_BY_GSM +-- + CREATE TABLE "TM_LZ"."LT_SNP_CALLS_BY_GSM" + ( "GSM_NUM" VARCHAR2(10 BYTE), +"SNP_NAME" VARCHAR2(100 BYTE), +"SNP_CALLS" VARCHAR2(4 BYTE) + ) SEGMENT CREATION DEFERRED +NOCOMPRESS LOGGING + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_lz/lt_snp_copy_number.sql b/ddl/oracle/tm_lz/lt_snp_copy_number.sql new file mode 100644 index 00000000..7d53d0e2 --- /dev/null +++ b/ddl/oracle/tm_lz/lt_snp_copy_number.sql @@ -0,0 +1,12 @@ +-- +-- Type: TABLE; Owner: TM_LZ; Name: LT_SNP_COPY_NUMBER +-- + CREATE TABLE "TM_LZ"."LT_SNP_COPY_NUMBER" + ( "SNP_NAME" VARCHAR2(50 BYTE), +"CHROM" VARCHAR2(2 BYTE), +"CHROM_POS" NUMBER(20,0), +"COPY_NUMBER" FLOAT(53), +"GSM_NUM" VARCHAR2(10 BYTE) + ) SEGMENT CREATION DEFERRED +NOCOMPRESS LOGGING + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_lz/lt_snp_gene_map.sql b/ddl/oracle/tm_lz/lt_snp_gene_map.sql new file mode 100644 index 00000000..0b9a1a3b --- /dev/null +++ b/ddl/oracle/tm_lz/lt_snp_gene_map.sql @@ -0,0 +1,9 @@ +-- +-- Type: TABLE; Owner: TM_LZ; Name: LT_SNP_GENE_MAP +-- + CREATE TABLE "TM_LZ"."LT_SNP_GENE_MAP" + ( "SNP_NAME" VARCHAR2(256 BYTE), +"ENTREZ_GENE_ID" NUMBER + ) SEGMENT CREATION DEFERRED +NOCOMPRESS LOGGING + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_lz/lt_src_acgh_data.sql b/ddl/oracle/tm_lz/lt_src_acgh_data.sql index b1421bdc..be41c32e 100644 --- a/ddl/oracle/tm_lz/lt_src_acgh_data.sql +++ b/ddl/oracle/tm_lz/lt_src_acgh_data.sql @@ -12,6 +12,6 @@ "PROBNORM" VARCHAR2(50 BYTE), "PROBGAIN" VARCHAR2(50 BYTE), "PROBAMP" VARCHAR2(50 BYTE) - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_lz/lt_src_cel_files.sql b/ddl/oracle/tm_lz/lt_src_cel_files.sql index 5a8e806b..39e16d71 100644 --- a/ddl/oracle/tm_lz/lt_src_cel_files.sql +++ b/ddl/oracle/tm_lz/lt_src_cel_files.sql @@ -1,8 +1,8 @@ -- -- Type: TABLE; Owner: TM_LZ; Name: LT_SRC_CEL_FILES -- -CREATE TABLE "TM_LZ"."LT_SRC_CEL_FILES" - ( "CEL_FILE_NAME" VARCHAR2(500 BYTE) - ) SEGMENT CREATION IMMEDIATE -TABLESPACE "TRANSMART" ; + CREATE TABLE "TM_LZ"."LT_SRC_CEL_FILES" + ( "CEL_FILE_NAME" VARCHAR2(500 BYTE) + ) SEGMENT CREATION IMMEDIATE + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_lz/lt_src_clinical_data.sql b/ddl/oracle/tm_lz/lt_src_clinical_data.sql index d27329a8..f357e9dc 100644 --- a/ddl/oracle/tm_lz/lt_src_clinical_data.sql +++ b/ddl/oracle/tm_lz/lt_src_clinical_data.sql @@ -27,5 +27,13 @@ "MODIFIER_CD" VARCHAR2(100 BYTE), "SAMPLE_CD" VARCHAR2(200 BYTE) ) SEGMENT CREATION IMMEDIATE - TABLESPACE "TRANSMART" ; +NOCOMPRESS NOLOGGING + TABLESPACE "TRANSMART" + CACHE ; +-- +-- Type: INDEX; Owner: TM_LZ; Name: IDX_SCD_STUDY +-- +CREATE INDEX "TM_LZ"."IDX_SCD_STUDY" ON "TM_LZ"."LT_SRC_CLINICAL_DATA" ("STUDY_ID") +TABLESPACE "TRANSMART" ; + diff --git a/ddl/oracle/tm_lz/lt_src_rnaseq_data.sql b/ddl/oracle/tm_lz/lt_src_rnaseq_data.sql index 4c8a361e..5c53737e 100644 --- a/ddl/oracle/tm_lz/lt_src_rnaseq_data.sql +++ b/ddl/oracle/tm_lz/lt_src_rnaseq_data.sql @@ -6,6 +6,6 @@ "REGION_NAME" VARCHAR2(100 BYTE), "EXPR_ID" VARCHAR2(100 BYTE), "READCOUNT" VARCHAR2(50 BYTE) - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_lz/lt_src_study_metadata.sql b/ddl/oracle/tm_lz/lt_src_study_metadata.sql index c5f22780..c06bbff8 100644 --- a/ddl/oracle/tm_lz/lt_src_study_metadata.sql +++ b/ddl/oracle/tm_lz/lt_src_study_metadata.sql @@ -58,6 +58,6 @@ "STUDY_DESIGN_FACTORS" VARCHAR2(2000 BYTE), "STUDY_NBR_SUBJECTS" VARCHAR2(20 BYTE), "STUDY_ORGANISM" VARCHAR2(500 BYTE) - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_lz/lz_src_analysis_metadata.sql b/ddl/oracle/tm_lz/lz_src_analysis_metadata.sql index 8c5139b1..7351491e 100644 --- a/ddl/oracle/tm_lz/lz_src_analysis_metadata.sql +++ b/ddl/oracle/tm_lz/lz_src_analysis_metadata.sql @@ -5,7 +5,7 @@ ( "STUDY_ID" VARCHAR2(50 BYTE), "DATA_TYPE" VARCHAR2(50 BYTE), "ANALYSIS_NAME" VARCHAR2(500 BYTE), -"DESCRIPTION" VARCHAR2(500 BYTE), +"DESCRIPTION" VARCHAR2(2048 BYTE), "PHENOTYPE_IDS" VARCHAR2(250 BYTE), "POPULATION" VARCHAR2(500 BYTE), "TISSUE" VARCHAR2(500 BYTE), @@ -27,7 +27,7 @@ "MODEL_DESC" VARCHAR2(500 BYTE), "SENSITIVE_FLAG" NUMBER(18,0), "SENSITIVE_DESC" VARCHAR2(500 BYTE) - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; -- diff --git a/ddl/oracle/tm_lz/rwg_analysis_data_ext.sql b/ddl/oracle/tm_lz/rwg_analysis_data_ext.sql index fb33bf1b..94af7a64 100644 --- a/ddl/oracle/tm_lz/rwg_analysis_data_ext.sql +++ b/ddl/oracle/tm_lz/rwg_analysis_data_ext.sql @@ -10,6 +10,6 @@ "FOLD_CHANGE" VARCHAR2(100 BYTE), "LSMEAN_1" VARCHAR2(100 BYTE), "LSMEAN_2" VARCHAR2(100 BYTE) - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_lz/rwg_analysis_ext.sql b/ddl/oracle/tm_lz/rwg_analysis_ext.sql index 523e7632..649770e1 100644 --- a/ddl/oracle/tm_lz/rwg_analysis_ext.sql +++ b/ddl/oracle/tm_lz/rwg_analysis_ext.sql @@ -13,6 +13,6 @@ "PLATFORM" VARCHAR2(500 BYTE), "LONG_DESC" VARCHAR2(500 BYTE), "SHORT_DESC" VARCHAR2(500 BYTE) - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE +NOCOMPRESS LOGGING TABLESPACE "TRANSMART" ; - diff --git a/ddl/oracle/tm_lz/rwg_cohorts_ext.sql b/ddl/oracle/tm_lz/rwg_cohorts_ext.sql index 6636f143..d5cf4d9f 100644 --- a/ddl/oracle/tm_lz/rwg_cohorts_ext.sql +++ b/ddl/oracle/tm_lz/rwg_cohorts_ext.sql @@ -12,6 +12,6 @@ "COHORT_TITLE" VARCHAR2(500 BYTE), "SHORT_DESC" VARCHAR2(500 BYTE), "LONG_DESC" VARCHAR2(500 BYTE) - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_lz/rwg_samples_ext.sql b/ddl/oracle/tm_lz/rwg_samples_ext.sql index 8f5cbd79..3eaefd59 100644 --- a/ddl/oracle/tm_lz/rwg_samples_ext.sql +++ b/ddl/oracle/tm_lz/rwg_samples_ext.sql @@ -5,6 +5,6 @@ ( "STUDY_ID" VARCHAR2(500 BYTE), "EXPR_ID" VARCHAR2(500 BYTE), "COHORTS" VARCHAR2(500 BYTE) - ) SEGMENT CREATION DEFERRED + ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; From ad7aa3c61eaaaaff6f4a8cfd73f88de364173f84 Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Tue, 12 Aug 2014 13:27:24 +0100 Subject: [PATCH 28/31] tm_cz updates from oracle test server --- ddl/oracle/tm_cz/_cross.sql | 18 + ddl/oracle/tm_cz/az_test_comparison_info.sql | 2 +- .../tm_cz/category_path_excluded_words.sql | 8 +- ddl/oracle/tm_cz/cz_job_audit.sql | 6 + ddl/oracle/tm_cz/cz_xtrial_exclusion.sql | 8 +- .../tm_cz/de_snp__data_by_probe_release.sql | 0 ddl/oracle/tm_cz/dk1.sql | 8 +- ddl/oracle/tm_cz/functions/repeat_char.sql | 30 + ddl/oracle/tm_cz/items.json | 1286 +++++++++++-- .../tm_cz/procedures/cz_error_handler.sql | 6 +- .../tm_cz/procedures/czx_error_handler.sql | 8 +- .../procedures/i2b2_load_chrom_region.sql | 150 ++ .../tm_cz/procedures/i2b2_load_eqtl_top50.sql | 156 ++ .../tm_cz/procedures/i2b2_load_gwas_top50.sql | 146 ++ .../procedures/i2b2_load_proteomics_annot.sql | 90 +- ddl/oracle/tm_cz/procedures/i2b2_load_rbm_ | 0 .../procedures/i2b2_move_analysis_to_prod.sql | 353 ++++ .../i2b2_move_analysis_to_prod_new.sql | 353 ++++ .../procedures/i2b2_mrna_index_maint.sql | 97 +- .../procedures/i2b2_process_acgh_data.sql | 980 ++++++++++ .../procedures/i2b2_process_rnaseq_data.sql | 956 ++++++++++ .../procedures/i2b2_process_snp_data.sql | 1621 +++++++++++++++++ .../tm_cz/procedures/partition_gwas_data.sql | 112 ++ ddl/oracle/tm_cz/stg_rbm_antigen_gene.sql | 10 + ddl/oracle/tm_cz/stg_subject_rbm_data.sql | 16 + ddl/oracle/tm_cz/stg_subject_rbm_data_raw.sql | 16 + ddl/oracle/tm_cz/tmp_subject_info.sql | 6 + ddl/oracle/tm_cz/views/patient_info.sql | 6 + 28 files changed, 6203 insertions(+), 245 deletions(-) create mode 100644 ddl/oracle/tm_cz/de_snp__data_by_probe_release.sql create mode 100644 ddl/oracle/tm_cz/functions/repeat_char.sql create mode 100644 ddl/oracle/tm_cz/procedures/i2b2_load_chrom_region.sql create mode 100644 ddl/oracle/tm_cz/procedures/i2b2_load_eqtl_top50.sql create mode 100644 ddl/oracle/tm_cz/procedures/i2b2_load_gwas_top50.sql create mode 100644 ddl/oracle/tm_cz/procedures/i2b2_load_rbm_ create mode 100644 ddl/oracle/tm_cz/procedures/i2b2_move_analysis_to_prod.sql create mode 100644 ddl/oracle/tm_cz/procedures/i2b2_move_analysis_to_prod_new.sql create mode 100644 ddl/oracle/tm_cz/procedures/i2b2_process_acgh_data.sql create mode 100644 ddl/oracle/tm_cz/procedures/i2b2_process_rnaseq_data.sql create mode 100644 ddl/oracle/tm_cz/procedures/i2b2_process_snp_data.sql create mode 100644 ddl/oracle/tm_cz/procedures/partition_gwas_data.sql create mode 100644 ddl/oracle/tm_cz/stg_rbm_antigen_gene.sql create mode 100644 ddl/oracle/tm_cz/stg_subject_rbm_data.sql create mode 100644 ddl/oracle/tm_cz/stg_subject_rbm_data_raw.sql create mode 100644 ddl/oracle/tm_cz/views/patient_info.sql diff --git a/ddl/oracle/tm_cz/_cross.sql b/ddl/oracle/tm_cz/_cross.sql index 24f78dcf..b09a22c9 100644 --- a/ddl/oracle/tm_cz/_cross.sql +++ b/ddl/oracle/tm_cz/_cross.sql @@ -53,3 +53,21 @@ from ,f.c_name ) x; +-- +-- Type: INDEX; Owner: TM_CZ; Name: IDX_I2B2_SECURE_FULLNAME +-- +CREATE INDEX "TM_CZ"."IDX_I2B2_SECURE_FULLNAME" ON "I2B2METADATA"."I2B2_SECURE" ("C_FULLNAME") +TABLESPACE "TRANSMART" ; + +-- +-- Type: INDEX; Owner: TM_CZ; Name: IX_I2B2_SOURCE_SYSTEM_CD +-- +CREATE INDEX "TM_CZ"."IX_I2B2_SOURCE_SYSTEM_CD" ON "I2B2METADATA"."I2B2" ("SOURCESYSTEM_CD") +TABLESPACE "TRANSMART" ; + +-- +-- Type: INDEX; Owner: TM_CZ; Name: IX_DE_SUBJECT_SMPL_MPNG_MRNA +-- +CREATE INDEX "TM_CZ"."IX_DE_SUBJECT_SMPL_MPNG_MRNA" ON "DEAPP"."DE_SUBJECT_SAMPLE_MAPPING" ("TRIAL_NAME", "PLATFORM", "SOURCE_CD", "CONCEPT_CODE") +TABLESPACE "TRANSMART" ; + diff --git a/ddl/oracle/tm_cz/az_test_comparison_info.sql b/ddl/oracle/tm_cz/az_test_comparison_info.sql index e30069e8..26442215 100644 --- a/ddl/oracle/tm_cz/az_test_comparison_info.sql +++ b/ddl/oracle/tm_cz/az_test_comparison_info.sql @@ -13,5 +13,5 @@ "CURR_RUN_DATE" DATE, "PREV_RUN_DATE" DATE ) SEGMENT CREATION IMMEDIATE +NOCOMPRESS LOGGING TABLESPACE "TRANSMART" ; - diff --git a/ddl/oracle/tm_cz/category_path_excluded_words.sql b/ddl/oracle/tm_cz/category_path_excluded_words.sql index 89d924ec..afe45c94 100644 --- a/ddl/oracle/tm_cz/category_path_excluded_words.sql +++ b/ddl/oracle/tm_cz/category_path_excluded_words.sql @@ -1,8 +1,8 @@ -- -- Type: TABLE; Owner: TM_CZ; Name: CATEGORY_PATH_EXCLUDED_WORDS -- -CREATE TABLE "TM_CZ"."CATEGORY_PATH_EXCLUDED_WORDS" - ( "EXCLUDED_TEXT" VARCHAR2(100 BYTE) - ) SEGMENT CREATION IMMEDIATE -TABLESPACE "TRANSMART" ; + CREATE TABLE "TM_CZ"."CATEGORY_PATH_EXCLUDED_WORDS" + ( "EXCLUDED_TEXT" VARCHAR2(100 BYTE) + ) SEGMENT CREATION IMMEDIATE + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_cz/cz_job_audit.sql b/ddl/oracle/tm_cz/cz_job_audit.sql index c5aa824e..7d702606 100644 --- a/ddl/oracle/tm_cz/cz_job_audit.sql +++ b/ddl/oracle/tm_cz/cz_job_audit.sql @@ -43,3 +43,9 @@ CREATE SEQUENCE "TM_CZ"."SEQ_CZ_JOB_AUDIT" MINVALUE 1 MAXVALUE 999999999999999 / ALTER TRIGGER "TM_CZ"."TRG_CZ_SEQ_ID" ENABLE; +-- +-- Type: INDEX; Owner: TM_CZ; Name: CZ_JOB_AUDIT_JOBID_DATE +-- +CREATE INDEX "TM_CZ"."CZ_JOB_AUDIT_JOBID_DATE" ON "TM_CZ"."CZ_JOB_AUDIT" ("JOB_ID", "JOB_DATE") +TABLESPACE "TRANSMART" ; + diff --git a/ddl/oracle/tm_cz/cz_xtrial_exclusion.sql b/ddl/oracle/tm_cz/cz_xtrial_exclusion.sql index 9ca6eba9..3991d473 100644 --- a/ddl/oracle/tm_cz/cz_xtrial_exclusion.sql +++ b/ddl/oracle/tm_cz/cz_xtrial_exclusion.sql @@ -1,8 +1,8 @@ -- -- Type: TABLE; Owner: TM_CZ; Name: CZ_XTRIAL_EXCLUSION -- -CREATE TABLE "TM_CZ"."CZ_XTRIAL_EXCLUSION" - ( "TRIAL_ID" VARCHAR2(200 BYTE) - ) SEGMENT CREATION DEFERRED -TABLESPACE "TRANSMART" ; + CREATE TABLE "TM_CZ"."CZ_XTRIAL_EXCLUSION" + ( "TRIAL_ID" VARCHAR2(200 BYTE) + ) SEGMENT CREATION DEFERRED + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_cz/de_snp__data_by_probe_release.sql b/ddl/oracle/tm_cz/de_snp__data_by_probe_release.sql new file mode 100644 index 00000000..e69de29b diff --git a/ddl/oracle/tm_cz/dk1.sql b/ddl/oracle/tm_cz/dk1.sql index ef16f9cd..85652a06 100644 --- a/ddl/oracle/tm_cz/dk1.sql +++ b/ddl/oracle/tm_cz/dk1.sql @@ -1,8 +1,8 @@ -- -- Type: TABLE; Owner: TM_CZ; Name: DK1 -- -CREATE TABLE "TM_CZ"."DK1" - ( "C1" VARCHAR2(10 BYTE) - ) SEGMENT CREATION IMMEDIATE -TABLESPACE "TRANSMART" ; + CREATE TABLE "TM_CZ"."DK1" + ( "C1" VARCHAR2(10 BYTE) + ) SEGMENT CREATION IMMEDIATE + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_cz/functions/repeat_char.sql b/ddl/oracle/tm_cz/functions/repeat_char.sql new file mode 100644 index 00000000..60c88d48 --- /dev/null +++ b/ddl/oracle/tm_cz/functions/repeat_char.sql @@ -0,0 +1,30 @@ +-- +-- Type: FUNCTION; Owner: TM_CZ; Name: REPEAT_CHAR +-- + CREATE OR REPLACE EDITIONABLE FUNCTION "TM_CZ"."REPEAT_CHAR" (i_value varchar2, i_count integer, i_char VARCHAR2) + return varchar2 +is + +-- use this function if version of Oracle does not support REPEAT string function + v_loop_ct integer; + v_value varchar2(4000); + +begin + + if i_count < 1 then + return i_value; + end if; + + v_loop_ct := 1; + v_value := i_value; + + while v_loop_ct <= i_count + loop + v_value := v_value || i_char; + v_loop_ct := v_loop_ct + 1; + end loop; + + return v_value; + +end repeat_char; +/ diff --git a/ddl/oracle/tm_cz/items.json b/ddl/oracle/tm_cz/items.json index e36d6aa6..9423a23a 100644 --- a/ddl/oracle/tm_cz/items.json +++ b/ddl/oracle/tm_cz/items.json @@ -433,17 +433,6 @@ "owner" : "BIOMART", "name" : "BIO_ASSAY_ANALYSIS_EXT" } ] - }, { - "child" : { - "type" : "SYNONYM", - "owner" : "TM_CZ", - "name" : "BIO_ASSAY_ANALYSIS_GWAS" - }, - "parents" : [ { - "type" : "TABLE", - "owner" : "BIOMART", - "name" : "BIO_ASSAY_ANALYSIS_GWAS" - } ] }, { "child" : { "type" : "FUNCTION", @@ -1118,17 +1107,6 @@ "owner" : "BIOMART", "name" : "BIO_MARKER" } ] - }, { - "child" : { - "type" : "SYNONYM", - "owner" : "TM_CZ", - "name" : "BIO_MARKER_CORREL_MV" - }, - "parents" : [ { - "type" : "TABLE", - "owner" : "BIOMART", - "name" : "BIO_MARKER_CORREL_MV" - } ] }, { "child" : { "type" : "SYNONYM", @@ -1228,6 +1206,17 @@ "owner" : "BIOMART", "name" : "BIO_TAXONOMY" } ] + }, { + "child" : { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "BIRN" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "I2B2METADATA", + "name" : "BIRN" + } ] }, { "child" : { "type" : "TABLE", @@ -2125,6 +2114,17 @@ "name" : "CZ_JOB_AUDIT" }, "parents" : [ ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "TM_CZ", + "name" : "CZ_JOB_AUDIT_JOBID_DATE" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "CZ_JOB_AUDIT" + } ] }, { "child" : { "type" : "TABLE", @@ -4087,6 +4087,53 @@ "owner" : "TM_LZ", "name" : "LT_SRC_DEAPP_ANNOT" } ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_LOAD_CHROM_REGION" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_MARKER" + }, { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_CHROMOSOMAL_REGION" + }, { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_GPL_INFO" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_END_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_ERROR_HANDLER" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_START_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_WRITE_AUDIT" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_CHROMOSOMAL_REGION" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "LT_CHROMOSOMAL_REGION" + }, { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LT_CHROMOSOMAL_REGION" + } ] }, { "child" : { "type" : "PROCEDURE", @@ -4699,6 +4746,84 @@ "owner" : "TM_WZ", "name" : "WRK_CLINICAL_DATA" } ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_LOAD_EQTL_TOP50" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS" + }, { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS_EQTL" + }, { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASY_ANALYSIS_EQTL_TOP50" + }, { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_RC_SNP_INFO" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_END_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_ERROR_HANDLER" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_START_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_WRITE_AUDIT" + } ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_LOAD_GWAS_TOP50" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS" + }, { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS_GWAS" + }, { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASY_ANALYSIS_GWAS_TOP50" + }, { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_RC_SNP_INFO" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_END_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_ERROR_HANDLER" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_START_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_WRITE_AUDIT" + } ] }, { "child" : { "type" : "PROCEDURE", @@ -5782,12 +5907,32 @@ "child" : { "type" : "PROCEDURE", "owner" : "TM_CZ", - "name" : "I2B2_MOVE_NODE" + "name" : "I2B2_MOVE_ANALYSIS_TO_PROD" }, "parents" : [ { - "type" : "SYNONYM", - "owner" : "TM_CZ", - "name" : "CONCEPT_DIMENSION" + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS" + }, { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS_EQTL" + }, { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS_GWAS" + }, { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASY_ANALYSIS_DATA_IDX" + }, { + "type" : "TABLE", + "owner" : "BIOMART_STAGE", + "name" : "BIO_ASSAY_ANALYSIS_EQTL" + }, { + "type" : "TABLE", + "owner" : "BIOMART_STAGE", + "name" : "BIO_ASSAY_ANALYSIS_GWAS" }, { "type" : "PROCEDURE", "owner" : "TM_CZ", @@ -5805,32 +5950,48 @@ "owner" : "TM_CZ", "name" : "CZ_WRITE_AUDIT" }, { - "type" : "SYNONYM", + "type" : "PROCEDURE", "owner" : "TM_CZ", - "name" : "I2B2" + "name" : "I2B2_LOAD_EQTL_TOP50" }, { - "type" : "FUNCTION", + "type" : "PROCEDURE", "owner" : "TM_CZ", - "name" : "PARSE_NTH_VALUE" + "name" : "I2B2_LOAD_GWAS_TOP50" }, { - "type" : "SYNONYM", + "type" : "FUNCTION", "owner" : "TM_CZ", - "name" : "TABLE_ACCESS" + "name" : "REPEAT_CHAR" + }, { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LZ_SRC_ANALYSIS_METADATA" } ] }, { "child" : { "type" : "PROCEDURE", "owner" : "TM_CZ", - "name" : "I2B2_MOVE_STUDY" + "name" : "I2B2_MOVE_ANALYSIS_TO_PROD_NEW" }, "parents" : [ { - "type" : "SYNONYM", - "owner" : "TM_CZ", - "name" : "CONCEPT_COUNTS" + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS" }, { - "type" : "SYNONYM", - "owner" : "TM_CZ", - "name" : "CONCEPT_DIMENSION" + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASSAY_ANALYSIS_EQTL" + }, { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "BIO_ASY_ANALYSIS_DATA_IDX" + }, { + "type" : "TABLE", + "owner" : "BIOMART_STAGE", + "name" : "BIO_ASSAY_ANALYSIS_EQTL" + }, { + "type" : "TABLE", + "owner" : "BIOMART_STAGE", + "name" : "BIO_ASSAY_ANALYSIS_GWAS" }, { "type" : "PROCEDURE", "owner" : "TM_CZ", @@ -5847,38 +6008,42 @@ "type" : "PROCEDURE", "owner" : "TM_CZ", "name" : "CZ_WRITE_AUDIT" - }, { - "type" : "SYNONYM", - "owner" : "TM_CZ", - "name" : "I2B2" - }, { - "type" : "PROCEDURE", - "owner" : "TM_CZ", - "name" : "I2B2_ADD_ROOT_NODE" }, { "type" : "PROCEDURE", "owner" : "TM_CZ", - "name" : "I2B2_FILL_IN_TREE" + "name" : "I2B2_LOAD_EQTL_TOP50" }, { "type" : "PROCEDURE", "owner" : "TM_CZ", - "name" : "I2B2_LOAD_SECURITY_DATA" + "name" : "I2B2_LOAD_GWAS_TOP50" }, { "type" : "FUNCTION", "owner" : "TM_CZ", - "name" : "PARSE_NTH_VALUE" + "name" : "REPEAT_CHAR" }, { - "type" : "SYNONYM", - "owner" : "TM_CZ", - "name" : "TABLE_ACCESS" + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LZ_SRC_ANALYSIS_METADATA" } ] }, { "child" : { "type" : "PROCEDURE", "owner" : "TM_CZ", - "name" : "I2B2_MRNA_INC_SUB_ZSCORE" + "name" : "I2B2_MOVE_NODE" }, "parents" : [ { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "CONCEPT_DIMENSION" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_END_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_ERROR_HANDLER" + }, { "type" : "PROCEDURE", "owner" : "TM_CZ", "name" : "CZ_START_AUDIT" @@ -5889,9 +6054,91 @@ }, { "type" : "SYNONYM", "owner" : "TM_CZ", - "name" : "DE_SUBJECT_MICROARRAY_DATA" - } ] - }, { + "name" : "I2B2" + }, { + "type" : "FUNCTION", + "owner" : "TM_CZ", + "name" : "PARSE_NTH_VALUE" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "TABLE_ACCESS" + } ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_MOVE_STUDY" + }, + "parents" : [ { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "CONCEPT_COUNTS" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "CONCEPT_DIMENSION" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_END_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_ERROR_HANDLER" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_START_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_WRITE_AUDIT" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "I2B2" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_ADD_ROOT_NODE" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_FILL_IN_TREE" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_LOAD_SECURITY_DATA" + }, { + "type" : "FUNCTION", + "owner" : "TM_CZ", + "name" : "PARSE_NTH_VALUE" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "TABLE_ACCESS" + } ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_MRNA_INC_SUB_ZSCORE" + }, + "parents" : [ { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_START_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_WRITE_AUDIT" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_SUBJECT_MICROARRAY_DATA" + } ] + }, { "child" : { "type" : "PROCEDURE", "owner" : "TM_CZ", @@ -6008,6 +6255,145 @@ "owner" : "TM_CZ", "name" : "WT_SUBJECT_MRNA_PROBESET" } ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROCESS_ACGH_DATA" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_CHROMOSOMAL_REGION" + }, { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_SUBJECT_ACGH_DATA" + }, { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_SUBJECT_SAMPLE_MAPPING" + }, { + "type" : "SEQUENCE", + "owner" : "DEAPP", + "name" : "SEQ_ASSAY_ID" + }, { + "type" : "TABLE", + "owner" : "I2B2DEMODATA", + "name" : "SAMPLE_DIMENSION" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "CONCEPT_DIMENSION" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_END_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_ERROR_HANDLER" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_START_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_WRITE_AUDIT" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_CHROMOSOMAL_REGION" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_GPL_INFO" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_SUBJECT_ACGH_DATA" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_SUBJECT_SAMPLE_MAPPING" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "I2B2" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_ADD_NODE" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_ADD_ROOT_NODE" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_CREATE_CONCEPT_COUNTS" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_CREATE_SECURITY_FOR_TRIAL" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_DELETE_1_NODE" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_FILL_IN_TREE" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_LOAD_SECURITY_DATA" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "LT_SRC_MRNA_SUBJ_SAMP_MAP" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "OBSERVATION_FACT" + }, { + "type" : "FUNCTION", + "owner" : "TM_CZ", + "name" : "PARSE_NTH_VALUE" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "PATIENT_DIMENSION" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "SEQ_PATIENT_NUM" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "TABLE_ACCESS" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "WT_MRNA_NODES" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "WT_MRNA_NODE_VALUES" + }, { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LT_SRC_ACGH_DATA" + }, { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LT_SRC_DISPLAY_MAPPING" + }, { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "WT_SUBJECT_ACGH_REGION" + } ] }, { "child" : { "type" : "PROCEDURE", @@ -7251,9 +7637,17 @@ "child" : { "type" : "PROCEDURE", "owner" : "TM_CZ", - "name" : "I2B2_PROCESS_RNA_SEQ_DATA" + "name" : "I2B2_PROCESS_RNASEQ_DATA" }, "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_CHROMOSOMAL_REGION" + }, { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_SUBJECT_RNASEQ_DATA" + }, { "type" : "TABLE", "owner" : "DEAPP", "name" : "DE_SUBJECT_SAMPLE_MAPPING" @@ -7288,7 +7682,15 @@ }, { "type" : "SYNONYM", "owner" : "TM_CZ", - "name" : "DE_SUBJECT_RNA_DATA" + "name" : "DE_CHROMOSOMAL_REGION" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_GPL_INFO" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_SUBJECT_RNASEQ_DATA" }, { "type" : "SYNONYM", "owner" : "TM_CZ", @@ -7325,18 +7727,10 @@ "type" : "PROCEDURE", "owner" : "TM_CZ", "name" : "I2B2_LOAD_SECURITY_DATA" - }, { - "type" : "PROCEDURE", - "owner" : "TM_CZ", - "name" : "I2B2_RNA_SEQ_ZSCORE_CALC" - }, { - "type" : "SYNONYM", - "owner" : "TM_CZ", - "name" : "LT_SRC_RNA_SEQ_DATA" }, { "type" : "SYNONYM", "owner" : "TM_CZ", - "name" : "LT_SRC_RNA_SEQ_SUBJ_SAMP_MAP" + "name" : "LT_SRC_MRNA_SUBJ_SAMP_MAP" }, { "type" : "SYNONYM", "owner" : "TM_CZ", @@ -7349,10 +7743,141 @@ "type" : "SYNONYM", "owner" : "TM_CZ", "name" : "PATIENT_DIMENSION" - }, { - "type" : "TABLE", - "owner" : "TM_CZ", - "name" : "PROBESET_DEAPP" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "SEQ_PATIENT_NUM" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "TABLE_ACCESS" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "WT_MRNA_NODES" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "WT_MRNA_NODE_VALUES" + }, { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LT_SRC_DISPLAY_MAPPING" + }, { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LT_SRC_RNASEQ_DATA" + }, { + "type" : "TABLE", + "owner" : "TM_WZ", + "name" : "WT_SUBJECT_RNASEQ_REGION" + } ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROCESS_RNA_SEQ_DATA" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_SUBJECT_SAMPLE_MAPPING" + }, { + "type" : "SEQUENCE", + "owner" : "DEAPP", + "name" : "SEQ_ASSAY_ID" + }, { + "type" : "TABLE", + "owner" : "I2B2DEMODATA", + "name" : "SAMPLE_DIMENSION" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "CONCEPT_DIMENSION" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_END_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_ERROR_HANDLER" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_START_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_WRITE_AUDIT" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_SUBJECT_RNA_DATA" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_SUBJECT_SAMPLE_MAPPING" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "I2B2" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_ADD_NODE" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_ADD_ROOT_NODE" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_CREATE_CONCEPT_COUNTS" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_CREATE_SECURITY_FOR_TRIAL" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_DELETE_1_NODE" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_FILL_IN_TREE" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_LOAD_SECURITY_DATA" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_RNA_SEQ_ZSCORE_CALC" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "LT_SRC_RNA_SEQ_DATA" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "LT_SRC_RNA_SEQ_SUBJ_SAMP_MAP" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "OBSERVATION_FACT" + }, { + "type" : "FUNCTION", + "owner" : "TM_CZ", + "name" : "PARSE_NTH_VALUE" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "PATIENT_DIMENSION" + }, { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "PROBESET_DEAPP" }, { "type" : "SYNONYM", "owner" : "TM_CZ", @@ -7624,6 +8149,149 @@ "owner" : "TM_LZ", "name" : "LT_SRC_RNA_DISPLAY_MAPPING" } ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROCESS_SNP_DATA" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_SNP_CALLS_BY_GSM" + }, { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_SNP_COPY_NUMBER" + }, { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_SUBJECT_SAMPLE_MAPPING" + }, { + "type" : "SEQUENCE", + "owner" : "DEAPP", + "name" : "SEQ_ASSAY_ID" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "CONCEPT_DIMENSION" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_END_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_ERROR_HANDLER" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_START_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_WRITE_AUDIT" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_GPL_INFO" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_MRNA_ANNOTATION" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_SUBJECT_MICROARRAY_DATA" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_SUBJECT_SAMPLE_MAPPING" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "I2B2" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_ADD_NODE" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_ADD_ROOT_NODE" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_CREATE_CONCEPT_COUNTS" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_CREATE_SECURITY_FOR_TRIAL" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_DELETE_1_NODE" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_FILL_IN_TREE" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_LOAD_SECURITY_DATA" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_MRNA_ZSCORE_CALC" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "LT_SRC_MRNA_DATA" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "LT_SRC_MRNA_SUBJ_SAMP_MAP" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "OBSERVATION_FACT" + }, { + "type" : "FUNCTION", + "owner" : "TM_CZ", + "name" : "PARSE_NTH_VALUE" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "PATIENT_DIMENSION" + }, { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "PROBESET_DEAPP" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "SEQ_PATIENT_NUM" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "TABLE_ACCESS" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "WT_MRNA_NODES" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "WT_MRNA_NODE_VALUES" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "WT_SUBJECT_MRNA_PROBESET" + }, { + "type" : "TABLE", + "owner" : "TM_LZ", + "name" : "LT_SRC_MRNA_SUBJ_SAMP_MAP" + } ] }, { "child" : { "type" : "PROCEDURE", @@ -7767,6 +8435,24 @@ "owner" : "TM_LZ", "name" : "LT_SRC_METABOLOMIC_MAP" } ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROTEIN_INC_SUB_ZSCORE" + }, + "parents" : [ { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_SUBJECT_PROTEIN_DATA" + } ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROTEIN_INC_SUB_ZSCORE2" + }, + "parents" : [ ] }, { "child" : { "type" : "PROCEDURE", @@ -7818,6 +8504,115 @@ "owner" : "TM_CZ", "name" : "WT_SUBJECT_PROTEOMICS_PROBESET" } ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROTEIN_INC_ZSCORE_CALC2" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_PROTEIN_ANNOTATION" + }, { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_SUBJECT_PROTEIN_DATA" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_END_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_ERROR_HANDLER" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_START_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_WRITE_AUDIT" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_SUBJECT_PROTEIN_DATA" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "WT_SUBJECT_PROTEOMICS_CALCS" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "WT_SUBJECT_PROTEOMICS_LOGS" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "WT_SUBJECT_PROTEOMICS_MED" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "WT_SUBJECT_PROTEOMICS_PROBESET" + } ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROTEIN_INC_ZSCORE_CALC3" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_PROTEIN_ANNOTATION" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_END_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_ERROR_HANDLER" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_START_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_WRITE_AUDIT" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "DE_SUBJECT_PROTEIN_DATA" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROTEIN_INC_SUB_ZSCORE" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "WT_SUBJECT_PROTEOMICS_CALCS" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "WT_SUBJECT_PROTEOMICS_LOGS" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "WT_SUBJECT_PROTEOMICS_MED" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "WT_SUBJECT_PROTEOMICS_PROBESET" + } ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROTEOMICS_INC_SUB_ZSCORE" + }, + "parents" : [ ] }, { "child" : { "type" : "PROCEDURE", @@ -8589,13 +9384,35 @@ "name" : "I2B2_UI_LABEL_CHANGE_BK" }, "parents" : [ { - "type" : "SYNONYM", - "owner" : "TM_CZ", - "name" : "CONCEPT_DIMENSION" - }, { - "type" : "SYNONYM", + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "CONCEPT_DIMENSION" + }, { + "type" : "SYNONYM", + "owner" : "TM_CZ", + "name" : "I2B2" + } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "TM_CZ", + "name" : "IDX_I2B2_SECURE_FULLNAME" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "I2B2METADATA", + "name" : "I2B2_SECURE" + } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "TM_CZ", + "name" : "IDX_TMP_SUBJ_USUBJID" + }, + "parents" : [ { + "type" : "TABLE", "owner" : "TM_CZ", - "name" : "I2B2" + "name" : "TMP_SUBJECT_INFO" } ] }, { "child" : { @@ -8618,6 +9435,28 @@ "name" : "IS_NUMBER_V2" }, "parents" : [ ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "TM_CZ", + "name" : "IX_DE_SUBJECT_SMPL_MPNG_MRNA" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "DEAPP", + "name" : "DE_SUBJECT_SAMPLE_MAPPING" + } ] + }, { + "child" : { + "type" : "INDEX", + "owner" : "TM_CZ", + "name" : "IX_I2B2_SOURCE_SYSTEM_CD" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "I2B2METADATA", + "name" : "I2B2" + } ] }, { "child" : { "type" : "SYNONYM", @@ -8695,17 +9534,6 @@ "owner" : "DEAPP", "name" : "KEGG" } ] - }, { - "child" : { - "type" : "SYNONYM", - "owner" : "TM_CZ", - "name" : "KEGG_DEF" - }, - "parents" : [ { - "type" : "TABLE", - "owner" : "DEAPP", - "name" : "KEGG_DEF" - } ] }, { "child" : { "type" : "VIEW", @@ -9373,17 +10201,6 @@ "owner" : "I2B2DEMODATA", "name" : "MASTER_QUERY_GLOBAL_TEMP" } ] - }, { - "child" : { - "type" : "SYNONYM", - "owner" : "TM_CZ", - "name" : "MESH" - }, - "parents" : [ { - "type" : "TABLE", - "owner" : "BIOMART", - "name" : "MESH" - } ] }, { "child" : { "type" : "SYNONYM", @@ -9395,17 +10212,6 @@ "owner" : "BIOMART", "name" : "MESH_DESCRIPTOR" } ] - }, { - "child" : { - "type" : "SYNONYM", - "owner" : "TM_CZ", - "name" : "MESH_ENTRY" - }, - "parents" : [ { - "type" : "TABLE", - "owner" : "BIOMART", - "name" : "MESH_ENTRY" - } ] }, { "child" : { "type" : "SYNONYM", @@ -9598,6 +10404,33 @@ "name" : "PARSE_NTH_VALUE" }, "parents" : [ ] + }, { + "child" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "PARTITION_GWAS_DATA" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "BIOMART", + "name" : "GWAS_PARTITION" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_END_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_ERROR_HANDLER" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_START_AUDIT" + }, { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "CZ_WRITE_AUDIT" + } ] }, { "child" : { "type" : "SYNONYM", @@ -9616,6 +10449,17 @@ "name" : "PATIENT_DIMENSION_RELEASE" }, "parents" : [ ] + }, { + "child" : { + "type" : "VIEW", + "owner" : "TM_CZ", + "name" : "PATIENT_INFO" + }, + "parents" : [ { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "STG_SUBJECT_RBM_DATA" + } ] }, { "child" : { "type" : "SYNONYM", @@ -10123,6 +10967,13 @@ "owner" : "I2B2METADATA", "name" : "I2B2_SECURE" } ] + }, { + "child" : { + "type" : "FUNCTION", + "owner" : "TM_CZ", + "name" : "REPEAT_CHAR" + }, + "parents" : [ ] }, { "child" : { "type" : "SYNONYM", @@ -11003,6 +11854,27 @@ "owner" : "I2B2DEMODATA", "name" : "SQ_UP_PATDIM_PATIENTNUM" } ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "STG_RBM_ANTIGEN_GENE" + }, + "parents" : [ ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "STG_SUBJECT_RBM_DATA" + }, + "parents" : [ ] + }, { + "child" : { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "STG_SUBJECT_RBM_DATA_RAW" + }, + "parents" : [ ] }, { "child" : { "type" : "FUNCTION", @@ -11639,28 +12511,6 @@ "owner" : "I2B2DEMODATA", "name" : "VISIT_DIMENSION" } ] - }, { - "child" : { - "type" : "SYNONYM", - "owner" : "TM_CZ", - "name" : "VW_FACETED_SEARCH" - }, - "parents" : [ { - "type" : "VIEW", - "owner" : "BIOMART", - "name" : "VW_FACETED_SEARCH" - } ] - }, { - "child" : { - "type" : "SYNONYM", - "owner" : "TM_CZ", - "name" : "VW_FACETED_SEARCH_DISEASE" - }, - "parents" : [ { - "type" : "VIEW", - "owner" : "BIOMART", - "name" : "VW_FACETED_SEARCH_DISEASE" - } ] }, { "child" : { "type" : "SYNONYM", @@ -12635,6 +13485,13 @@ "name" : "CZ_JOB_AUDIT" }, "file" : "tm_cz/cz_job_audit.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "TM_CZ", + "name" : "CZ_JOB_AUDIT_JOBID_DATE" + }, + "file" : "tm_cz/cz_job_audit.sql" }, { "item" : { "type" : "TABLE", @@ -12978,6 +13835,13 @@ "name" : "I2B2_LOAD_ANNOTATION_DEAPP" }, "file" : "tm_cz/procedures/i2b2_load_annotation_deapp.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_LOAD_CHROM_REGION" + }, + "file" : "tm_cz/procedures/i2b2_load_chrom_region.sql" }, { "item" : { "type" : "PROCEDURE", @@ -13006,6 +13870,20 @@ "name" : "I2B2_LOAD_CLINICAL_INC_DATA" }, "file" : "tm_cz/procedures/i2b2_load_clinical_inc_data.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_LOAD_EQTL_TOP50" + }, + "file" : "tm_cz/procedures/i2b2_load_eqtl_top50.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_LOAD_GWAS_TOP50" + }, + "file" : "tm_cz/procedures/i2b2_load_gwas_top50.sql" }, { "item" : { "type" : "PROCEDURE", @@ -13125,6 +14003,20 @@ "name" : "I2B2_MIRNA_ZSCORE_CALC" }, "file" : "tm_cz/procedures/i2b2_mirna_zscore_calc.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_MOVE_ANALYSIS_TO_PROD" + }, + "file" : "tm_cz/procedures/i2b2_move_analysis_to_prod.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_MOVE_ANALYSIS_TO_PROD_NEW" + }, + "file" : "tm_cz/procedures/i2b2_move_analysis_to_prod_new.sql" }, { "item" : { "type" : "PROCEDURE", @@ -13167,6 +14059,13 @@ "name" : "I2B2_MRNA_ZSCORE_CALC" }, "file" : "tm_cz/procedures/i2b2_mrna_zscore_calc.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROCESS_ACGH_DATA" + }, + "file" : "tm_cz/procedures/i2b2_process_acgh_data.sql" }, { "item" : { "type" : "PROCEDURE", @@ -13230,6 +14129,13 @@ "name" : "I2B2_PROCESS_QPCR_MIRNA_DATA" }, "file" : "tm_cz/procedures/i2b2_process_qpcr_mirna_data.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROCESS_RNASEQ_DATA" + }, + "file" : "tm_cz/procedures/i2b2_process_rnaseq_data.sql" }, { "item" : { "type" : "PROCEDURE", @@ -13251,6 +14157,13 @@ "name" : "I2B2_PROCESS_RNA_SEQ_INC_DATA" }, "file" : "tm_cz/procedures/i2b2_process_rna_seq_inc_data.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROCESS_SNP_DATA" + }, + "file" : "tm_cz/procedures/i2b2_process_snp_data.sql" }, { "item" : { "type" : "PROCEDURE", @@ -13258,6 +14171,20 @@ "name" : "I2B2_PROC_METABOLOMIC_INC_DATA" }, "file" : "tm_cz/procedures/i2b2_proc_metabolomic_inc_data.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROTEIN_INC_SUB_ZSCORE" + }, + "file" : "tm_cz/procedures/i2b2_protein_inc_sub_zscore.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROTEIN_INC_SUB_ZSCORE2" + }, + "file" : "tm_cz/procedures/i2b2_protein_inc_sub_zscore2.sql" }, { "item" : { "type" : "PROCEDURE", @@ -13265,6 +14192,27 @@ "name" : "I2B2_PROTEIN_INC_ZSCORE_CALC" }, "file" : "tm_cz/procedures/i2b2_protein_inc_zscore_calc.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROTEIN_INC_ZSCORE_CALC2" + }, + "file" : "tm_cz/procedures/i2b2_protein_inc_zscore_calc2.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROTEIN_INC_ZSCORE_CALC3" + }, + "file" : "tm_cz/procedures/i2b2_protein_inc_zscore_calc3.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "I2B2_PROTEOMICS_INC_SUB_ZSCORE" + }, + "file" : "tm_cz/procedures/i2b2_proteomics_inc_sub_zscore.sql" }, { "item" : { "type" : "PROCEDURE", @@ -13412,6 +14360,20 @@ "name" : "I2B2_UI_LABEL_CHANGE_BK" }, "file" : "tm_cz/procedures/i2b2_ui_label_change_bk.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "TM_CZ", + "name" : "IDX_I2B2_SECURE_FULLNAME" + }, + "file" : "tm_cz/_cross.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "TM_CZ", + "name" : "IDX_TMP_SUBJ_USUBJID" + }, + "file" : "tm_cz/tmp_subject_info.sql" }, { "item" : { "type" : "FUNCTION", @@ -13433,6 +14395,20 @@ "name" : "IS_NUMBER_V2" }, "file" : "tm_cz/functions/is_number_v2.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "TM_CZ", + "name" : "IX_DE_SUBJECT_SMPL_MPNG_MRNA" + }, + "file" : "tm_cz/_cross.sql" + }, { + "item" : { + "type" : "INDEX", + "owner" : "TM_CZ", + "name" : "IX_I2B2_SOURCE_SYSTEM_CD" + }, + "file" : "tm_cz/_cross.sql" }, { "item" : { "type" : "FUNCTION", @@ -13510,6 +14486,13 @@ "name" : "PARSE_NTH_VALUE" }, "file" : "tm_cz/functions/parse_nth_value.sql" + }, { + "item" : { + "type" : "PROCEDURE", + "owner" : "TM_CZ", + "name" : "PARTITION_GWAS_DATA" + }, + "file" : "tm_cz/procedures/partition_gwas_data.sql" }, { "item" : { "type" : "TABLE", @@ -13517,6 +14500,13 @@ "name" : "PATIENT_DIMENSION_RELEASE" }, "file" : "tm_cz/patient_dimension_release.sql" + }, { + "item" : { + "type" : "VIEW", + "owner" : "TM_CZ", + "name" : "PATIENT_INFO" + }, + "file" : "tm_cz/views/patient_info.sql" }, { "item" : { "type" : "TABLE", @@ -13580,6 +14570,13 @@ "name" : "RENAME_STUDY" }, "file" : "tm_cz/procedures/rename_study.sql" + }, { + "item" : { + "type" : "FUNCTION", + "owner" : "TM_CZ", + "name" : "REPEAT_CHAR" + }, + "file" : "tm_cz/functions/repeat_char.sql" }, { "item" : { "type" : "SEQUENCE", @@ -13734,6 +14731,27 @@ "name" : "SET_BIO_DATA_UID_PATH" }, "file" : "tm_cz/procedures/set_bio_data_uid_path.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "STG_RBM_ANTIGEN_GENE" + }, + "file" : "tm_cz/stg_rbm_antigen_gene.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "STG_SUBJECT_RBM_DATA" + }, + "file" : "tm_cz/stg_subject_rbm_data.sql" + }, { + "item" : { + "type" : "TABLE", + "owner" : "TM_CZ", + "name" : "STG_SUBJECT_RBM_DATA_RAW" + }, + "file" : "tm_cz/stg_subject_rbm_data_raw.sql" }, { "item" : { "type" : "FUNCTION", @@ -14022,4 +15040,4 @@ }, "file" : "tm_cz/_misc.sql" } ] -} +} \ No newline at end of file diff --git a/ddl/oracle/tm_cz/procedures/cz_error_handler.sql b/ddl/oracle/tm_cz/procedures/cz_error_handler.sql index c3e842d2..30f6fe5f 100644 --- a/ddl/oracle/tm_cz/procedures/cz_error_handler.sql +++ b/ddl/oracle/tm_cz/procedures/cz_error_handler.sql @@ -25,9 +25,9 @@ AS databaseName NVARCHAR2(100); errorNumber NUMBER(18,0); - errorMessage NVARCHAR2(1000); - errorStack NVARCHAR2(4000); - errorBackTrace NVARCHAR2(4000); + errorMessage VARCHAR2(1000); + errorStack VARCHAR2(4000); + errorBackTrace VARCHAR2(4000); stepNo NUMBER(18,0); BEGIN diff --git a/ddl/oracle/tm_cz/procedures/czx_error_handler.sql b/ddl/oracle/tm_cz/procedures/czx_error_handler.sql index 64465342..d6c3914a 100644 --- a/ddl/oracle/tm_cz/procedures/czx_error_handler.sql +++ b/ddl/oracle/tm_cz/procedures/czx_error_handler.sql @@ -23,11 +23,11 @@ AS * limitations under the License. ******************************************************************/ - databaseName NVARCHAR2(100); + databaseName VARCHAR2(100); errorNumber NUMBER(18,0); - errorMessage NVARCHAR2(1000); - errorStack NVARCHAR2(4000); - errorBackTrace NVARCHAR2(4000); + errorMessage VARCHAR2(1000); + errorStack VARCHAR2(4000); + errorBackTrace VARCHAR2(4000); stepNo NUMBER(18,0); BEGIN diff --git a/ddl/oracle/tm_cz/procedures/i2b2_load_chrom_region.sql b/ddl/oracle/tm_cz/procedures/i2b2_load_chrom_region.sql new file mode 100644 index 00000000..599f9c29 --- /dev/null +++ b/ddl/oracle/tm_cz/procedures/i2b2_load_chrom_region.sql @@ -0,0 +1,150 @@ +-- +-- Type: PROCEDURE; Owner: TM_CZ; Name: I2B2_LOAD_CHROM_REGION +-- + CREATE OR REPLACE EDITIONABLE PROCEDURE "TM_CZ"."I2B2_LOAD_CHROM_REGION" +( + platform_t in varchar2 := '' +, genome_release in varchar2 := '' +, currentjobid in number := NULL +) as + --Audit variables + newJobFlag INTEGER; + databaseName VARCHAR(100); + procedureName VARCHAR(100); + jobID NUMBER(18,0); + stepCt NUMBER(18,0); + gplId VARCHAR2(100); + organismId VARCHAR2(100); + platform_title VARCHAR(500); + +begin + stepCt := 0; + + --Set Audit Parameters + newJobFlag := 0; -- False (Default) + jobID := currentJobID; + + SELECT sys_context('USERENV', 'CURRENT_SCHEMA') INTO databaseName FROM dual; + procedureName := $$PLSQL_UNIT; + + --Audit JOB Initialization + --If Job ID does not exist, then this is a single procedure run and we need to create it + IF(jobID IS NULL OR jobID < 1) THEN + newJobFlag := 1; -- True + cz_start_audit (procedureName, databaseName, jobID); + END IF; + + stepCt := stepCt + 1; + tm_cz.cz_write_audit(jobId,databaseName,procedureName,'Starting i2b2_load_chrom_region',0,stepCt,'Done'); + + + -- The data should already be in the landing zone (tm_lz.lt_chromosomal_region) + -- We now do some basic check's: + -- + is chromosomal_region already in deapp.de_chromosomal_region (gpl_id/region_name) + -- if true then remove these lines? + -- + ... + + -- insert region definitions into deapp-schema + -- First remove previous definitions for gpl_id + SELECT DISTINCT gpl_id INTO gplId FROM lt_chromosomal_region; + + DELETE FROM deapp.de_chromosomal_region WHERE gpl_id = gplId; + stepCt := stepCt + 1; + tm_cz.cz_write_audit(jobId,databaseName,procedureName,'Delete existing data from deapp.de_chromosomal_region for plaform: ' || gplId,SQL%ROWCOUNT,stepCt,'Done'); + + DELETE FROM deapp.de_gpl_info WHERE platform = gplId; + stepCt := stepCt + 1; + tm_cz.cz_write_audit(jobId,databaseName,procedureName,'Delete existing data from deapp.de_gpl_info for platform: ' || gplID,SQL%ROWCOUNT,stepCt,'Done'); + + -- Insert platform into deapp.de_gpl_info + platform_title := platform_t; + IF (LENGTH(platform_title) = 0) THEN + platform_title := gplId; + END IF; + SELECT DISTINCT organism INTO organismId FROM tm_lz.lt_chromosomal_region; + + INSERT INTO deapp.de_gpl_info + ( + platform , + title , + organism , + annotation_date , + marker_type , + release_nbr + ) + VALUES + ( + gplId, + platform_title, + organismId, + CURRENT_TIMESTAMP, + 'Chromosomal', + genome_release + ); + stepCt := stepCt + 1; + tm_cz.cz_write_audit(jobId,databaseName,procedureName,'Load platform info into deapp.de_gpl_info for platform: ' || gplID,SQL%ROWCOUNT,stepCt,'Done'); + + -- Next insert the new definitions + INSERT INTO deapp.de_chromosomal_region + ( + GPL_ID , + REGION_NAME , + CHROMOSOME , + START_BP , + END_BP , + NUM_PROBES , + CYTOBAND , + GENE_SYMBOL , + GENE_ID , + ORGANISM + ) + SELECT lz.GPL_ID , + lz.REGION_NAME , + lz.CHROMOSOME , + lz.START_BP , + lz.END_BP , + lz.NUM_PROBES , + lz.CYTOBAND , + lz.GENE_SYMBOL , + lz.GENE_ID , + lz.ORGANISM + FROM tm_lz.lt_chromosomal_region lz; + stepCt := stepCt + 1; + tm_cz.cz_write_audit(jobId,databaseName,procedureName,'Load chromosomal region data into deapp.de_chromosomal_region for platform: ' || gplId,SQL%ROWCOUNT,stepCt,'Done'); + + -- update gene_id if null + update de_chromosomal_region t + set gene_id=(select to_number(min(b.primary_external_id)) as gene_id + from biomart.bio_marker b + where t.gene_symbol = b.bio_marker_name + and upper(b.organism) = upper(t.organism) + and upper(b.bio_marker_type) = 'GENE') + where t.gpl_id = gplId + and t.gene_id is null + and t.gene_symbol is not null + and exists + (select 1 from biomart.bio_marker x + where t.gene_symbol = x.bio_marker_name + and upper(x.organism) = upper(t.organism) + and upper(x.bio_marker_type) = 'GENE'); + stepCt := stepCt + 1; + tm_cz.cz_write_audit(jobId,databaseName,procedureName,'Updated missing gene_id in de_chromosomal_region',SQL%ROWCOUNT,stepCt,'Done'); + + -- wrapping up + stepCt := stepCt + 1; + tm_cz.cz_write_audit(jobId,databaseName,procedureName,'End i2b2_load_chrom_region',0,stepCt,'Done'); + + ---Cleanup OVERALL JOB if this proc is being run standalone + IF newJobFlag = 1 THEN + tm_cz.cz_end_audit (jobID, 'SUCCESS'); + END IF; + + EXCEPTION + WHEN OTHERS THEN + --Handle errors. + cz_error_handler (jobID, procedureName); + --End Proc + cz_end_audit (jobID, 'FAIL'); + +end i2b2_load_chrom_region; +/ diff --git a/ddl/oracle/tm_cz/procedures/i2b2_load_eqtl_top50.sql b/ddl/oracle/tm_cz/procedures/i2b2_load_eqtl_top50.sql new file mode 100644 index 00000000..705a681b --- /dev/null +++ b/ddl/oracle/tm_cz/procedures/i2b2_load_eqtl_top50.sql @@ -0,0 +1,156 @@ +-- +-- Type: PROCEDURE; Owner: TM_CZ; Name: I2B2_LOAD_EQTL_TOP50 +-- + CREATE OR REPLACE EDITIONABLE PROCEDURE "TM_CZ"."I2B2_LOAD_EQTL_TOP50" +(i_bio_assay_analysis_id number +,i_job_id number := null +) + AS + --Audit variables + newJobFlag INTEGER(1); + databaseName VARCHAR(100); + procedureName VARCHAR(100); + jobID number(18,0); + stepCt number(18,0); + + v_sqlText varchar2(2000); + +BEGIN + --Set Audit Parameters + newJobFlag := 0; -- False (Default) + jobID := i_job_id; + + SELECT sys_context('USERENV', 'CURRENT_SCHEMA') INTO databaseName FROM dual; + procedureName := $$PLSQL_UNIT; + + --Audit JOB Initialization + --If Job ID does not exist, then this is a single procedure run and we need to create it + IF(jobID IS NULL or jobID < 1) + THEN + newJobFlag := 1; -- True + cz_start_audit (procedureName, databaseName, jobID); + END IF; + + stepCt := 1; + cz_write_audit(jobID,databaseName,procedureName,'Starting ' || procedureName,0,stepCt,'Done'); + + -- delete existing data from bio_asy_analysis_eqtl_top50 + + delete from biomart.bio_asy_analysis_eqtl_top50 + where bio_assay_analysis_id = i_bio_assay_analysis_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Delete data for analysis from biomart.bio_asy_analysis_eqtls_top50',SQL%ROWCOUNT,stepCt,'Done'); + commit; + +/* + -- disable indexes + + for eqtl_idx in (select index_name + ,table_name + from all_indexes + where owner = 'BIOMART' + and table_name = 'BIO_ASY_ANALYSIS_EQTL_TOP50') + loop + v_sqlText := 'alter index ' || eqtl_idx.index_name || ' unusable'; + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Disabling index ' || eqtl_idx.index_name || ' on ' || eqtl_idx.table_name,0,stepCt,'Done'); + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Disabling complete',0,stepCt,'Done'); + end loop; +*/ + + -- insert analysis into bio_asy_analysis_eqtl_top50 + + insert into biomart.bio_asy_analysis_eqtl_top50 + (bio_assay_analysis_id + ,analysis + ,chrom + ,pos + ,rsgene + ,rsid + ,pvalue + ,logpvalue + ,extdata + ,rnum + ,intronexon + ,recombinationrate + ,regulome + ) + select a.bio_assay_analysis_id + ,a.analysis + ,info.chrom + ,info.pos + ,a.gene + ,a.rsid + ,a.pvalue + ,a.logpvalue + ,a.extdata + ,a.rnum + ,info.exon_intron as intronexon + ,info.recombination_rate as recombinationrate + ,info.regulome_score as regulome + from (select b.bio_assay_analysis_id + ,b.analysis + ,b.rsid + ,b.pvalue + ,b.logpvalue + ,b.extdata + ,b.gene + ,b.cis_trans + ,b.distance_from_gene + ,b.rnum + from (select eqtl.bio_assay_analysis_id + ,baa.analysis_name as analysis + ,eqtl.rs_id as rsid + ,eqtl.p_value as pvalue + ,eqtl.log_p_value as logpvalue + ,eqtl.ext_data as extdata + ,eqtl.gene + ,eqtl.cis_trans + ,eqtl.distance_from_gene + ,row_number () over (order by eqtl.p_value asc, eqtl.rs_id asc) as rnum + from biomart.bio_assay_analysis_eqtl eqtl + inner join biomart.bio_assay_analysis baa + on baa.bio_assay_analysis_id = eqtl.bio_assay_analysis_id + where eqtl.bio_assay_analysis_id = i_bio_assay_analysis_id) b + where b.rnum < 500) a + inner join deapp.de_rc_snp_info info + on a.rsid = info.rs_id + and hg_version='19'; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Insert data for analysis from biomart.bio_asy_analysis_eaqtl_top50',SQL%ROWCOUNT,stepCt,'Done'); + commit; + +/* + -- rebuild indexes + + for eqtl_idx in (select index_name + ,table_name + from all_indexes + where owner = 'BIOMART' + and table_name = 'BIO_ASY_ANALYSIS_EQTL_TOP50') + loop + v_sqlText := 'alter index ' || eqtl_idx.index_name || ' rebuild'; + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Rebuilding index ' || eqtl_idx.index_name || ' on ' || eqtl_idx.table_name,0,stepCt,'Done'); + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Rebuilding complete',SQL%ROWCOUNT,stepCt,'Done'); + end loop; +*/ + + cz_write_audit(jobID,databaseName,procedureName,'End ' || procedureName,0,stepCt,'Done'); + stepCt := stepCt + 1; + + cz_end_audit(jobID, 'Success'); + + exception + when others then + --Handle errors. + cz_error_handler (jobID, procedureName); + --End Proc + cz_end_audit (jobID, 'FAIL'); + +END I2B2_LOAD_eqtl_TOP50; +/ diff --git a/ddl/oracle/tm_cz/procedures/i2b2_load_gwas_top50.sql b/ddl/oracle/tm_cz/procedures/i2b2_load_gwas_top50.sql new file mode 100644 index 00000000..6705af0d --- /dev/null +++ b/ddl/oracle/tm_cz/procedures/i2b2_load_gwas_top50.sql @@ -0,0 +1,146 @@ +-- +-- Type: PROCEDURE; Owner: TM_CZ; Name: I2B2_LOAD_GWAS_TOP50 +-- + CREATE OR REPLACE EDITIONABLE PROCEDURE "TM_CZ"."I2B2_LOAD_GWAS_TOP50" +(i_bio_assay_analysis_id number +,i_job_id number := null +) + AS + --Audit variables + newJobFlag INTEGER(1); + databaseName VARCHAR(100); + procedureName VARCHAR(100); + jobID number(18,0); + stepCt number(18,0); + + v_sqlText varchar2(2000); + +BEGIN + --Set Audit Parameters + newJobFlag := 0; -- False (Default) + jobID := i_job_id; + + SELECT sys_context('USERENV', 'CURRENT_SCHEMA') INTO databaseName FROM dual; + procedureName := $$PLSQL_UNIT; + + --Audit JOB Initialization + --If Job ID does not exist, then this is a single procedure run and we need to create it + IF(jobID IS NULL or jobID < 1) + THEN + newJobFlag := 1; -- True + cz_start_audit (procedureName, databaseName, jobID); + END IF; + + stepCt := 1; + cz_write_audit(jobID,databaseName,procedureName,'Starting ' || procedureName,0,stepCt,'Done'); + + -- delete existing data from bio_asy_analysis_gwas_top50 + + delete from biomart.bio_asy_analysis_gwas_top50 + where bio_assay_analysis_id = i_bio_assay_analysis_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Delete data for analysis from biomart.bio_asy_analysis_gwas_top50',SQL%ROWCOUNT,stepCt,'Done'); + commit; + +/* + -- disable indexes + + for gwas_idx in (select index_name + ,table_name + from all_indexes + where owner = 'BIOMART' + and table_name = 'BIO_ASY_ANALYSIS_gwas_TOP50') + loop + v_sqlText := 'alter index ' || gwas_idx.index_name || ' unusable'; + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Disabling index ' || gwas_idx.index_name || ' on ' || gwas_idx.table_name,0,stepCt,'Done'); + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Disabling complete',0,stepCt,'Done'); + end loop; +*/ + + -- insert analysis into bio_asy_analysis_gwas_top50 + + insert into biomart.bio_asy_analysis_gwas_top50 + (bio_assay_analysis_id + ,analysis + ,chrom + ,pos + ,rsgene + ,rsid + ,pvalue + ,logpvalue + ,extdata + ,rnum + ,intronexon + ,recombinationrate + ,regulome + ) + select a.bio_assay_analysis_id + ,a.analysis + ,info.chrom + ,info.pos + ,info.gene_name AS rsgene + ,a.rsid + ,a.pvalue + ,a.logpvalue + ,a.extdata + ,a.rnum + ,info.exon_intron as intronexon + ,info.recombination_rate as recombinationrate + ,info.regulome_score as regulome + from (select b.bio_assay_analysis_id + ,b.analysis + ,b.rsid + ,b.pvalue + ,b.logpvalue + ,b.extdata + ,b.rnum + from (select gwas.bio_assay_analysis_id + ,baa.analysis_name as analysis + ,gwas.rs_id as rsid + ,gwas.p_value as pvalue + ,gwas.log_p_value as logpvalue + ,gwas.ext_data as extdata + ,row_number () over (order by gwas.p_value asc, gwas.rs_id asc) as rnum + from biomart.bio_assay_analysis_gwas gwas + left join biomart.bio_assay_analysis baa + on baa.bio_assay_analysis_id = gwas.bio_assay_analysis_id + where gwas.bio_assay_analysis_id = i_bio_assay_analysis_id) b + where b.rnum < 500) a + left join deapp.de_rc_snp_info info + on a.rsid = info.rs_id + and hg_version='19'; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Insert data for analysis from biomart.bio_asy_analysis_gwas_top50',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + /* for gwas_idx in (select index_name + ,table_name + from all_indexes + where owner = 'BIOMART' + and table_name = 'BIO_ASY_ANALYSIS_GWAS_TOP50') + loop + v_sqlText := 'alter index ' || gwas_idx.index_name || ' rebuild'; + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Rebuilding index ' || gwas_idx.index_name || ' on ' || gwas_idx.table_name,0,stepCt,'Done'); + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Rebuilding complete',SQL%ROWCOUNT,stepCt,'Done'); + end loop; + */ + cz_write_audit(jobID,databaseName,procedureName,'End ' || procedureName,0,stepCt,'Done'); + stepCt := stepCt + 1; + + cz_end_audit(jobID, 'Success'); + + exception + when others then + --Handle errors. + cz_error_handler (jobID, procedureName); + --End Proc + cz_end_audit (jobID, 'FAIL'); + +END I2B2_LOAD_GWAS_TOP50; +/ diff --git a/ddl/oracle/tm_cz/procedures/i2b2_load_proteomics_annot.sql b/ddl/oracle/tm_cz/procedures/i2b2_load_proteomics_annot.sql index 52457aaa..0a297c5d 100644 --- a/ddl/oracle/tm_cz/procedures/i2b2_load_proteomics_annot.sql +++ b/ddl/oracle/tm_cz/procedures/i2b2_load_proteomics_annot.sql @@ -46,31 +46,6 @@ BEGIN select distinct gpl_id into gplId from lt_protein_annotation ; -/* - -- delete any existing data from probeset_deapp - - delete from peptide_deapp - where platform = idREF; - - stepCt := stepCt + 1; - cz_write_audit(jobId,databaseName,procedureName,'Delete existing data from REFERENCE peptide_probeset_deapp',SQL%ROWCOUNT,stepCt,'Done'); -*/ - - -- delete any existing data from peptide_annotation_deapp - - /*delete from mirna_annotation_deapp - where id_ref in ( select distinct id_ref from lt_qpcr_mirna_annotation); - - stepCt := stepCt + 1; - cz_write_audit(jobId,databaseName,procedureName,'Delete existing data from mirna_annotation_deapp',SQL%ROWCOUNT,stepCt,'Done');*/ - - /* delete from peptide_deapp - where peptide in ( select distinct peptide from lt_protein_annotation); - - stepCt := stepCt + 1; - cz_write_audit(jobId,databaseName,procedureName,'Delete existing data from peptide_deapp',SQL%ROWCOUNT,stepCt,'Done'); - - */ -- delete any existing data from deapp.de_protien_annotation delete from deapp.de_protein_annotation where gpl_id =gplId; @@ -78,48 +53,7 @@ BEGIN stepCt := stepCt + 1; cz_write_audit(jobId,databaseName,procedureName,'Delete existing data from de_protein_annotation',SQL%ROWCOUNT,stepCt,'Done'); - - - - -- update organism for existing probesets in peptide_deapp - /* - update peptide_deapp p - set organism=(select distinct t.organism from lt_protein_annotation t - where p.platform = t.gpl_id - and p.peptide = t.peptide - ) - where exists - (select 1 from lt_protein_annotation x - where p.platform =x.gpl_id - and p.peptide = x.peptide); - - stepCt := stepCt + 1; - cz_write_audit(jobId,databaseName,procedureName,'Update organism in peptide_deapp',SQL%ROWCOUNT,stepCt,'Done'); - */ - -- insert any new probesets into peptide_deapp - - /*insert into peptide_deapp - (peptide - ,organism - ,platform) - select distinct peptide - ,coalesce(organism,'Homo sapiens') - ,gpl_id - from lt_protein_annotation t - where not exists - (select 1 from peptide_deapp x - where t.gpl_id = x.platform - and t.peptide = x.peptide - and coalesce(t.organism,'Homo sapiens') = coalesce(x.organism,'Homo sapiens')) - ; - commit; - - --where id_ref is not null - -- or gene_symbol is not null; - - stepCt := stepCt + 1; - cz_write_audit(jobId,databaseName,procedureName,'Insert new probesets into peptide_deapp',SQL%ROWCOUNT,stepCt,'Done'); */ - + insert into deapp.de_protein_annotation (gpl_id ,peptide @@ -135,33 +69,11 @@ BEGIN ,biomart.bio_marker p where d.gpl_id = gplId and p.primary_external_id = d.uniprot_id - -- and coalesce(d.organism,'Homo sapiens') = coalesce(p.organism,'Homo sapiens') - -- and (d.gpl_id is not null or d.gene_symbol is not null) ; stepCt := stepCt + 1; cz_write_audit(jobId,databaseName,procedureName,'Load annotation data into DEAPP de_protien_annotation',SQL%ROWCOUNT,stepCt,'Done'); - -- update id_ref if null - -/* update deapp.de_peptide_annotation t - set id_ref=(select to_number(min(b.primary_external_id)) as mirna_id - from biomart.mirna_bio_marker b - where t.mirna_symbol = b.bio_marker_name - and upper(b.organism) = upper(t.organism) - and upper(b.bio_marker_type) = 'PROTIEN') - where t.id_ref = idREF - and t.gene_id is null - and t.gene_symbol is not null - and exists - (select 1 from biomart.mirna_bio_marker x - where t.mirna_symbol = x.bio_marker_name - and upper(x.organism) = upper(t.organism) - and upper(x.bio_marker_type) = 'PROTEIN'); - - stepCt := stepCt + 1; - cz_write_audit(jobId,databaseName,procedureName,'Updated missing id_ref in de_protien_annotation',SQL%ROWCOUNT,stepCt,'Done'); - */ -- update gene_symbol if null update deapp.de_protein_annotation t diff --git a/ddl/oracle/tm_cz/procedures/i2b2_load_rbm_ b/ddl/oracle/tm_cz/procedures/i2b2_load_rbm_ new file mode 100644 index 00000000..e69de29b diff --git a/ddl/oracle/tm_cz/procedures/i2b2_move_analysis_to_prod.sql b/ddl/oracle/tm_cz/procedures/i2b2_move_analysis_to_prod.sql new file mode 100644 index 00000000..9d42c8e1 --- /dev/null +++ b/ddl/oracle/tm_cz/procedures/i2b2_move_analysis_to_prod.sql @@ -0,0 +1,353 @@ +-- +-- Type: PROCEDURE; Owner: TM_CZ; Name: I2B2_MOVE_ANALYSIS_TO_PROD +-- + CREATE OR REPLACE EDITIONABLE PROCEDURE "TM_CZ"."I2B2_MOVE_ANALYSIS_TO_PROD" +(i_etl_id number := -1 +,i_job_id number := null +) +AS + -- For partitioned table 2/4/2014 + --Audit variables + newJobFlag INTEGER(1); + databaseName VARCHAR(100); + procedureName VARCHAR(100); + jobID number(18,0); + stepCt number(18,0); + + v_etl_id number(18,0); + v_bio_assay_analysis_id number(18,0); + v_data_type varchar2(50); + v_sqlText varchar2(2000); + v_exists int; + v_GWAS_staged int; + v_EQTL_staged int; + v_gwas_indx int; + v_eqtl_indx int; + v_max_ext_flds int; + + BEGIN + + --Set Audit Parameters + newJobFlag := 0; -- False (Default) + jobID := -1; + + SELECT sys_context('USERENV', 'CURRENT_SCHEMA') INTO databaseName FROM dual; + procedureName := $$PLSQL_UNIT; + + --Audit JOB Initialization + --If Job ID does not exist, then this is a single procedure run and we need to create it + IF(jobID IS NULL or jobID < 1) + THEN + newJobFlag := 1; -- True + cz_start_audit (procedureName, databaseName, jobID); + END IF; + + stepCt := 1; + cz_write_audit(jobID,databaseName,procedureName,'Starting i2b2_move_analysis_to_prod',0,stepCt,'Done'); + + v_GWAS_staged := 0; + v_EQTL_staged := 0; + v_gwas_indx := 0; + + -- load staged analysis to array + + for stage_rec in + (select baa.bio_assay_analysis_id + ,lz.etl_id + ,lz.study_id + ,case when lz.data_type = 'Metabolic GWAS' then 'GWAS' else lz.data_type end as data_type + ,lz.data_type as orig_data_type + ,lz.analysis_name + from tm_lz.lz_src_analysis_metadata lz + ,biomart.bio_assay_analysis baa + where lz.status = 'STAGED' + and lz.study_id = baa.etl_id + and lz.etl_id = baa.etl_id_source + and case when i_etl_id = -1 then 1 + when lz.etl_id = i_etl_id then 1 + else 0 end = 1) + loop + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Loading ' || stage_rec.study_id || ' ' || stage_rec.orig_data_type || ' ' || + stage_rec.analysis_name,0,stepCt,'Done'); + + v_bio_assay_analysis_id := stage_rec.bio_assay_analysis_id; + v_etl_id := stage_rec.etl_id; + v_data_type := stage_rec.data_type; + + -- get max nbr fields in ext_data for original data type + + select max(field_idx) into v_max_ext_flds + from biomart.bio_asy_analysis_data_idx + where ext_type = stage_rec.orig_data_type; + + if stage_rec.data_type = 'GWAS' then + -- GWAS data + v_GWAS_staged := 1; + /* comment out for not disabling the indexes by HZ 1/15/2014 + if v_gwas_indx = 0 then + -- disable indexes if loading GWAS data + for gwas_idx in (select index_name + ,table_name + from all_indexes + where owner = 'BIOMART' + and table_name in ('BIO_ASSAY_ANALYSIS_GWAS','BIO_ASY_ANALYSIS_GWAS_TOP50') + and partitioned = 'NO' and compression!='DISABLED' ) + loop + v_sqlText := 'alter index biomart.' || gwas_idx.index_name || ' unusable'; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Disabling index ' || gwas_idx.index_name || ' on ' || gwas_idx.table_name,SQL%ROWCOUNT,stepCt,'Done'); + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Disabling complete',SQL%ROWCOUNT,stepCt,'Done'); + end loop; + v_gwas_indx := 1; + end if; + */ + -- check if partition exists for bio_assay_analysis_id, if not, add, if yes, truncate + select count(*) into v_exists + from all_tab_partitions + where table_name = 'BIO_ASSAY_ANALYSIS_GWAS' + and partition_name = to_char(v_bio_assay_analysis_id); + + if v_exists = 0 then + -- add partition to bio_assay_analysis_gwas + v_sqlText := 'alter table biomart.bio_assay_analysis_gwas add PARTITION "' || to_char(v_bio_assay_analysis_id) || '" VALUES (' || + to_char(v_bio_assay_analysis_id) || ') ' || + 'NOLOGGING TABLESPACE "BIOMART" '; + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Adding partition to bio_assay_analysis_gwas '|| to_char(v_bio_assay_analysis_id),0,stepCt,'Done'); + else + -- truncate existing partition + v_sqlText := 'alter table biomart.bio_assay_analysis_gwas truncate partition "' || to_char(v_bio_assay_analysis_id) || '"'; + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Truncating partition in bio_assay_analysis_gwas '|| to_char(v_bio_assay_analysis_id),0,stepCt,'Done'); + end if; + + insert into biomart.bio_assay_analysis_gwas + (bio_asy_analysis_gwas_id + ,bio_assay_analysis_id + ,rs_id + ,p_value + ,p_value_char + ,etl_id + ,ext_data + ,log_p_value) + select bio_asy_analysis_gwas_id + ,bio_assay_analysis_id + ,rs_id + ,to_binary_double(p_value_char) + ,p_value_char + ,etl_id + ,case when length(ext_data)-length(replace(ext_data,';','')) < v_max_ext_flds + then tm_cz.repeat_char(ext_data,v_max_ext_flds-(length(ext_data)-length(replace(ext_data,';',''))),';') + else ext_data + end + ,case when log10_pval_char is null then log(10,to_binary_double(p_value_char))*-1 + else + to_binary_double(log10_pval_char) + end + from biomart_stage.bio_assay_analysis_gwas + where bio_assay_analysis_id = v_bio_assay_analysis_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Insert data for analysis from biomart.bio_assay_analysis_gwas',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- update data_count in bio_assay_analysis + + update biomart.bio_assay_analysis baa + set data_count=(select count(*) from biomart.bio_assay_analysis_gwas x + where x.bio_assay_analysis_id=v_bio_assay_analysis_id) + where baa.bio_assay_analysis_id=v_bio_assay_analysis_id; + stepCt := stepCt +1; + cz_write_audit(jobID,databaseName,procedureName,'Update data_count for analysis',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- update status in lz_src_analysis_metadata + + update tm_lz.lz_src_analysis_metadata + set status='PRODUCTION' + where etl_id = v_etl_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Set status to PRODUCTION in tm_lz.lz_src_analysis_metadata',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- delete data from biomart_stage + + delete from biomart_stage.bio_assay_analysis_gwas + where bio_assay_analysis_id = v_bio_assay_analysis_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Delete data for analysis from biomart_stage.bio_assay_analysis_gwas',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- load top50 table + i2b2_load_gwas_top50(v_bio_assay_analysis_id, jobID); + + else + -- EQTL data + v_EQTL_staged := 1; + /* + if v_eqtl_indx = 0 then + -- disable indexes if loading eqtl data + for eqtl_idx in (select index_name + ,table_name + from all_indexes + where owner = 'BIOMART' + and table_name = 'BIO_ASY_ANALYSIS_EQTL_TOP50' ) + loop + v_sqlText := 'alter index ' || eqtl_idx.index_name || ' unusable'; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Disabling index ' || eqtl_idx.index_name || ' on ' || eqtl_idx.table_name,SQL%ROWCOUNT,stepCt,'Done'); + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Disabling complete',SQL%ROWCOUNT,stepCt,'Done'); + end loop; + v_eqtl_indx := 1; + end if; + */ + -- delete existing data from bio_assay_analysis_eqtl + delete from biomart.bio_assay_analysis_eqtl g + where g.bio_assay_analysis_id = v_bio_assay_analysis_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Delete exising data for staged analyses from biomart.bio_assay_analysis_eqtl',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + insert into biomart.bio_assay_analysis_eqtl + (bio_asy_analysis_eqtl_id + ,bio_assay_analysis_id + ,rs_id + ,gene + ,p_value + ,p_value_char + ,cis_trans + ,distance_from_gene + ,etl_id + ,ext_data + ,log_p_value) + select bio_asy_analysis_eqtl_id + ,bio_assay_analysis_id + ,rs_id + ,gene + ,to_binary_double(p_value_char) + ,p_value_char + ,cis_trans + ,distance_from_gene + ,etl_id + ,case when length(ext_data)-length(replace(ext_data,';','')) < v_max_ext_flds + then tm_cz.repeat_char(ext_data,v_max_ext_flds-(length(ext_data)-length(replace(ext_data,';',''))),';') + else ext_data + end + ,log(10,to_binary_double(p_value_char))*-1 + from biomart_stage.bio_assay_analysis_eqtl + where bio_assay_analysis_id = v_bio_assay_analysis_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Insert data for analysis into biomart.bio_assay_analysis_eqtl',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- update data_count in bio_assay_analysis + + update biomart.bio_assay_analysis baa + set data_count=(select count(*) from biomart.bio_assay_analysis_eqtl x + where x.bio_assay_analysis_id=v_bio_assay_analysis_id) + where baa.bio_assay_analysis_id=v_bio_assay_analysis_id; + stepCt := stepCt +1; + cz_write_audit(jobID,databaseName,procedureName,'Update data_count for analysis',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- update status in lz_src_analysis_metadata + + update tm_lz.lz_src_analysis_metadata + set status='PRODUCTION' + where etl_id = v_etl_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Set status to PRODUCTION in tm_lz.lz_src_analysis_metadata',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- delete data from biomart_stage + + delete from biomart_stage.bio_assay_analysis_eqtl + where bio_assay_analysis_id = v_bio_assay_analysis_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Delete data for analysis from biomart_stage.bio_assay_analysis_eqtl',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- load top50 table + i2b2_load_eqtl_top50(v_bio_assay_analysis_id, jobID); + + end if; + end loop; + + -- rebuild indexes if loading GWAS data + /* + if v_GWAS_staged = 1 then + for gwas_idx in (select index_name + ,table_name + from all_indexes + where owner = 'BIOMART' + and table_name In ('BIO_ASSAY_ANALYSIS_GWAS','BIO_ASY_ANALYSIS_GWAS_TOP50') ) + loop + v_sqlText := 'alter index ' || gwas_idx.index_name || ' rebuild'; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Rebuilding index ' || gwas_idx.index_name || ' on ' || gwas_idx.table_name,SQL%ROWCOUNT,stepCt,'Done'); + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Rebuilding complete',SQL%ROWCOUNT,stepCt,'Done'); + end loop; + end if; + */ + if v_gwas_staged = 0 and v_eqtl_staged = 0 then + cz_write_audit(jobID, databaseName, procedureName, 'No staged data - run terminating normally',0,stepCt,'Done'); + cz_end_audit(jobID, 'Success'); + end if; + + -- rebuild indexes if loading EQTL data + /* + if v_eqtl_staged = 1 then + for eqtl_idx in (select index_name + ,table_name + from all_indexes + where owner = 'BIOMART' + and table_name = 'BIO_ASY_ANALYSIS_EQTL_TOP50') + loop + v_sqlText := 'alter index ' || eqtl_idx.index_name || ' rebuild'; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Rebuilding index ' || eqtl_idx.index_name || ' on ' || eqtl_idx.table_name,SQL%ROWCOUNT,stepCt,'Done'); + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Rebuilding complete',SQL%ROWCOUNT,stepCt,'Done'); + end loop; + end if; + */ + /* if v_eqtl_staged = 0 and v_eqtl_staged = 0 then + cz_write_audit(jobID, databaseName, procedureName, 'No staged data - run terminating normally',0,stepCt,'Done'); + cz_end_audit(jobID, 'Success'); + end if; + */ + -- check if any data left in staging tables, ususally indicated no bio_assay_analysis record in biomart + + select count(*) into v_exists + from (select distinct bio_assay_analysis_id from biomart_stage.bio_assay_analysis_gwas + union + select distinct bio_assay_analysis_id from biomart_stage.bio_assay_analysis_eqtl); + + if v_exists > 0 then + cz_write_audit(jobID, databaseName, procedureName, '**WARNING ** data remains in stage tables',0,stepCt,'Done'); + -- cz_end_audit(jobID, 'Success'); + end if; + + cz_write_audit(jobID,databaseName,procedureName,'End ' || procedureName,0,stepCt,'Done'); + stepCt := stepCt + 1; + + cz_end_audit(jobID, 'Success'); + + exception + when others then + --Handle errors. + cz_error_handler (jobID, procedureName); + --End Proc + cz_end_audit (jobID, 'FAIL'); + +END; +/ diff --git a/ddl/oracle/tm_cz/procedures/i2b2_move_analysis_to_prod_new.sql b/ddl/oracle/tm_cz/procedures/i2b2_move_analysis_to_prod_new.sql new file mode 100644 index 00000000..776977ed --- /dev/null +++ b/ddl/oracle/tm_cz/procedures/i2b2_move_analysis_to_prod_new.sql @@ -0,0 +1,353 @@ +-- +-- Type: PROCEDURE; Owner: TM_CZ; Name: I2B2_MOVE_ANALYSIS_TO_PROD_NEW +-- + CREATE OR REPLACE EDITIONABLE PROCEDURE "TM_CZ"."I2B2_MOVE_ANALYSIS_TO_PROD_NEW" +(i_etl_id number := -1 +,i_job_id number := null +) +AS + -- For partitioned table 2/4/2014 + --Audit variables + newJobFlag INTEGER(1); + databaseName VARCHAR(100); + procedureName VARCHAR(100); + jobID number(18,0); + stepCt number(18,0); + + v_etl_id number(18,0); + v_bio_assay_analysis_id number(18,0); + v_data_type varchar2(50); + v_sqlText varchar2(2000); + v_exists int; + v_GWAS_staged int; + v_EQTL_staged int; + v_gwas_indx int; + v_eqtl_indx int; + v_max_ext_flds int; + + BEGIN + + --Set Audit Parameters + newJobFlag := 0; -- False (Default) + jobID := -1; + + SELECT sys_context('USERENV', 'CURRENT_SCHEMA') INTO databaseName FROM dual; + procedureName := $$PLSQL_UNIT; + + --Audit JOB Initialization + --If Job ID does not exist, then this is a single procedure run and we need to create it + IF(jobID IS NULL or jobID < 1) + THEN + newJobFlag := 1; -- True + cz_start_audit (procedureName, databaseName, jobID); + END IF; + + stepCt := 1; + cz_write_audit(jobID,databaseName,procedureName,'Starting i2b2_move_analysis_to_prod',0,stepCt,'Done'); + + v_GWAS_staged := 0; + v_EQTL_staged := 0; + v_gwas_indx := 0; + + -- load staged analysis to array + + for stage_rec in + (select baa.bio_assay_analysis_id + ,lz.etl_id + ,lz.study_id + ,case when lz.data_type = 'Metabolic GWAS' then 'GWAS' else lz.data_type end as data_type + ,lz.data_type as orig_data_type + ,lz.analysis_name + from tm_lz.lz_src_analysis_metadata lz + ,biomart.bio_assay_analysis baa + where lz.status = 'STAGED' + and lz.study_id = baa.etl_id + and lz.etl_id = baa.etl_id_source + and case when i_etl_id = -1 then 1 + when lz.etl_id = i_etl_id then 1 + else 0 end = 1) + loop + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Loading ' || stage_rec.study_id || ' ' || stage_rec.orig_data_type || ' ' || + stage_rec.analysis_name,0,stepCt,'Done'); + + v_bio_assay_analysis_id := stage_rec.bio_assay_analysis_id; + v_etl_id := stage_rec.etl_id; + v_data_type := stage_rec.data_type; + + -- get max nbr fields in ext_data for original data type + + select max(field_idx) into v_max_ext_flds + from biomart.bio_asy_analysis_data_idx + where ext_type = stage_rec.orig_data_type; + + if stage_rec.data_type = 'GWAS' then + -- GWAS data + v_GWAS_staged := 1; + /* comment out for not disabling the indexes by HZ 1/15/2014 + if v_gwas_indx = 0 then + -- disable indexes if loading GWAS data + for gwas_idx in (select index_name + ,table_name + from all_indexes + where owner = 'BIOMART' + and table_name in ('BIO_ASSAY_ANALYSIS_GWAS','BIO_ASY_ANALYSIS_GWAS_TOP50') + and partitioned = 'NO' and compression!='DISABLED' ) + loop + v_sqlText := 'alter index biomart.' || gwas_idx.index_name || ' unusable'; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Disabling index ' || gwas_idx.index_name || ' on ' || gwas_idx.table_name,SQL%ROWCOUNT,stepCt,'Done'); + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Disabling complete',SQL%ROWCOUNT,stepCt,'Done'); + end loop; + v_gwas_indx := 1; + end if; + */ + -- check if partition exists for bio_assay_analysis_id, if not, add, if yes, truncate + select count(*) into v_exists + from all_tab_partitions + where table_name = 'BIO_ASSAY_ANALYSIS_GWAS' + and partition_name = to_char(v_bio_assay_analysis_id); + + if v_exists = 0 then + -- add partition to bio_assay_analysis_gwas + v_sqlText := 'alter table biomart.bio_assay_analysis_gwas add PARTITION "' || to_char(v_bio_assay_analysis_id) || '" VALUES (' || + to_char(v_bio_assay_analysis_id) || ') ' || + 'NOLOGGING TABLESPACE "BIOMART" '; + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Adding partition to bio_assay_analysis_gwas '|| to_char(v_bio_assay_analysis_id),0,stepCt,'Done'); + else + -- truncate existing partition + v_sqlText := 'alter table biomart.bio_assay_analysis_gwas truncate partition "' || to_char(v_bio_assay_analysis_id) || '"'; + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Truncating partition in bio_assay_analysis_gwas '|| to_char(v_bio_assay_analysis_id),0,stepCt,'Done'); + end if; + + insert into biomart.bio_assay_analysis_gwas + (bio_asy_analysis_gwas_id + ,bio_assay_analysis_id + ,rs_id + ,p_value + ,p_value_char + ,etl_id + ,ext_data + ,log_p_value) + select bio_asy_analysis_gwas_id + ,bio_assay_analysis_id + ,rs_id + ,to_binary_double(p_value_char) + ,p_value_char + ,etl_id + ,case when length(ext_data)-length(replace(ext_data,';','')) < v_max_ext_flds + then tm_cz.repeat_char(ext_data,v_max_ext_flds-(length(ext_data)-length(replace(ext_data,';',''))),';') + else ext_data + end + ,case when log10_pval_char is null then log(10,to_binary_double(p_value_char))*-1 + else + to_binary_double(log10_pval_char) + end + from biomart_stage.bio_assay_analysis_gwas + where bio_assay_analysis_id = v_bio_assay_analysis_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Insert data for analysis from biomart.bio_assay_analysis_gwas',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- update data_count in bio_assay_analysis + + update biomart.bio_assay_analysis baa + set data_count=(select count(*) from biomart.bio_assay_analysis_gwas x + where x.bio_assay_analysis_id=v_bio_assay_analysis_id) + where baa.bio_assay_analysis_id=v_bio_assay_analysis_id; + stepCt := stepCt +1; + cz_write_audit(jobID,databaseName,procedureName,'Update data_count for analysis',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- update status in lz_src_analysis_metadata + + update tm_lz.lz_src_analysis_metadata + set status='PRODUCTION' + where etl_id = v_etl_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Set status to PRODUCTION in tm_lz.lz_src_analysis_metadata',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- delete data from biomart_stage + + delete from biomart_stage.bio_assay_analysis_gwas + where bio_assay_analysis_id = v_bio_assay_analysis_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Delete data for analysis from biomart_stage.bio_assay_analysis_gwas',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- load top50 table + i2b2_load_gwas_top50(v_bio_assay_analysis_id, jobID); + + else + -- EQTL data + v_EQTL_staged := 1; + /* + if v_eqtl_indx = 0 then + -- disable indexes if loading eqtl data + for eqtl_idx in (select index_name + ,table_name + from all_indexes + where owner = 'BIOMART' + and table_name = 'BIO_ASY_ANALYSIS_EQTL_TOP50' ) + loop + v_sqlText := 'alter index ' || eqtl_idx.index_name || ' unusable'; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Disabling index ' || eqtl_idx.index_name || ' on ' || eqtl_idx.table_name,SQL%ROWCOUNT,stepCt,'Done'); + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Disabling complete',SQL%ROWCOUNT,stepCt,'Done'); + end loop; + v_eqtl_indx := 1; + end if; + */ + -- delete existing data from bio_assay_analysis_eqtl + delete from biomart.bio_assay_analysis_eqtl g + where g.bio_assay_analysis_id = v_bio_assay_analysis_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Delete exising data for staged analyses from biomart.bio_assay_analysis_eqtl',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + insert into biomart.bio_assay_analysis_eqtl + (bio_asy_analysis_eqtl_id + ,bio_assay_analysis_id + ,rs_id + ,gene + ,p_value + ,p_value_char + ,cis_trans + ,distance_from_gene + ,etl_id + ,ext_data + ,log_p_value) + select bio_asy_analysis_eqtl_id + ,bio_assay_analysis_id + ,rs_id + ,gene + ,to_binary_double(p_value_char) + ,p_value_char + ,cis_trans + ,distance_from_gene + ,etl_id + ,case when length(ext_data)-length(replace(ext_data,';','')) < v_max_ext_flds + then tm_cz.repeat_char(ext_data,v_max_ext_flds-(length(ext_data)-length(replace(ext_data,';',''))),';') + else ext_data + end + ,log(10,to_binary_double(p_value_char))*-1 + from biomart_stage.bio_assay_analysis_eqtl + where bio_assay_analysis_id = v_bio_assay_analysis_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Insert data for analysis into biomart.bio_assay_analysis_eqtl',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- update data_count in bio_assay_analysis + + update biomart.bio_assay_analysis baa + set data_count=(select count(*) from biomart.bio_assay_analysis_eqtl x + where x.bio_assay_analysis_id=v_bio_assay_analysis_id) + where baa.bio_assay_analysis_id=v_bio_assay_analysis_id; + stepCt := stepCt +1; + cz_write_audit(jobID,databaseName,procedureName,'Update data_count for analysis',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- update status in lz_src_analysis_metadata + + update tm_lz.lz_src_analysis_metadata + set status='PRODUCTION' + where etl_id = v_etl_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Set status to PRODUCTION in tm_lz.lz_src_analysis_metadata',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- delete data from biomart_stage + + delete from biomart_stage.bio_assay_analysis_eqtl + where bio_assay_analysis_id = v_bio_assay_analysis_id; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Delete data for analysis from biomart_stage.bio_assay_analysis_eqtl',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- load top50 table + i2b2_load_eqtl_top50(v_bio_assay_analysis_id, jobID); + + end if; + end loop; + + -- rebuild indexes if loading GWAS data + /* + if v_GWAS_staged = 1 then + for gwas_idx in (select index_name + ,table_name + from all_indexes + where owner = 'BIOMART' + and table_name In ('BIO_ASSAY_ANALYSIS_GWAS','BIO_ASY_ANALYSIS_GWAS_TOP50') ) + loop + v_sqlText := 'alter index ' || gwas_idx.index_name || ' rebuild'; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Rebuilding index ' || gwas_idx.index_name || ' on ' || gwas_idx.table_name,SQL%ROWCOUNT,stepCt,'Done'); + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Rebuilding complete',SQL%ROWCOUNT,stepCt,'Done'); + end loop; + end if; + */ + if v_gwas_staged = 0 and v_eqtl_staged = 0 then + cz_write_audit(jobID, databaseName, procedureName, 'No staged data - run terminating normally',0,stepCt,'Done'); + cz_end_audit(jobID, 'Success'); + end if; + + -- rebuild indexes if loading EQTL data + /* + if v_eqtl_staged = 1 then + for eqtl_idx in (select index_name + ,table_name + from all_indexes + where owner = 'BIOMART' + and table_name = 'BIO_ASY_ANALYSIS_EQTL_TOP50') + loop + v_sqlText := 'alter index ' || eqtl_idx.index_name || ' rebuild'; + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Rebuilding index ' || eqtl_idx.index_name || ' on ' || eqtl_idx.table_name,SQL%ROWCOUNT,stepCt,'Done'); + execute immediate(v_sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobID,databaseName,procedureName,'Rebuilding complete',SQL%ROWCOUNT,stepCt,'Done'); + end loop; + end if; + */ + /* if v_eqtl_staged = 0 and v_eqtl_staged = 0 then + cz_write_audit(jobID, databaseName, procedureName, 'No staged data - run terminating normally',0,stepCt,'Done'); + cz_end_audit(jobID, 'Success'); + end if; + */ + -- check if any data left in staging tables, ususally indicated no bio_assay_analysis record in biomart + + select count(*) into v_exists + from (select distinct bio_assay_analysis_id from biomart_stage.bio_assay_analysis_gwas + union + select distinct bio_assay_analysis_id from biomart_stage.bio_assay_analysis_eqtl); + + if v_exists > 0 then + cz_write_audit(jobID, databaseName, procedureName, '**WARNING ** data remains in stage tables',0,stepCt,'Done'); + -- cz_end_audit(jobID, 'Success'); + end if; + + cz_write_audit(jobID,databaseName,procedureName,'End ' || procedureName,0,stepCt,'Done'); + stepCt := stepCt + 1; + + cz_end_audit(jobID, 'Success'); + + exception + when others then + --Handle errors. + cz_error_handler (jobID, procedureName); + --End Proc + cz_end_audit (jobID, 'FAIL'); + +END; +/ diff --git a/ddl/oracle/tm_cz/procedures/i2b2_mrna_index_maint.sql b/ddl/oracle/tm_cz/procedures/i2b2_mrna_index_maint.sql index 68aba0d5..29222252 100644 --- a/ddl/oracle/tm_cz/procedures/i2b2_mrna_index_maint.sql +++ b/ddl/oracle/tm_cz/procedures/i2b2_mrna_index_maint.sql @@ -107,6 +107,58 @@ BEGIN stepCt := stepCt + 1; cz_write_audit(jobId,databaseName,procedureName,'Drop de_microarray_data_idx2',0,stepCt,'Done'); end if; + + select count(*) + into idxExists + from all_indexes + where table_name = 'DE_SUBJECT_MICROARRAY_DATA' + and index_name = 'DE_MICROARRAY_DATA_IDX3' + and owner = 'DEAPP'; + + if idxExists = 1 then + execute immediate('drop index deapp.de_microarray_data_idx3'); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Drop de_microarray_data_idx3',0,stepCt,'Done'); + end if; + + select count(*) + into idxExists + from all_indexes + where table_name = 'DE_SUBJECT_MICROARRAY_DATA' + and index_name = 'DE_MICROARRAY_DATA_IDX4' + and owner = 'DEAPP'; + + if idxExists = 1 then + execute immediate('drop index deapp.de_microarray_data_idx4'); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Drop de_microarray_data_idx4',0,stepCt,'Done'); + end if; + + select count(*) + into idxExists + from all_indexes + where table_name = 'DE_SUBJECT_MICROARRAY_DATA' + and index_name = 'DE_MICROARRAY_DATA_IDX5' + and owner = 'DEAPP'; + + if idxExists = 1 then + execute immediate('drop index deapp.de_microarray_data_idx5'); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Drop de_microarray_data_idx5',0,stepCt,'Done'); + end if; + + select count(*) + into idxExists + from all_indexes + where table_name = 'DE_SUBJECT_MICROARRAY_DATA' + and index_name = 'DE_MICROARRAY_DATA_IDX10' + and owner = 'DEAPP'; + + if idxExists = 1 then + execute immediate('drop index deapp.de_microarray_data_idx10'); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Drop de_microarray_data_idx10',0,stepCt,'Done'); + end if; else -- add indexes @@ -121,7 +173,7 @@ BEGIN and owner = 'DEAPP'; if idxExists = 0 then - execute immediate('create index deapp.de_microarray_data_idx1 on deapp.de_subject_microarray_data(probeset_id) ' || localVar || ' nologging compress tablespace "' || tableSpace || '"'); + execute immediate('create index deapp.de_microarray_data_idx1 on deapp.de_subject_microarray_data(trial_name, assay_id, probeset_id) ' || localVar || ' nologging compress tablespace "' || tableSpace || '"'); stepCt := stepCt + 1; cz_write_audit(jobId,databaseName,procedureName,'Create de_microarray_data_idx1',0,stepCt,'Done'); end if; @@ -134,10 +186,36 @@ BEGIN and owner = 'DEAPP'; if idxExists = 0 then - execute immediate('create index deapp.de_microarray_data_idx2 on deapp.de_subject_microarray_data(assay_id) ' || localVar || ' nologging compress tablespace "' || tableSpace || '"'); + execute immediate('create index deapp.de_microarray_data_idx2 on deapp.de_subject_microarray_data(assay_id, probeset_id) ' || localVar || ' nologging compress tablespace "' || tableSpace || '"'); stepCt := stepCt + 1; cz_write_audit(jobId,databaseName,procedureName,'Create de_microarray_data_idx2',0,stepCt,'Done'); end if; + + select count(*) + into idxExists + from all_indexes + where table_name = 'DE_SUBJECT_MICROARRAY_DATA' + and index_name = 'DE_MICROARRAY_DATA_IDX3' + and owner = 'DEAPP'; + + if idxExists = 0 then + execute immediate('create ' || bitmapVar || ' index deapp.de_microarray_data_idx3 on deapp.de_subject_microarray_data(assay_id) ' || localVar || ' nologging ' || bitmapCompress || ' tablespace "' || tableSpace || '"'); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create de_microarray_data_idx3',0,stepCt,'Done'); + end if; + + select count(*) + into idxExists + from all_indexes + where table_name = 'DE_SUBJECT_MICROARRAY_DATA' + and index_name = 'DE_MICROARRAY_DATA_IDX4' + and owner = 'DEAPP'; + + if idxExists = 0 then + execute immediate('create ' || bitmapVar || ' index deapp.de_microarray_data_idx4 on deapp.de_subject_microarray_data(probeset_id) ' || localVar || ' nologging ' || bitmapCompress || ' tablespace "' || tableSpace || '"'); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create de_microarray_data_idx4',0,stepCt,'Done'); + end if; if pExists = 0 then -- only create this index if the table is not partitioned. This is the column that the table would be partitioned on @@ -156,6 +234,21 @@ BEGIN end if; end if; +/* not used + + select count(*) + into idxExists + from all_indexes + where table_name = 'DE_SUBJECT_MICROARRAY_DATA' + and index_name = 'DE_MICROARRAY_DATA_IDX10' + and owner = 'DEAPP'; + + if idxExists = 0 then + execute immediate('create index deapp.de_microarray_data_idx10 on deapp.de_subject_microarray_data(assay_id, subject_id, probeset_id, zscore) ' || localVar || ' nologging compress tablespace "' || tableSpace || '"'); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create de_microarray_data_idx10',0,stepCt,'Done'); + end if; +*/ end if; stepCt := stepCt + 1; diff --git a/ddl/oracle/tm_cz/procedures/i2b2_process_acgh_data.sql b/ddl/oracle/tm_cz/procedures/i2b2_process_acgh_data.sql new file mode 100644 index 00000000..3efb6e0f --- /dev/null +++ b/ddl/oracle/tm_cz/procedures/i2b2_process_acgh_data.sql @@ -0,0 +1,980 @@ +-- +-- Type: PROCEDURE; Owner: TM_CZ; Name: I2B2_PROCESS_ACGH_DATA +-- + CREATE OR REPLACE EDITIONABLE PROCEDURE "TM_CZ"."I2B2_PROCESS_ACGH_DATA" +( + trial_id VARCHAR2 + ,top_node varchar2 + ,source_cd varchar2 := 'STD' -- default source_cd = 'STD' + ,secure_study varchar2 -- security setting if new patients added to patient_dimension + ,currentJobID NUMBER := null + ,rtn_code OUT NUMBER +) +AS +/************************************************************************* +* Copyright 2008-2012 Janssen Research BIOMART_USER, LLC. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +******************************************************************/ +-- *** NOTE *** +-- The input file columns are mapped to the following table columns. This is done so that the javascript for the advanced workflows +-- selects the correct data for the dropdowns. + +-- tissue_type => sample_type +-- attribute_1 => tissue_type +-- atrribute_2 => timepoint + + TrialID varchar2(100); + RootNode VARCHAR2(2000); + root_level integer; + topNode varchar2(2000); + topLevel integer; + tPath varchar2(2000); + study_name varchar2(100); + sourceCd varchar2(50); + secureStudy varchar2(1); + + dataType varchar2(10); + sqlText varchar2(1000); + tText varchar2(1000); + gplTitle varchar2(1000); + pExists number; + partTbl number; + partExists number; + sampleCt number; + idxExists number; + logBase number; + pCount integer; + sCount integer; + tablespaceName varchar2(200); + v_bio_experiment_id number(18,0); + + --Audit variables + newJobFlag INTEGER(1); + databaseName VARCHAR(100); + procedureName VARCHAR(100); + jobID number(18,0); + stepCt number(18,0); + + --unmapped_patients exception; + missing_platform exception; + missing_tissue EXCEPTION; + unmapped_platform exception; + multiple_platform exception; + no_probeset_recs exception; + + + + CURSOR addNodes is + select distinct t.leaf_node,t.node_name + from wt_mrna_nodes t + where not exists (select 1 from i2b2 x where t.leaf_node = x.c_fullname); + + -- cursor to define the path for delete_one_node this will delete any nodes that are hidden after i2b2_create_concept_counts + CURSOR delNodes is + select distinct c_fullname + from i2b2 where c_fullname like topNode || '%' and + substr(c_visualattributes,2,1) = 'H'; + + CURSOR uploadI2b2 is + select category_cd,display_value,display_label,display_unit + from tm_lz.lt_src_display_mapping + group by category_cd,display_value,display_label,display_unit; + + +BEGIN + + EXECUTE IMMEDIATE 'alter session set NLS_NUMERIC_CHARACTERS=".,"'; + + TrialID := upper(trial_id); + secureStudy := upper(secure_study); + + if (secureStudy not in ('Y','N') ) then + secureStudy := 'Y'; + end if; + + topNode := REGEXP_REPLACE('\' || top_node || '\','(\\){2,}', '\'); + select length(topNode)-length(replace(topNode,'\','')) into topLevel from dual; + + sourceCd := upper(nvl(source_cd,'STD')); + + --Set Audit Parameters + newJobFlag := 0; -- False (Default) + jobID := currentJobID; + + SELECT sys_context('USERENV', 'CURRENT_SCHEMA') INTO databaseName FROM dual; + procedureName := $$PLSQL_UNIT; + + --Audit JOB Initialization + --If Job ID does not exist, then this is a single procedure run and we need to create it + IF(jobID IS NULL or jobID < 1) + THEN + newJobFlag := 1; -- True + cz_start_audit (procedureName, databaseName, jobID); + END IF; + + stepCt := 0; + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Starting i2b2_process_acgh_data',0,stepCt,'Done'); + + -- Get count of records in lt_src_mrna_subj_samp_map + + select count(*) into sCount from lt_src_mrna_subj_samp_map; + + -- check if all subject_sample map records have a platform, If not, abort run + + select count(*) into pCount + from lt_src_mrna_subj_samp_map where platform is null; + + if pCount > 0 then + raise missing_platform; + end if; + + -- check if platform exists in de_chromosomal_region . If not, abort run. + + select count(*) into pCount + from DE_CHROMOSOMAL_REGION + where GPL_ID in (select distinct m.platform from lt_src_mrna_subj_samp_map m); + + if PCOUNT = 0 then + RAISE UNMAPPED_platform; + end if; + + select count(*) into pCount + from DE_gpl_info + where platform in (select distinct m.platform from lt_src_mrna_subj_samp_map m); + + if PCOUNT = 0 then + RAISE UNMAPPED_platform; + end if; + + -- check if all subject_sample map records have a tissue_type, If not, abort run + + select count(*) into pCount + from lt_src_mrna_subj_samp_map + where tissue_type is null; + + if pCount > 0 then + raise missing_tissue; + end if; + + -- check if there are multiple platforms, if yes, then platform must be supplied in lt_src_mrna_data + select count(*) into pCount + from (select sample_cd + from lt_src_mrna_subj_samp_map + group by sample_cd having count(distinct platform) > 1); + + if pCount > 0 then + raise multiple_platform; + end if; + + -- Get root_node from topNode + + select parse_nth_value(topNode, 2, '\') into RootNode from dual; + + select count(*) into pExists + from table_access where c_name = rootNode; + + if pExists = 0 then + i2b2_add_root_node(rootNode, jobId); + end if; + + select c_hlevel into root_level + from i2b2 where c_name = RootNode; + + -- Get study name from topNode + + select parse_nth_value(topNode, topLevel, '\') into study_name from dual; + + -- Add any upper level nodes as needed + + tPath := REGEXP_REPLACE(replace(top_node,study_name,null),'(\\){2,}', '\'); + select length(tPath) - length(replace(tPath,'\',null)) into pCount from dual; + + if pCount > 2 then + i2b2_fill_in_tree(null, tPath, jobId); + end if; + + -- uppercase study_id in lt_src_mrna_subj_samp_map in case curator forgot + + update lt_src_mrna_subj_samp_map + set trial_name=upper(trial_name); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Uppercase trial_name in lt_src_mrna_subj_samp_map',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- create records in patient_dimension for subject_ids if they do not exist + -- format of sourcesystem_cd: trial:[site:]subject_cd + + insert into patient_dimension + ( patient_num, + sex_cd, + age_in_years_num, + race_cd, + update_date, + download_date, + import_date, + sourcesystem_cd + ) + select seq_patient_num.nextval + ,x.sex_cd + ,x.age_in_years_num + ,x.race_cd + ,sysdate + ,sysdate + ,sysdate + ,x.sourcesystem_cd + from (select distinct 'Unknown' as sex_cd, + 0 as age_in_years_num, + null as race_cd, + regexp_replace(TrialID || ':' || s.site_id || ':' || s.subject_id,'(::){1,}', ':') as sourcesystem_cd + from lt_src_mrna_subj_samp_map s + ,de_gpl_info g + where s.subject_id is not null + and s.trial_name = TrialID + and s.source_cd = sourceCD + and s.platform = g.platform + and upper(g.marker_type) = 'CHROMOSOMAL' + and not exists + (select 1 from patient_dimension x + where x.sourcesystem_cd = + regexp_replace(TrialID || ':' || s.site_id || ':' || s.subject_id,'(::){1,}', ':')) + ) x; + + pCount := SQL%ROWCOUNT; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert subjects to patient_dimension',pCount,stepCt,'Done'); + commit; + + i2b2_create_security_for_trial(TrialId, secureStudy, jobID); + + -- Delete existing observation_fact data, will be repopulated + + delete from observation_fact obf + where obf.concept_cd in + (select distinct x.concept_code + from de_subject_sample_mapping x + where x.trial_name = TrialId + and nvl(x.source_cd,'STD') = sourceCD + and x.platform = 'ACGH'); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Delete data from observation_fact',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + select count(*) into pExists + from all_tables + where table_name = 'DE_SUBJECT_MICROARRAY_DATA' and + partitioned = 'YES'; + + if pExists = 0 then + -- dataset is not partitioned so must delete + delete from de_subject_acgh_data + where trial_source = TrialId || ':' || sourceCd; + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Delete data from de_subject_acgh_data',SQL%ROWCOUNT,stepCt,'Done'); + commit; + else + -- Create partition in de_subject_acgh_data if it doesn't exist else truncate partition + select count(*) into pExists + from all_tab_partitions + where table_name = 'DE_SUBJECT_MICROARRAY_DATA' and + partition_name = TrialId; + + if pExists = 0 then + -- needed to add partition to de_subject_acgh_data + sqlText := 'alter table deapp.de_subject_acgh_data add PARTITION "' || + TrialID || + '" VALUES (' || + '''' || + TrialID || + '''' || + ') ' || + 'NOLOGGING COMPRESS TABLESPACE "TRANSMART" '; + execute immediate(sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Adding partition to de_subject_acgh_data',0,stepCt,'Done'); + else + sqlText := 'alter table deapp.de_subject_acgh_data truncate partition "' || TrialID || '"'; + execute immediate(sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Truncating partition in de_subject_acgh_data',0,stepCt,'Done'); + end if; + + end if; + + -- Cleanup any existing data in de_subject_sample_mapping. + + delete from DE_SUBJECT_SAMPLE_MAPPING + where trial_name = TrialID and + nvl(source_cd,'STD') = sourceCd and + platform = 'ACGH'; --Making sure only mRNA data is deleted + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Delete trial from DEAPP de_subject_sample_mapping',SQL%ROWCOUNT,stepCt,'Done'); + + commit; + + -- truncate tmp node table + + execute immediate('truncate table tm_wz.wt_mrna_nodes'); + + -- load temp table with leaf node path, use temp table with distinct sample_type, ATTR2, platform, and title this was faster than doing subselect + -- from wt_subject_mrna_data + + execute immediate('truncate table tm_wz.wt_mrna_node_values'); + + insert into wt_mrna_node_values + (category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,title + ) + select distinct a.category_cd + ,nvl(a.platform,'GPL570') + ,nvl(a.tissue_type,'Unspecified Tissue Type') + ,a.attribute_1 + ,a.attribute_2 + ,g.title + from lt_src_mrna_subj_samp_map a + ,de_gpl_info g + where a.trial_name = TrialID + and nvl(a.platform,'GPL570') = g.platform + and a.source_cd = sourceCD + and a.platform = g.platform + and upper(g.marker_type) = 'CHROMOSOMAL' + and g.title = (select min(x.title) from de_gpl_info x where nvl(a.platform,'GPL570') = x.platform) + -- and upper(g.organism) = 'HOMO SAPIENS' + ; + -- and decode(dataType,'R',sign(a.intensity_value),1) = 1; -- take all values when dataType T, only >0 for dataType R + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert node values into DEAPP wt_mrna_node_values',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + insert into wt_mrna_nodes + (leaf_node + ,category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,node_type + ) + select distinct topNode || regexp_replace(replace(replace(replace(replace(replace(replace( + category_cd,'PLATFORM',title),'ATTR1',attribute_1),'ATTR2',attribute_2),'TISSUETYPE',tissue_type),'+','\'),'_',' ') || '\','(\\){2,}', '\') + ,category_cd + ,platform as platform + ,tissue_type + ,attribute_1 as attribute_1 + ,attribute_2 as attribute_2 + ,'LEAF' + from wt_mrna_node_values; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create leaf nodes in DEAPP tmp_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- insert for platform node so platform concept can be populated + + insert into wt_mrna_nodes + (leaf_node + ,category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,node_type + ) + select distinct topNode || regexp_replace(replace(replace(replace(replace(replace(replace( + substr(category_cd,1,instr(category_cd,'PLATFORM')+8),'PLATFORM',title),'ATTR1',attribute_1),'ATTR2',attribute_2),'TISSUETYPE',tissue_type),'+','\'),'_',' ') || '\', + '(\\){2,}', '\') + ,substr(category_cd,1,instr(category_cd,'PLATFORM')+8) + ,platform as platform + ,case when instr(substr(category_cd,1,instr(category_cd,'PLATFORM')+8),'TISSUETYPE') > 1 then tissue_type else null end as tissue_type + ,case when instr(substr(category_cd,1,instr(category_cd,'PLATFORM')+8),'ATTR1') > 1 then attribute_1 else null end as attribute_1 + ,case when instr(substr(category_cd,1,instr(category_cd,'PLATFORM')+8),'ATTR2') > 1 then attribute_2 else null end as attribute_2 + ,'PLATFORM' + from wt_mrna_node_values; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create platform nodes in wt_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- insert for ATTR1 node so ATTR1 concept can be populated in tissue_type_cd + + insert into wt_mrna_nodes + (leaf_node + ,category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,node_type + ) + select distinct topNode || regexp_replace(replace(replace(replace(replace(replace(replace( + substr(category_cd,1,instr(category_cd,'ATTR1')+5),'PLATFORM',title),'ATTR1',attribute_1),'ATTR2',attribute_2),'TISSUETYPE',tissue_type),'+','\'),'_',' ') || '\', + '(\\){2,}', '\') + ,substr(category_cd,1,instr(category_cd,'ATTR1')+5) + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR1')+5),'PLATFORM') > 1 then platform else null end as platform + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR1')+5),'TISSUETYPE') > 1 then tissue_type else null end as tissue_type + ,attribute_1 as attribute_1 + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR1')+5),'ATTR2') > 1 then attribute_2 else null end as attribute_2 + ,'ATTR1' + from wt_mrna_node_values + where category_cd like '%ATTR1%' + and attribute_1 is not null; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create ATTR1 nodes in wt_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- insert for ATTR2 node so ATTR2 concept can be populated in timepoint_cd + + insert into wt_mrna_nodes + (leaf_node + ,category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,node_type + ) + select distinct topNode || regexp_replace(replace(replace(replace(replace(replace(replace( + substr(category_cd,1,instr(category_cd,'ATTR2')+5),'PLATFORM',title),'ATTR1',attribute_1),'ATTR2',attribute_2),'TISSUETYPE',tissue_type),'+','\'),'_',' ') || '\', + '(\\){2,}', '\') + ,substr(category_cd,1,instr(category_cd,'ATTR2')+5) + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR2')+5),'PLATFORM') > 1 then platform else null end as platform + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR1')+5),'TISSUETYPE') > 1 then tissue_type else null end as tissue_type + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR2')+5),'ATTR1') > 1 then attribute_1 else null end as attribute_1 + ,attribute_2 as attribute_2 + ,'ATTR2' + from wt_mrna_node_values + where category_cd like '%ATTR2%' + and attribute_2 is not null; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create ATTR2 nodes in wt_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- insert for tissue_type node so sample_type_cd can be populated + + insert into wt_mrna_nodes + (leaf_node + ,category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,node_type + ) + select distinct topNode || regexp_replace(replace(replace(replace(replace(replace(replace( + substr(category_cd,1,instr(category_cd,'TISSUETYPE')+10),'PLATFORM',title),'ATTR1',attribute_1),'ATTR2',attribute_2),'TISSUETYPE',tissue_type),'+','\'),'_',' ') || '\', + '(\\){2,}', '\') + ,substr(category_cd,1,instr(category_cd,'TISSUETYPE')+10) + ,case when instr(substr(category_cd,1,instr(category_cd,'TISSUETYPE')+10),'PLATFORM') > 1 then platform else null end as platform + ,tissue_type as tissue_type + ,case when instr(substr(category_cd,1,instr(category_cd,'TISSUETYPE')+10),'ATTR1') > 1 then attribute_1 else null end as attribute_1 + ,case when instr(substr(category_cd,1,instr(category_cd,'TISSUETYPE')+10),'ATTR2') > 1 then attribute_2 else null end as attribute_2 + ,'TISSUETYPE' + from wt_mrna_node_values + where category_cd like '%TISSUETYPE%'; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create ATTR2 nodes in wt_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + update wt_mrna_nodes + set node_name=parse_nth_value(leaf_node,length(leaf_node)-length(replace(leaf_node,'\',null)),'\'); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Updated node_name in DEAPP tmp_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- add leaf nodes for mRNA data The cursor will only add nodes that do not already exist. + + FOR r_addNodes in addNodes Loop + --Add nodes for all types (ALSO DELETES EXISTING NODE) + i2b2_add_node(TrialID, r_addNodes.leaf_node, r_addNodes.node_name, jobId); + stepCt := stepCt + 1; + tText := 'Added Leaf Node: ' || r_addNodes.leaf_node || ' Name: ' || r_addNodes.node_name; + cz_write_audit(jobId,databaseName,procedureName,tText,SQL%ROWCOUNT,stepCt,'Done'); + i2b2_fill_in_tree(TrialId, r_addNodes.leaf_node, jobID); + END LOOP; + + -- set sourcesystem_cd, c_comment to null if any added upper-level nodes + + update i2b2 b + set sourcesystem_cd=null,c_comment=null + where b.sourcesystem_cd = TrialId + and length(b.c_fullname) < length(topNode); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Set sourcesystem_cd to null for added upper level nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- update concept_cd for nodes, this is done to make the next insert easier + + update wt_mrna_nodes t + set concept_cd=(select c.concept_cd from concept_dimension c + where c.concept_path = t.leaf_node + ) + where exists + (select 1 from concept_dimension x + where x.concept_path = t.leaf_node + ) + and t.concept_cd is null; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Update wt_mrna_nodes with newly created concept_cds',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + + --Load the DE_SUBJECT_SAMPLE_MAPPING from wt_subject_mrna_data + + --PATIENT_ID = PATIENT_ID (SAME AS ID ON THE PATIENT_DIMENSION) + --SITE_ID = site_id + --SUBJECT_ID = subject_id + --SUBJECT_TYPE = NULL + --CONCEPT_CODE = from LEAF records in wt_mrna_nodes + --SAMPLE_TYPE = TISSUE_TYPE + --SAMPLE_TYPE_CD = concept_cd from TISSUETYPE records in wt_mrna_nodes + --TRIAL_NAME = TRIAL_NAME + --TIMEPOINT = attribute_2 + --TIMEPOINT_CD = concept_cd from ATTR2 records in wt_mrna_nodes + --TISSUE_TYPE = attribute_1 + --TISSUE_TYPE_CD = concept_cd from ATTR1 records in wt_mrna_nodes + --PLATFORM = MRNA_AFFYMETRIX - this is required by ui code + --PLATFORM_CD = concept_cd from PLATFORM records in wt_mrna_nodes + --DATA_UID = concatenation of concept_cd-patient_num + --GPL_ID = platform from wt_subject_mrna_data + --CATEGORY_CD = category_cd that generated ontology + --SAMPLE_ID = id of sample (trial:S:[site_id]:subject_id:sample_cd) from patient_dimension, may be the same as patient_num + --SAMPLE_CD = sample_cd + --SOURCE_CD = sourceCd + + --ASSAY_ID = generated by trigger + + insert into de_subject_sample_mapping + (patient_id + ,site_id + ,subject_id + ,subject_type + ,concept_code + ,assay_id + ,sample_type + ,sample_type_cd + ,trial_name + ,timepoint + ,timepoint_cd + ,tissue_type + ,tissue_type_cd + ,platform + ,platform_cd + ,data_uid + ,gpl_id + ,sample_id + ,sample_cd + ,category_cd + ,source_cd + ,omic_source_study + ,omic_patient_id + ) + select t.patient_id + ,t.site_id + ,t.subject_id + ,t.subject_type + ,t.concept_code + ,deapp.seq_assay_id.nextval + ,t.sample_type + ,t.sample_type_cd + ,t.trial_name + ,t.timepoint + ,t.timepoint_cd + ,t.tissue_type + ,t.tissue_type_cd + ,t.platform + ,t.platform_cd + ,t.data_uid + ,t.gpl_id + ,t.sample_id + ,t.sample_cd + ,t.category_cd + ,t.source_cd + ,t.omic_source_study + ,t.omic_patient_id + from (select distinct b.patient_num as patient_id + ,a.site_id + ,a.subject_id + ,null as subject_type + ,ln.concept_cd as concept_code + ,a.tissue_type as sample_type + ,ttp.concept_cd as sample_type_cd + ,a.trial_name + ,a.attribute_2 as timepoint + ,a2.concept_cd as timepoint_cd + ,a.attribute_1 as tissue_type + ,a1.concept_cd as tissue_type_cd + ,'ACGH' as platform + ,pn.concept_cd as platform_cd + ,ln.concept_cd || '-' || to_char(b.patient_num) as data_uid + ,a.platform as gpl_id + ,coalesce(sid.patient_num,b.patient_num) as sample_id + ,a.sample_cd + ,nvl(a.category_cd,'Biomarker_Data+Gene_Expression+PLATFORM+TISSUETYPE+ATTR1+ATTR2') as category_cd + ,a.source_cd + ,TrialId as omic_source_study + ,b.patient_num as omic_patient_id + from lt_src_mrna_subj_samp_map a + --Joining to Pat_dim to ensure the ID's match. If not I2B2 won't work. + inner join patient_dimension b + on regexp_replace(TrialID || ':' || a.site_id || ':' || a.subject_id,'(::){1,}', ':') = b.sourcesystem_cd + inner join wt_mrna_nodes ln + on a.platform = ln.platform + and a.tissue_type = ln.tissue_type + and a.category_cd=ln.category_cd --modified + and nvl(a.attribute_1,'@') = nvl(ln.attribute_1,'@') + and nvl(a.attribute_2,'@') = nvl(ln.attribute_2,'@') + and ln.node_type = 'LEAF' + inner join wt_mrna_nodes pn + on a.platform = pn.platform + and pn.category_cd=substr(a.category_cd,1,instr(a.category_cd,'PLATFORM')+8) + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'PLATFORM')+8),'TISSUETYPE') > 1 then a.tissue_type else '@' end = nvl(pn.tissue_type,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'PLATFORM')+8),'ATTR1') > 1 then a.attribute_1 else '@' end = nvl(pn.attribute_1,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'PLATFORM')+8),'ATTR2') > 1 then a.attribute_2 else '@' end = nvl(pn.attribute_2,'@') + and pn.node_type = 'PLATFORM' + left outer join wt_mrna_nodes ttp + on a.tissue_type = ttp.tissue_type + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'TISSUETYPE')+10),'PLATFORM') > 1 then a.platform else '@' end = nvl(ttp.platform,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'TISSUETYPE')+10),'ATTR1') > 1 then a.attribute_1 else '@' end = nvl(ttp.attribute_1,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'TISSUETYPE')+10),'ATTR2') > 1 then a.attribute_2 else '@' end = nvl(ttp.attribute_2,'@') + and ttp.node_type = 'TISSUETYPE' + and ttp.category_cd=substr(a.category_cd,1,instr(a.category_cd,'TISSUETYPE')+10) + left outer join wt_mrna_nodes a1 + on a.attribute_1 = a1.attribute_1 + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR1')+5),'PLATFORM') > 1 then a.platform else '@' end = nvl(a1.platform,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR1')+5),'TISSUETYPE') > 1 then a.tissue_type else '@' end = nvl(a1.tissue_type,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR1')+5),'ATTR2') > 1 then a.attribute_2 else '@' end = nvl(a1.attribute_2,'@') + and a1.node_type = 'ATTR1' + and a1.category_cd=substr(a.category_cd,1,instr(a.category_cd,'ATTR1')+5) + left outer join wt_mrna_nodes a2 + on a.attribute_2 = a1.attribute_2 + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR2')+5),'PLATFORM') > 1 then a.platform else '@' end = nvl(a2.platform,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR2')+5),'TISSUETYPE') > 1 then a.tissue_type else '@' end = nvl(a2.tissue_type,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR2')+5),'ATTR1') > 1 then a.attribute_1 else '@' end = nvl(a2.attribute_1,'@') + and a2.node_type = 'ATTR2' + and a2.category_cd=substr(a.category_cd,1,instr(a.category_cd,'ATTR2')+5) + left outer join patient_dimension sid + on regexp_replace(TrialId || ':S:' || a.site_id || ':' || a.subject_id || ':' || a.sample_cd, + '(::){1,}', ':') = sid.sourcesystem_cd + where a.trial_name = TrialID + and a.source_cd = sourceCD + and ln.concept_cd is not null) t; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert trial into DEAPP de_subject_sample_mapping',SQL%ROWCOUNT,stepCt,'Done'); + + commit; + + insert into observation_fact + (patient_num + ,concept_cd + ,modifier_cd + ,valtype_cd + ,tval_char + ,nval_num + ,sourcesystem_cd + ,import_date + ,valueflag_cd + ,provider_id + ,location_cd + ,units_cd + ,sample_cd + ,instance_num + ) + select distinct m.patient_id + ,m.concept_code + ,'@' + ,'T' -- Text data type + ,'E' --Stands for Equals for Text Types + ,null -- not numeric for mRNA + ,m.trial_name + ,sysdate + ,'@' + ,'@' + ,'@' + ,'' -- no units available + ,m.sample_cd + ,1 + from de_subject_sample_mapping m + where m.trial_name = TrialID + and m.source_cd = sourceCD + and m.platform = 'ACGH'; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert patient facts into I2B2DEMODATA observation_fact',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- Insert sample facts + + insert into observation_fact + (patient_num + ,concept_cd + ,modifier_cd + ,valtype_cd + ,tval_char + ,nval_num + ,sourcesystem_cd + ,import_date + ,valueflag_cd + ,provider_id + ,location_cd + ,units_cd + ,sample_cd + ,instance_num + ) + select distinct m.sample_id + ,m.concept_code + ,m.trial_name + ,'T' -- Text data type + ,'E' --Stands for Equals for Text Types + ,null -- not numeric for mRNA + ,m.trial_name + ,sysdate + ,'@' + ,'@' + ,'@' + ,'' -- no units available + ,m.sample_cd + ,1 + from de_subject_sample_mapping m + where m.trial_name = TrialID + and m.source_cd = sourceCd + and m.platform = 'ACGH' + and m.patient_id != m.sample_id; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert sample facts into I2B2DEMODATA observation_fact',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + ---INSERT sample_dimension + INSERT INTO I2B2DEMODATA.SAMPLE_DIMENSION(SAMPLE_CD) + SELECT DISTINCT SAMPLE_CD FROM + DEAPP.DE_SUBJECT_SAMPLE_MAPPING WHERE SAMPLE_CD NOT IN (SELECT SAMPLE_CD FROM I2B2DEMODATA.SAMPLE_DIMENSION) ; + + --Update I2b2 for correct data type + update i2b2 t + set c_columndatatype = 'T', c_metadataxml = null, c_visualattributes='FA' + where t.c_basecode in (select distinct x.concept_cd from wt_mrna_nodes x); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Initialize data_type and xml in i2b2',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + for ul in uploadI2b2 + loop + update i2b2 n + SET n.c_columndatatype = 'T', + --Static XML String + n.c_metadataxml = ('3.0208/14/2008 01:22:59PosFloatY0 + 0100100100 + + + ratio + + + '||(select xmlelement(name "SeriesMeta",xmlforest(m.display_value as "Value",m.display_unit as "Unit",m.display_label as "DisplayName")) as hi + from tm_lz.lt_src_display_mapping m where m.category_cd=ul.category_cd)|| + '') where n.c_fullname=(select leaf_node from wt_mrna_nodes where category_cd=ul.category_cd and leaf_node=n.c_fullname); + + end loop; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Update c_columndatatype and c_metadataxml for numeric data types in I2B2METADATA i2b2',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + --UPDATE VISUAL ATTRIBUTES for Leaf Active (Default is folder) + update i2b2 a + set c_visualattributes = 'LAH' + where a.c_basecode in (select distinct x.concept_code from de_subject_sample_mapping x + where x.trial_name = TrialId + and x.platform = 'ACGH' + and x.concept_code is not null); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Update visual attributes for leaf nodes in I2B2METADATA i2b2',SQL%ROWCOUNT,stepCt,'Done'); + COMMIT; + + update i2b2 a + set c_visualattributes='FAS' + where a.c_fullname = substr(topNode,1,instr(topNode,'\',1,3)); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Update visual attributes for study nodes in I2B2METADATA i2b2',SQL%ROWCOUNT,stepCt,'Done'); + COMMIT; + + --Build concept Counts + --Also marks any i2B2 records with no underlying data as Hidden, need to do at Trial level because there may be multiple platform and there is no longer + -- a unique top-level node for mRNA data + + i2b2_create_concept_counts(topNode ,jobID ); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create concept counts',0,stepCt,'Done'); + + -- delete each node that is hidden + + FOR r_delNodes in delNodes Loop + -- deletes hidden nodes for a trial one at a time + i2b2_delete_1_node(r_delNodes.c_fullname); + stepCt := stepCt + 1; + tText := 'Deleted node: ' || r_delNodes.c_fullname; + cz_write_audit(jobId,databaseName,procedureName,tText,SQL%ROWCOUNT,stepCt,'Done'); + END LOOP; + + + --Reload Security: Inserts one record for every I2B2 record into the security table + + i2b2_load_security_data(jobId); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Load security data',0,stepCt,'Done'); + + -- tag data with probeset_id from reference.probeset_deapp + + execute immediate ('truncate table tm_wz.wt_subject_mrna_probeset'); + + -- note: assay_id represents a unique subject/site/sample + + insert into tm_wz.wt_subject_acgh_region + (region_id + ,chip + ,segmented + ,flag + ,probloss + ,probnorm + ,probgain + ,probamp + ,patient_id + ,trial_name + ,assay_id + ) + select gs.region_id + ,cast(md.chip as double precision) + ,cast(md.segmented as double precision) + ,cast(md.flag as smallint) + ,cast(md.probloss as double precision) + ,cast(md.probnorm as double precision) + ,cast(md.probgain as double precision) + ,cast(md.probamp as double precision) + ,sd.patient_id + ,TrialId + ,sd.assay_id + from deapp.de_subject_sample_mapping sd + ,tm_lz.lt_src_acgh_data md + ,deapp.de_chromosomal_region gs + where sd.sample_cd = md.expr_id + and sd.platform = 'ACGH' + and sd.trial_name = TrialId + and sd.source_cd = sourceCd + and sd.gpl_id = gs.gpl_id + and md.region_name = gs.region_name + group by gs.region_id, md.chip, md.segmented, md.flag, md.probloss, md.probnorm, md.probgain, md.probamp + ,sd.patient_id,sd.assay_id; + + insert into deapp.de_subject_acgh_data + ( region_id + , assay_id + , patient_id + , trial_name + , chip + , segmented + , flag + , probloss + , probnorm + , probgain + , probamp + ) + select region_id + , assay_id + , patient_id + , trial_name + , chip + , segmented + , flag + , probloss + , probnorm + , probgain + , probamp + from tm_wz.wt_subject_acgh_region; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert into DEAPP wt_subject_mrna_probeset',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + if pExists = 0 then + raise no_probeset_recs; + end if; + + + ---Cleanup OVERALL JOB if this proc is being run standalone + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'End i2b2_process_acgh_data',0,stepCt,'Done'); + + IF newJobFlag = 1 + THEN + cz_end_audit (jobID, 'SUCCESS'); + END IF; + + select 0 into rtn_code from dual; + + EXCEPTION + --when unmapped_patients then + -- cz_write_audit(jobId,databasename,procedurename,'No site_id/subject_id mapped to patient_dimension',1,stepCt,'ERROR'); + -- cz_error_handler(jobid,procedurename); + -- cz_end_audit (jobId,'FAIL'); + when missing_platform then + cz_write_audit(jobId,databasename,procedurename,'Platform data missing from one or more subject_sample mapping records',1,stepCt,'ERROR'); + cz_error_handler(jobid,procedurename); + cz_end_audit (jobId,'FAIL'); + select 161 into rtn_code from dual; + when missing_tissue then + cz_write_audit(jobId,databasename,procedurename,'Tissue Type data missing from one or more subject_sample mapping records',1,stepCt,'ERROR'); + cz_error_handler(jobid,procedurename); + CZ_END_AUDIT (JOBID,'FAIL'); + select 162 into rtn_code from dual; + when unmapped_platform then + cz_write_audit(jobId,databasename,procedurename,'Platform not found in de_chromosomal_region',1,stepCt,'ERROR'); + CZ_ERROR_HANDLER(JOBID,PROCEDURENAME); + cz_end_audit (jobId,'FAIL'); + select 169 into rtn_code from dual; + when multiple_platform then + cz_write_audit(jobId,databasename,procedurename,'Multiple platforms for sample_cd in lt_src_mrna_subj_samp_map',1,stepCt,'ERROR'); + CZ_ERROR_HANDLER(JOBID,PROCEDURENAME); + cz_end_audit (jobId,'FAIL'); + select 163 into rtn_code from dual; + when no_probeset_recs then + cz_write_audit(jobId,databasename,procedurename,'Unable to match probesets to platform in probeset_deapp',1,stepCt,'ERROR'); + CZ_ERROR_HANDLER(JOBID,PROCEDURENAME); + cz_end_audit (jobId,'FAIL'); + select 165 into rtn_code from dual; + WHEN OTHERS THEN + --Handle errors. + cz_error_handler (jobID, procedureName); + --End Proc + cz_end_audit (jobID, 'FAIL'); + select 166 into rtn_code from dual; +END; +/ diff --git a/ddl/oracle/tm_cz/procedures/i2b2_process_rnaseq_data.sql b/ddl/oracle/tm_cz/procedures/i2b2_process_rnaseq_data.sql new file mode 100644 index 00000000..b9615ae9 --- /dev/null +++ b/ddl/oracle/tm_cz/procedures/i2b2_process_rnaseq_data.sql @@ -0,0 +1,956 @@ +-- +-- Type: PROCEDURE; Owner: TM_CZ; Name: I2B2_PROCESS_RNASEQ_DATA +-- + CREATE OR REPLACE EDITIONABLE PROCEDURE "TM_CZ"."I2B2_PROCESS_RNASEQ_DATA" +( + trial_id VARCHAR2 + ,top_node varchar2 + ,source_cd varchar2 := 'STD' -- default source_cd = 'STD' + ,secure_study varchar2 -- security setting if new patients added to patient_dimension + ,currentJobID NUMBER := null + ,rtn_code OUT NUMBER +) +AS +/************************************************************************* +* Copyright 2008-2012 Janssen Research BIOMART_USER, LLC. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +******************************************************************/ +-- *** NOTE *** +-- The input file columns are mapped to the following table columns. This is done so that the javascript for the advanced workflows +-- selects the correct data for the dropdowns. + +-- tissue_type => sample_type +-- attribute_1 => tissue_type +-- atrribute_2 => timepoint + + TrialID varchar2(100); + RootNode VARCHAR2(2000); + root_level integer; + topNode varchar2(2000); + topLevel integer; + tPath varchar2(2000); + study_name varchar2(100); + sourceCd varchar2(50); + secureStudy varchar2(1); + + dataType varchar2(10); + sqlText varchar2(1000); + tText varchar2(1000); + gplTitle varchar2(1000); + pExists number; + partTbl number; + partExists number; + sampleCt number; + idxExists number; + logBase number; + pCount integer; + sCount integer; + tablespaceName varchar2(200); + v_bio_experiment_id number(18,0); + + --Audit variables + newJobFlag INTEGER(1); + databaseName VARCHAR(100); + procedureName VARCHAR(100); + jobID number(18,0); + stepCt number(18,0); + + --unmapped_patients exception; + missing_platform exception; + missing_tissue EXCEPTION; + unmapped_platform exception; + multiple_platform exception; + no_probeset_recs exception; + + + + CURSOR addNodes is + select distinct t.leaf_node,t.node_name + from wt_mrna_nodes t + where not exists (select 1 from i2b2 x where t.leaf_node = x.c_fullname); + + -- cursor to define the path for delete_one_node this will delete any nodes that are hidden after i2b2_create_concept_counts + CURSOR delNodes is + select distinct c_fullname + from i2b2 where c_fullname like topNode || '%' and + substr(c_visualattributes,2,1) = 'H'; + + CURSOR uploadI2b2 is + select category_cd,display_value,display_label,display_unit + from tm_lz.lt_src_display_mapping + group by category_cd,display_value,display_label,display_unit; + + +BEGIN + + EXECUTE IMMEDIATE 'alter session set NLS_NUMERIC_CHARACTERS=".,"'; + + TrialID := upper(trial_id); + secureStudy := upper(secure_study); + + if (secureStudy not in ('Y','N') ) then + secureStudy := 'Y'; + end if; + + topNode := REGEXP_REPLACE('\' || top_node || '\','(\\){2,}', '\'); + select length(topNode)-length(replace(topNode,'\','')) into topLevel from dual; + + sourceCd := upper(nvl(source_cd,'STD')); + + --Set Audit Parameters + newJobFlag := 0; -- False (Default) + jobID := currentJobID; + + SELECT sys_context('USERENV', 'CURRENT_SCHEMA') INTO databaseName FROM dual; + procedureName := $$PLSQL_UNIT; + + --Audit JOB Initialization + --If Job ID does not exist, then this is a single procedure run and we need to create it + IF(jobID IS NULL or jobID < 1) + THEN + newJobFlag := 1; -- True + cz_start_audit (procedureName, databaseName, jobID); + END IF; + + stepCt := 0; + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Starting i2b2_process_rnaseq_data',0,stepCt,'Done'); + + -- Get count of records in lt_src_mrna_subj_samp_map + + select count(*) into sCount from lt_src_mrna_subj_samp_map; + + -- check if all subject_sample map records have a platform, If not, abort run + + select count(*) into pCount + from lt_src_mrna_subj_samp_map where platform is null; + + if pCount > 0 then + raise missing_platform; + end if; + + -- check if platform exists in de_chromosomal_region . If not, abort run. + + select count(*) into pCount + from DE_CHROMOSOMAL_REGION + where GPL_ID in (select distinct m.platform from lt_src_mrna_subj_samp_map m); + + if PCOUNT = 0 then + RAISE UNMAPPED_platform; + end if; + + select count(*) into pCount + from DE_gpl_info + where platform in (select distinct m.platform from lt_src_mrna_subj_samp_map m); + + if PCOUNT = 0 then + RAISE UNMAPPED_platform; + end if; + + -- check if all subject_sample map records have a tissue_type, If not, abort run + + select count(*) into pCount + from lt_src_mrna_subj_samp_map + where tissue_type is null; + + if pCount > 0 then + raise missing_tissue; + end if; + + -- check if there are multiple platforms, if yes, then platform must be supplied in lt_src_mrna_data + select count(*) into pCount + from (select sample_cd + from lt_src_mrna_subj_samp_map + group by sample_cd having count(distinct platform) > 1); + + if pCount > 0 then + raise multiple_platform; + end if; + + -- Get root_node from topNode + + select parse_nth_value(topNode, 2, '\') into RootNode from dual; + + select count(*) into pExists + from table_access where c_name = rootNode; + + if pExists = 0 then + i2b2_add_root_node(rootNode, jobId); + end if; + + select c_hlevel into root_level + from i2b2 where c_name = RootNode; + + -- Get study name from topNode + + select parse_nth_value(topNode, topLevel, '\') into study_name from dual; + + -- Add any upper level nodes as needed + + tPath := REGEXP_REPLACE(replace(top_node,study_name,null),'(\\){2,}', '\'); + select length(tPath) - length(replace(tPath,'\',null)) into pCount from dual; + + if pCount > 2 then + i2b2_fill_in_tree(null, tPath, jobId); + end if; + + -- uppercase study_id in lt_src_mrna_subj_samp_map in case curator forgot + + update lt_src_mrna_subj_samp_map + set trial_name=upper(trial_name); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Uppercase trial_name in lt_src_mrna_subj_samp_map',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- create records in patient_dimension for subject_ids if they do not exist + -- format of sourcesystem_cd: trial:[site:]subject_cd + + insert into patient_dimension + ( patient_num, + sex_cd, + age_in_years_num, + race_cd, + update_date, + download_date, + import_date, + sourcesystem_cd + ) + select seq_patient_num.nextval + ,x.sex_cd + ,x.age_in_years_num + ,x.race_cd + ,sysdate + ,sysdate + ,sysdate + ,x.sourcesystem_cd + from (select distinct 'Unknown' as sex_cd, + 0 as age_in_years_num, + null as race_cd, + regexp_replace(TrialID || ':' || s.site_id || ':' || s.subject_id,'(::){1,}', ':') as sourcesystem_cd + from lt_src_mrna_subj_samp_map s + ,de_gpl_info g + where s.subject_id is not null + and s.trial_name = TrialID + and s.source_cd = sourceCD + and s.platform = g.platform + and upper(g.marker_type) = 'CHROMOSOMAL' + and not exists + (select 1 from patient_dimension x + where x.sourcesystem_cd = + regexp_replace(TrialID || ':' || s.site_id || ':' || s.subject_id,'(::){1,}', ':')) + ) x; + + pCount := SQL%ROWCOUNT; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert subjects to patient_dimension',pCount,stepCt,'Done'); + commit; + + i2b2_create_security_for_trial(TrialId, secureStudy, jobID); + + -- Delete existing observation_fact data, will be repopulated + + delete from observation_fact obf + where obf.concept_cd in + (select distinct x.concept_code + from de_subject_sample_mapping x + where x.trial_name = TrialId + and nvl(x.source_cd,'STD') = sourceCD + and x.platform = 'RNASEQ'); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Delete data from observation_fact',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + select count(*) into pExists + from all_tables + where table_name = 'DE_SUBJECT_MICROARRAY_DATA' and + partitioned = 'YES'; + + if pExists = 0 then + -- dataset is not partitioned so must delete + delete from de_subject_rnaseq_data + where trial_source = TrialId || ':' || sourceCd; + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Delete data from de_subject_rnaseq_data',SQL%ROWCOUNT,stepCt,'Done'); + commit; + else + -- Create partition in de_subject_rnaseq_data if it doesn't exist else truncate partition + select count(*) into pExists + from all_tab_partitions + where table_name = 'DE_SUBJECT_MICROARRAY_DATA' and + partition_name = TrialId; + + if pExists = 0 then + -- needed to add partition to de_subject_rnaseq_data + sqlText := 'alter table deapp.de_subject_rnaseq_data add PARTITION "' || + TrialID || + '" VALUES (' || + '''' || + TrialID || + '''' || + ') ' || + 'NOLOGGING COMPRESS TABLESPACE "TRANSMART" '; + execute immediate(sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Adding partition to de_subject_rnaseq_data',0,stepCt,'Done'); + else + sqlText := 'alter table deapp.de_subject_rnaseq_data truncate partition "' || TrialID || '"'; + execute immediate(sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Truncating partition in de_subject_rnaseq_data',0,stepCt,'Done'); + end if; + + end if; + + -- Cleanup any existing data in de_subject_sample_mapping. + + delete from DE_SUBJECT_SAMPLE_MAPPING + where trial_name = TrialID and + nvl(source_cd,'STD') = sourceCd and + platform = 'RNASEQ'; --Making sure only mRNA data is deleted + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Delete trial from DEAPP de_subject_sample_mapping',SQL%ROWCOUNT,stepCt,'Done'); + + commit; + + -- truncate tmp node table + + execute immediate('truncate table tm_wz.wt_mrna_nodes'); + + -- load temp table with leaf node path, use temp table with distinct sample_type, ATTR2, platform, and title this was faster than doing subselect + -- from wt_subject_mrna_data + + execute immediate('truncate table tm_wz.wt_mrna_node_values'); + + insert into wt_mrna_node_values + (category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,title + ) + select distinct a.category_cd + ,nvl(a.platform,'GPL570') + ,nvl(a.tissue_type,'Unspecified Tissue Type') + ,a.attribute_1 + ,a.attribute_2 + ,g.title + from lt_src_mrna_subj_samp_map a + ,de_gpl_info g + where a.trial_name = TrialID + and nvl(a.platform,'GPL570') = g.platform + and a.source_cd = sourceCD + and a.platform = g.platform + and upper(g.marker_type) = 'CHROMOSOMAL' + and g.title = (select min(x.title) from de_gpl_info x where nvl(a.platform,'GPL570') = x.platform) + -- and upper(g.organism) = 'HOMO SAPIENS' + ; + -- and decode(dataType,'R',sign(a.intensity_value),1) = 1; -- take all values when dataType T, only >0 for dataType R + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert node values into DEAPP wt_mrna_node_values',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + insert into wt_mrna_nodes + (leaf_node + ,category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,node_type + ) + select distinct topNode || regexp_replace(replace(replace(replace(replace(replace(replace( + category_cd,'PLATFORM',title),'ATTR1',attribute_1),'ATTR2',attribute_2),'TISSUETYPE',tissue_type),'+','\'),'_',' ') || '\','(\\){2,}', '\') + ,category_cd + ,platform as platform + ,tissue_type + ,attribute_1 as attribute_1 + ,attribute_2 as attribute_2 + ,'LEAF' + from wt_mrna_node_values; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create leaf nodes in DEAPP tmp_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- insert for platform node so platform concept can be populated + + insert into wt_mrna_nodes + (leaf_node + ,category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,node_type + ) + select distinct topNode || regexp_replace(replace(replace(replace(replace(replace(replace( + substr(category_cd,1,instr(category_cd,'PLATFORM')+8),'PLATFORM',title),'ATTR1',attribute_1),'ATTR2',attribute_2),'TISSUETYPE',tissue_type),'+','\'),'_',' ') || '\', + '(\\){2,}', '\') + ,substr(category_cd,1,instr(category_cd,'PLATFORM')+8) + ,platform as platform + ,case when instr(substr(category_cd,1,instr(category_cd,'PLATFORM')+8),'TISSUETYPE') > 1 then tissue_type else null end as tissue_type + ,case when instr(substr(category_cd,1,instr(category_cd,'PLATFORM')+8),'ATTR1') > 1 then attribute_1 else null end as attribute_1 + ,case when instr(substr(category_cd,1,instr(category_cd,'PLATFORM')+8),'ATTR2') > 1 then attribute_2 else null end as attribute_2 + ,'PLATFORM' + from wt_mrna_node_values; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create platform nodes in wt_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- insert for ATTR1 node so ATTR1 concept can be populated in tissue_type_cd + + insert into wt_mrna_nodes + (leaf_node + ,category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,node_type + ) + select distinct topNode || regexp_replace(replace(replace(replace(replace(replace(replace( + substr(category_cd,1,instr(category_cd,'ATTR1')+5),'PLATFORM',title),'ATTR1',attribute_1),'ATTR2',attribute_2),'TISSUETYPE',tissue_type),'+','\'),'_',' ') || '\', + '(\\){2,}', '\') + ,substr(category_cd,1,instr(category_cd,'ATTR1')+5) + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR1')+5),'PLATFORM') > 1 then platform else null end as platform + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR1')+5),'TISSUETYPE') > 1 then tissue_type else null end as tissue_type + ,attribute_1 as attribute_1 + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR1')+5),'ATTR2') > 1 then attribute_2 else null end as attribute_2 + ,'ATTR1' + from wt_mrna_node_values + where category_cd like '%ATTR1%' + and attribute_1 is not null; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create ATTR1 nodes in wt_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- insert for ATTR2 node so ATTR2 concept can be populated in timepoint_cd + + insert into wt_mrna_nodes + (leaf_node + ,category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,node_type + ) + select distinct topNode || regexp_replace(replace(replace(replace(replace(replace(replace( + substr(category_cd,1,instr(category_cd,'ATTR2')+5),'PLATFORM',title),'ATTR1',attribute_1),'ATTR2',attribute_2),'TISSUETYPE',tissue_type),'+','\'),'_',' ') || '\', + '(\\){2,}', '\') + ,substr(category_cd,1,instr(category_cd,'ATTR2')+5) + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR2')+5),'PLATFORM') > 1 then platform else null end as platform + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR1')+5),'TISSUETYPE') > 1 then tissue_type else null end as tissue_type + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR2')+5),'ATTR1') > 1 then attribute_1 else null end as attribute_1 + ,attribute_2 as attribute_2 + ,'ATTR2' + from wt_mrna_node_values + where category_cd like '%ATTR2%' + and attribute_2 is not null; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create ATTR2 nodes in wt_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- insert for tissue_type node so sample_type_cd can be populated + + insert into wt_mrna_nodes + (leaf_node + ,category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,node_type + ) + select distinct topNode || regexp_replace(replace(replace(replace(replace(replace(replace( + substr(category_cd,1,instr(category_cd,'TISSUETYPE')+10),'PLATFORM',title),'ATTR1',attribute_1),'ATTR2',attribute_2),'TISSUETYPE',tissue_type),'+','\'),'_',' ') || '\', + '(\\){2,}', '\') + ,substr(category_cd,1,instr(category_cd,'TISSUETYPE')+10) + ,case when instr(substr(category_cd,1,instr(category_cd,'TISSUETYPE')+10),'PLATFORM') > 1 then platform else null end as platform + ,tissue_type as tissue_type + ,case when instr(substr(category_cd,1,instr(category_cd,'TISSUETYPE')+10),'ATTR1') > 1 then attribute_1 else null end as attribute_1 + ,case when instr(substr(category_cd,1,instr(category_cd,'TISSUETYPE')+10),'ATTR2') > 1 then attribute_2 else null end as attribute_2 + ,'TISSUETYPE' + from wt_mrna_node_values + where category_cd like '%TISSUETYPE%'; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create ATTR2 nodes in wt_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + update wt_mrna_nodes + set node_name=parse_nth_value(leaf_node,length(leaf_node)-length(replace(leaf_node,'\',null)),'\'); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Updated node_name in DEAPP tmp_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- add leaf nodes for mRNA data The cursor will only add nodes that do not already exist. + + FOR r_addNodes in addNodes Loop + --Add nodes for all types (ALSO DELETES EXISTING NODE) + i2b2_add_node(TrialID, r_addNodes.leaf_node, r_addNodes.node_name, jobId); + stepCt := stepCt + 1; + tText := 'Added Leaf Node: ' || r_addNodes.leaf_node || ' Name: ' || r_addNodes.node_name; + cz_write_audit(jobId,databaseName,procedureName,tText,SQL%ROWCOUNT,stepCt,'Done'); + i2b2_fill_in_tree(TrialId, r_addNodes.leaf_node, jobID); + END LOOP; + + -- set sourcesystem_cd, c_comment to null if any added upper-level nodes + + update i2b2 b + set sourcesystem_cd=null,c_comment=null + where b.sourcesystem_cd = TrialId + and length(b.c_fullname) < length(topNode); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Set sourcesystem_cd to null for added upper level nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- update concept_cd for nodes, this is done to make the next insert easier + + update wt_mrna_nodes t + set concept_cd=(select c.concept_cd from concept_dimension c + where c.concept_path = t.leaf_node + ) + where exists + (select 1 from concept_dimension x + where x.concept_path = t.leaf_node + ) + and t.concept_cd is null; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Update wt_mrna_nodes with newly created concept_cds',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + + --Load the DE_SUBJECT_SAMPLE_MAPPING from wt_subject_mrna_data + + --PATIENT_ID = PATIENT_ID (SAME AS ID ON THE PATIENT_DIMENSION) + --SITE_ID = site_id + --SUBJECT_ID = subject_id + --SUBJECT_TYPE = NULL + --CONCEPT_CODE = from LEAF records in wt_mrna_nodes + --SAMPLE_TYPE = TISSUE_TYPE + --SAMPLE_TYPE_CD = concept_cd from TISSUETYPE records in wt_mrna_nodes + --TRIAL_NAME = TRIAL_NAME + --TIMEPOINT = attribute_2 + --TIMEPOINT_CD = concept_cd from ATTR2 records in wt_mrna_nodes + --TISSUE_TYPE = attribute_1 + --TISSUE_TYPE_CD = concept_cd from ATTR1 records in wt_mrna_nodes + --PLATFORM = MRNA_AFFYMETRIX - this is required by ui code + --PLATFORM_CD = concept_cd from PLATFORM records in wt_mrna_nodes + --DATA_UID = concatenation of concept_cd-patient_num + --GPL_ID = platform from wt_subject_mrna_data + --CATEGORY_CD = category_cd that generated ontology + --SAMPLE_ID = id of sample (trial:S:[site_id]:subject_id:sample_cd) from patient_dimension, may be the same as patient_num + --SAMPLE_CD = sample_cd + --SOURCE_CD = sourceCd + + --ASSAY_ID = generated by trigger + + insert into de_subject_sample_mapping + (patient_id + ,site_id + ,subject_id + ,subject_type + ,concept_code + ,assay_id + ,sample_type + ,sample_type_cd + ,trial_name + ,timepoint + ,timepoint_cd + ,tissue_type + ,tissue_type_cd + ,platform + ,platform_cd + ,data_uid + ,gpl_id + ,sample_id + ,sample_cd + ,category_cd + ,source_cd + ,omic_source_study + ,omic_patient_id + ) + select t.patient_id + ,t.site_id + ,t.subject_id + ,t.subject_type + ,t.concept_code + ,deapp.seq_assay_id.nextval + ,t.sample_type + ,t.sample_type_cd + ,t.trial_name + ,t.timepoint + ,t.timepoint_cd + ,t.tissue_type + ,t.tissue_type_cd + ,t.platform + ,t.platform_cd + ,t.data_uid + ,t.gpl_id + ,t.sample_id + ,t.sample_cd + ,t.category_cd + ,t.source_cd + ,t.omic_source_study + ,t.omic_patient_id + from (select distinct b.patient_num as patient_id + ,a.site_id + ,a.subject_id + ,null as subject_type + ,ln.concept_cd as concept_code + ,a.tissue_type as sample_type + ,ttp.concept_cd as sample_type_cd + ,a.trial_name + ,a.attribute_2 as timepoint + ,a2.concept_cd as timepoint_cd + ,a.attribute_1 as tissue_type + ,a1.concept_cd as tissue_type_cd + ,'RNASEQ' as platform + ,pn.concept_cd as platform_cd + ,ln.concept_cd || '-' || to_char(b.patient_num) as data_uid + ,a.platform as gpl_id + ,coalesce(sid.patient_num,b.patient_num) as sample_id + ,a.sample_cd + ,nvl(a.category_cd,'Biomarker_Data+Gene_Expression+PLATFORM+TISSUETYPE+ATTR1+ATTR2') as category_cd + ,a.source_cd + ,TrialId as omic_source_study + ,b.patient_num as omic_patient_id + from lt_src_mrna_subj_samp_map a + --Joining to Pat_dim to ensure the ID's match. If not I2B2 won't work. + inner join patient_dimension b + on regexp_replace(TrialID || ':' || a.site_id || ':' || a.subject_id,'(::){1,}', ':') = b.sourcesystem_cd + inner join wt_mrna_nodes ln + on a.platform = ln.platform + and a.tissue_type = ln.tissue_type + and a.category_cd=ln.category_cd --modified + and nvl(a.attribute_1,'@') = nvl(ln.attribute_1,'@') + and nvl(a.attribute_2,'@') = nvl(ln.attribute_2,'@') + and ln.node_type = 'LEAF' + inner join wt_mrna_nodes pn + on a.platform = pn.platform + and pn.category_cd=substr(a.category_cd,1,instr(a.category_cd,'PLATFORM')+8) + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'PLATFORM')+8),'TISSUETYPE') > 1 then a.tissue_type else '@' end = nvl(pn.tissue_type,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'PLATFORM')+8),'ATTR1') > 1 then a.attribute_1 else '@' end = nvl(pn.attribute_1,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'PLATFORM')+8),'ATTR2') > 1 then a.attribute_2 else '@' end = nvl(pn.attribute_2,'@') + and pn.node_type = 'PLATFORM' + left outer join wt_mrna_nodes ttp + on a.tissue_type = ttp.tissue_type + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'TISSUETYPE')+10),'PLATFORM') > 1 then a.platform else '@' end = nvl(ttp.platform,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'TISSUETYPE')+10),'ATTR1') > 1 then a.attribute_1 else '@' end = nvl(ttp.attribute_1,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'TISSUETYPE')+10),'ATTR2') > 1 then a.attribute_2 else '@' end = nvl(ttp.attribute_2,'@') + and ttp.node_type = 'TISSUETYPE' + and ttp.category_cd=substr(a.category_cd,1,instr(a.category_cd,'TISSUETYPE')+10) + left outer join wt_mrna_nodes a1 + on a.attribute_1 = a1.attribute_1 + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR1')+5),'PLATFORM') > 1 then a.platform else '@' end = nvl(a1.platform,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR1')+5),'TISSUETYPE') > 1 then a.tissue_type else '@' end = nvl(a1.tissue_type,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR1')+5),'ATTR2') > 1 then a.attribute_2 else '@' end = nvl(a1.attribute_2,'@') + and a1.node_type = 'ATTR1' + and a1.category_cd=substr(a.category_cd,1,instr(a.category_cd,'ATTR1')+5) + left outer join wt_mrna_nodes a2 + on a.attribute_2 = a1.attribute_2 + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR2')+5),'PLATFORM') > 1 then a.platform else '@' end = nvl(a2.platform,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR2')+5),'TISSUETYPE') > 1 then a.tissue_type else '@' end = nvl(a2.tissue_type,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR2')+5),'ATTR1') > 1 then a.attribute_1 else '@' end = nvl(a2.attribute_1,'@') + and a2.node_type = 'ATTR2' + and a2.category_cd=substr(a.category_cd,1,instr(a.category_cd,'ATTR2')+5) + left outer join patient_dimension sid + on regexp_replace(TrialId || ':S:' || a.site_id || ':' || a.subject_id || ':' || a.sample_cd, + '(::){1,}', ':') = sid.sourcesystem_cd + where a.trial_name = TrialID + and a.source_cd = sourceCD + and ln.concept_cd is not null) t; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert trial into DEAPP de_subject_sample_mapping',SQL%ROWCOUNT,stepCt,'Done'); + + commit; + + insert into observation_fact + (patient_num + ,concept_cd + ,modifier_cd + ,valtype_cd + ,tval_char + ,nval_num + ,sourcesystem_cd + ,import_date + ,valueflag_cd + ,provider_id + ,location_cd + ,units_cd + ,sample_cd + ,instance_num + ) + select distinct m.patient_id + ,m.concept_code + ,'@' + ,'T' -- Text data type + ,'E' --Stands for Equals for Text Types + ,null -- not numeric for mRNA + ,m.trial_name + ,sysdate + ,'@' + ,'@' + ,'@' + ,'' -- no units available + ,m.sample_cd + ,1 + from de_subject_sample_mapping m + where m.trial_name = TrialID + and m.source_cd = sourceCD + and m.platform = 'RNASEQ'; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert patient facts into I2B2DEMODATA observation_fact',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- Insert sample facts + + insert into observation_fact + (patient_num + ,concept_cd + ,modifier_cd + ,valtype_cd + ,tval_char + ,nval_num + ,sourcesystem_cd + ,import_date + ,valueflag_cd + ,provider_id + ,location_cd + ,units_cd + ,sample_cd + ,instance_num + ) + select distinct m.sample_id + ,m.concept_code + ,m.trial_name + ,'T' -- Text data type + ,'E' --Stands for Equals for Text Types + ,null -- not numeric for mRNA + ,m.trial_name + ,sysdate + ,'@' + ,'@' + ,'@' + ,'' -- no units available + ,m.sample_cd + ,1 + from de_subject_sample_mapping m + where m.trial_name = TrialID + and m.source_cd = sourceCd + and m.platform = 'RNASEQ' + and m.patient_id != m.sample_id; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert sample facts into I2B2DEMODATA observation_fact',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + ---INSERT sample_dimension + INSERT INTO I2B2DEMODATA.SAMPLE_DIMENSION(SAMPLE_CD) + SELECT DISTINCT SAMPLE_CD FROM + DEAPP.DE_SUBJECT_SAMPLE_MAPPING WHERE SAMPLE_CD NOT IN (SELECT SAMPLE_CD FROM I2B2DEMODATA.SAMPLE_DIMENSION) ; + + --Update I2b2 for correct data type + update i2b2 t + set c_columndatatype = 'T', c_metadataxml = null, c_visualattributes='FA' + where t.c_basecode in (select distinct x.concept_cd from wt_mrna_nodes x); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Initialize data_type and xml in i2b2',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + for ul in uploadI2b2 + loop + update i2b2 n + SET n.c_columndatatype = 'T', + --Static XML String + n.c_metadataxml = ('3.0208/14/2008 01:22:59PosFloatY0 + 0100100100 + + + ratio + + + '||(select xmlelement(name "SeriesMeta",xmlforest(m.display_value as "Value",m.display_unit as "Unit",m.display_label as "DisplayName")) as hi + from tm_lz.lt_src_display_mapping m where m.category_cd=ul.category_cd)|| + '') where n.c_fullname=(select leaf_node from wt_mrna_nodes where category_cd=ul.category_cd and leaf_node=n.c_fullname); + + end loop; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Update c_columndatatype and c_metadataxml for numeric data types in I2B2METADATA i2b2',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + --UPDATE VISUAL ATTRIBUTES for Leaf Active (Default is folder) + update i2b2 a + set c_visualattributes = 'LAH' + where a.c_basecode in (select distinct x.concept_code from de_subject_sample_mapping x + where x.trial_name = TrialId + and x.platform = 'RNASEQ' + and x.concept_code is not null); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Update visual attributes for leaf nodes in I2B2METADATA i2b2',SQL%ROWCOUNT,stepCt,'Done'); + COMMIT; + + update i2b2 a + set c_visualattributes='FAS' + where a.c_fullname = substr(topNode,1,instr(topNode,'\',1,3)); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Update visual attributes for study nodes in I2B2METADATA i2b2',SQL%ROWCOUNT,stepCt,'Done'); + COMMIT; + + --Build concept Counts + --Also marks any i2B2 records with no underlying data as Hidden, need to do at Trial level because there may be multiple platform and there is no longer + -- a unique top-level node for mRNA data + + i2b2_create_concept_counts(topNode ,jobID ); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create concept counts',0,stepCt,'Done'); + + -- delete each node that is hidden + + FOR r_delNodes in delNodes Loop + -- deletes hidden nodes for a trial one at a time + i2b2_delete_1_node(r_delNodes.c_fullname); + stepCt := stepCt + 1; + tText := 'Deleted node: ' || r_delNodes.c_fullname; + cz_write_audit(jobId,databaseName,procedureName,tText,SQL%ROWCOUNT,stepCt,'Done'); + END LOOP; + + + --Reload Security: Inserts one record for every I2B2 record into the security table + + i2b2_load_security_data(jobId); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Load security data',0,stepCt,'Done'); + + -- tag data with probeset_id from reference.probeset_deapp + + execute immediate ('truncate table tm_wz.wt_subject_mrna_probeset'); + + -- note: assay_id represents a unique subject/site/sample + + insert into tm_wz.wt_subject_rnaseq_region + (region_id + ,readcount + ,patient_id + ,trial_name + ,assay_id + ) + select gs.region_id + ,cast(md.readcount as number) + ,sd.patient_id + ,TrialId + ,sd.assay_id + from deapp.de_subject_sample_mapping sd + ,tm_lz.lt_src_rnaseq_data md + ,deapp.de_chromosomal_region gs + where sd.sample_cd = md.expr_id + and sd.platform = 'RNASEQ' + and sd.trial_name = TrialId + and sd.source_cd = sourceCd + and sd.gpl_id = gs.gpl_id + and md.region_name = gs.region_name + group by gs.region_id, md.readcount, sd.patient_id, sd.assay_id; + + insert into deapp.de_subject_rnaseq_data + ( region_id + , assay_id + , patient_id + , trial_name + , readcount + ) + select region_id + , assay_id + , patient_id + , trial_name + , readcount + from tm_wz.wt_subject_rnaseq_region; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert into DEAPP wt_subject_mrna_probeset',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + if pExists = 0 then + raise no_probeset_recs; + end if; + + + ---Cleanup OVERALL JOB if this proc is being run standalone + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'End i2b2_process_rnaseq_data',0,stepCt,'Done'); + + IF newJobFlag = 1 + THEN + cz_end_audit (jobID, 'SUCCESS'); + END IF; + + select 0 into rtn_code from dual; + + EXCEPTION + --when unmapped_patients then + -- cz_write_audit(jobId,databasename,procedurename,'No site_id/subject_id mapped to patient_dimension',1,stepCt,'ERROR'); + -- cz_error_handler(jobid,procedurename); + -- cz_end_audit (jobId,'FAIL'); + when missing_platform then + cz_write_audit(jobId,databasename,procedurename,'Platform data missing from one or more subject_sample mapping records',1,stepCt,'ERROR'); + cz_error_handler(jobid,procedurename); + cz_end_audit (jobId,'FAIL'); + select 161 into rtn_code from dual; + when missing_tissue then + cz_write_audit(jobId,databasename,procedurename,'Tissue Type data missing from one or more subject_sample mapping records',1,stepCt,'ERROR'); + cz_error_handler(jobid,procedurename); + CZ_END_AUDIT (JOBID,'FAIL'); + select 162 into rtn_code from dual; + when unmapped_platform then + cz_write_audit(jobId,databasename,procedurename,'Platform not found in de_chromosomal_region',1,stepCt,'ERROR'); + CZ_ERROR_HANDLER(JOBID,PROCEDURENAME); + cz_end_audit (jobId,'FAIL'); + select 169 into rtn_code from dual; + when multiple_platform then + cz_write_audit(jobId,databasename,procedurename,'Multiple platforms for sample_cd in lt_src_mrna_subj_samp_map',1,stepCt,'ERROR'); + CZ_ERROR_HANDLER(JOBID,PROCEDURENAME); + cz_end_audit (jobId,'FAIL'); + select 163 into rtn_code from dual; + when no_probeset_recs then + cz_write_audit(jobId,databasename,procedurename,'Unable to match probesets to platform in probeset_deapp',1,stepCt,'ERROR'); + CZ_ERROR_HANDLER(JOBID,PROCEDURENAME); + cz_end_audit (jobId,'FAIL'); + select 165 into rtn_code from dual; + WHEN OTHERS THEN + --Handle errors. + cz_error_handler (jobID, procedureName); + --End Proc + cz_end_audit (jobID, 'FAIL'); + select 166 into rtn_code from dual; +END; + +/ diff --git a/ddl/oracle/tm_cz/procedures/i2b2_process_snp_data.sql b/ddl/oracle/tm_cz/procedures/i2b2_process_snp_data.sql new file mode 100644 index 00000000..f859a773 --- /dev/null +++ b/ddl/oracle/tm_cz/procedures/i2b2_process_snp_data.sql @@ -0,0 +1,1621 @@ +-- +-- Type: PROCEDURE; Owner: TM_CZ; Name: I2B2_PROCESS_SNP_DATA +-- + CREATE OR REPLACE EDITIONABLE PROCEDURE "TM_CZ"."I2B2_PROCESS_SNP_DATA" +( + trial_id VARCHAR2 + ,top_node varchar2 + ,data_type varchar2 := 'R' -- R = raw data, do zscore calc, T = transformed data, load raw values as zscore, + -- L = log intensity data, skip log step in zscore calc + ,source_cd varchar2 := 'STD' -- default source_cd = 'STD' + ,log_base number := 2 -- log base value for conversion back to raw + ,secure_study varchar2 -- security setting if new patients added to patient_dimension + ,currentJobID NUMBER := null + ,rtn_code OUT NUMBER +) +AS + + + + + + + + + + +-- Procedure to load the DE_SUBJECT_MICROARRAY_DATA and DE_SUBJECT_SAMPLE_MAPPING tables, compute the Z-Score, and create the I2B2 data for mRNA (gene expression) data +-- wt_subject_mrna_data must be pre-loaded with gene expression data. Because the format/content of gene expression data varies, +-- the loading of wt_subject_mrna_data is not done within this procedure + + + + + + + + + + +-- *** NOTE *** +-- The input file columns are mapped to the following table columns. This is done so that the javascript for the advanced workflows +-- selects the correct data for the dropdowns. + + + + + + + + + + + + + + + + + +-- tissue_type => sample_type +-- attribute_1 => tissue_type +-- atrribute_2 => timepoint + + + + + + + +-- JEA@90090904 New, modified version from JnJ +-- JEA@20111017 Remove JnJ-specific ontology, use path derived from category_cd +-- JEA@20111028 Use lt_ tables instead of extrnl to accomodate clients without external tables +-- JEA@20111116 Insert subject_id to patient_dimension if not exists (no clinical data) +-- JEA@20111116 Added source_cd handling to account for multiple transformations for same study +-- JEA@@0111117 Removed code to insert sample into patient_dimension +-- JEA@20111201 Added i2b2 attribute update code +-- JEA@20111207 Added distinct to patient insert +-- JEA@21001209 Added platform to lt_src_mrna_data, lz_src_mrna_data, use probeset_deapp for probe_id +-- JEA@20112121 Remove platform stuff, add exception if sample_cd has multiple platforms +-- JEA@20111214 Throw exception if no rows inserted into wt_subject_mrna_probeset +-- JEA@20120113 Added H to c_visualattributes for high-density biomarker +-- JEA@20120131 Remove check for organism in de_gpl_info. +-- JEA@20120301 Custom for Millennium to support multiple gene expression analysis per study, +-- JEA@20120314 Pass sourceCD to i2b2_mrna_zscore_calc so correct trial_source set +-- JEA@20120416 Add omic_source_study, omic_patient_id to de_subject_sample_mapping and populate +-- JEA@@0120510 Add root_node using i2b2_add_root_node if missing +-- JEA@20120526 Set sourcesystem_cd, c_comment to null if any upper-level nodes added, set sex_cd to Unknown if adding subjects +-- ER @20121203 Added "Z" datatype as a temporary workaround for "T" data processing bug + + + TrialID varchar2(100); + RootNode VARCHAR2(2000); + root_level integer; + topNode varchar2(2000); + topLevel integer; + tPath varchar2(2000); + study_name varchar2(100); + sourceCd varchar2(50); + secureStudy varchar2(1); + + dataType varchar2(10); + sqlText varchar2(1000); + tText varchar2(1000); + gplTitle varchar2(1000); + pExists number; + dataParitioned number; + partTbl number; + partExists number; + sampleCt number; + idxExists number; + logBase number; + pCount integer; + sCount integer; + tablespaceName varchar2(200); + + --Audit variables + newJobFlag INTEGER(1); + databaseName VARCHAR(100); + procedureName VARCHAR(100); + jobID number(18,0); + stepCt number(18,0); + + --unmapped_patients exception; + missing_platform exception; + missing_tissue EXCEPTION; + unmapped_platform exception; + multiple_platform exception; + no_probeset_recs exception; + + + + CURSOR addNodes is + select distinct t.leaf_node + ,t.node_name + from wt_mrna_nodes t + where not exists + (select 1 from i2b2 x + where t.leaf_node = x.c_fullname); + + +-- cursor to define the path for delete_one_node this will delete any nodes that are hidden after i2b2_create_concept_counts + + CURSOR delNodes is + select distinct c_fullname + + from i2b2 + where c_fullname like topNode || '%' + and substr(c_visualattributes,2,1) = 'H'; + --and c_visualattributes like '_H_'; + + +BEGIN + TrialID := upper(trial_id); + secureStudy := upper(secure_study); + + + + + + + + + + + + + + + + + + + + + if (secureStudy not in ('Y','N') ) then + secureStudy := 'Y'; + end if; + + + + topNode := REGEXP_REPLACE('\' || top_node || '\','(\\){2,}', '\'); + select length(topNode)-length(replace(topNode,'\','')) into topLevel from dual; + + if data_type is null then + dataType := 'R'; + else + if data_type in ('R','T','L','Z') then + dataType := data_type; + else + dataType := 'R'; + end if; + end if; + + + + + + logBase := log_base; + sourceCd := upper(nvl(source_cd,'STD')); + + --Set Audit Parameters + newJobFlag := 0; -- False (Default) + jobID := currentJobID; + + SELECT sys_context('USERENV', 'CURRENT_SCHEMA') INTO databaseName FROM dual; + procedureName := $$PLSQL_UNIT; + + --Audit JOB Initialization + --If Job ID does not exist, then this is a single procedure run and we need to create it + IF(jobID IS NULL or jobID < 1) + THEN + newJobFlag := 1; -- True + cz_start_audit (procedureName, databaseName, jobID); + END IF; + + stepCt := 0; + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Starting i2b2_process_mrna_data',0,stepCt,'Done'); + + -- Get count of records in lt_src_mrna_subj_samp_map + + select count(*) into sCount + from lt_src_mrna_subj_samp_map; + + -- check if all subject_sample map records have a platform, If not, abort run + + select count(*) into pCount + from lt_src_mrna_subj_samp_map + where platform is null; + + if pCount > 0 then + + + + + raise missing_platform; + end if; + + + -- check if platform exists in de_mrna_annotation . If not, abort run. + + select count(*) into pCount + + from DE_MRNA_ANNOTATION + where GPL_ID in (select distinct m.platform from lt_src_mrna_subj_samp_map m); + + if PCOUNT = 0 then + + + + RAISE UNMAPPED_platform; + end if; + + + + select count(*) into pCount + + + + + + + from DE_gpl_info + where platform in (select distinct m.platform from lt_src_mrna_subj_samp_map m); + + if PCOUNT = 0 then + + + + RAISE UNMAPPED_platform; + end if; + + -- check if all subject_sample map records have a tissue_type, If not, abort run + + select count(*) into pCount + from lt_src_mrna_subj_samp_map + where tissue_type is null; + + if pCount > 0 then + + + + raise missing_tissue; + end if; + + -- check if there are multiple platforms, if yes, then platform must be supplied in lt_src_mrna_data + + select count(*) into pCount + from (select sample_cd + from lt_src_mrna_subj_samp_map + group by sample_cd + having count(distinct platform) > 1); + + if pCount > 0 then + + + + raise multiple_platform; + end if; + + -- Get root_node from topNode + + + select parse_nth_value(topNode, 2, '\') into RootNode from dual; + + select count(*) into pExists + + from table_access + where c_name = rootNode; + + if pExists = 0 then + i2b2_add_root_node(rootNode, jobId); + end if; + + select c_hlevel into root_level + from table_access /* from i2b2 */ + where c_name = RootNode; + + -- Get study name from topNode + + + select parse_nth_value(topNode, topLevel, '\') into study_name from dual; + + -- Add any upper level nodes as needed + + tPath := REGEXP_REPLACE(replace(top_node,study_name,null),'(\\){2,}', '\'); + select length(tPath) - length(replace(tPath,'\',null)) into pCount from dual; + + if pCount > 2 then + i2b2_fill_in_tree(null, tPath, jobId); + end if; + + + + + -- uppercase study_id in lt_src_mrna_subj_samp_map in case curator forgot + + + + + + + + + + + + + update lt_src_mrna_subj_samp_map + set trial_name=upper(trial_name); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Uppercase trial_name in lt_src_mrna_subj_samp_map',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- create records in patient_dimension for subject_ids if they do not exist + -- format of sourcesystem_cd: trial:[site:]subject_cd + + + insert into patient_dimension + ( patient_num, + sex_cd, + age_in_years_num, + race_cd, + update_date, + download_date, + import_date, + sourcesystem_cd + + ) + select seq_patient_num.nextval + ,x.sex_cd + ,x.age_in_years_num + ,x.race_cd + + + + ,sysdate + ,sysdate + ,sysdate + ,x.sourcesystem_cd + from (select distinct 'Unknown' as sex_cd, + 0 as age_in_years_num, + null as race_cd, + regexp_replace(TrialID || ':' || s.site_id || ':' || s.subject_id,'(::){1,}', ':') as sourcesystem_cd + from lt_src_mrna_subj_samp_map s + ,de_gpl_info g + where s.subject_id is not null + and s.trial_name = TrialID + and s.source_cd = sourceCD + and s.platform = g.platform + and upper(g.marker_type) = 'GENE EXPRESSION' + and not exists + (select 1 from patient_dimension x + where x.sourcesystem_cd = + regexp_replace(TrialID || ':' || s.site_id || ':' || s.subject_id,'(::){1,}', ':')) + ) x; + + + + + + + + + + + + pCount := SQL%ROWCOUNT; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert subjects to patient_dimension',pCount,stepCt,'Done'); + commit; + + -- add security for trial if new subjects added to patient_dimension + + if pCount > 0 then + i2b2_create_security_for_trial(TrialId, secureStudy, jobID); + end if; + + -- Delete existing observation_fact data, will be repopulated + + + delete from observation_fact obf + where obf.concept_cd in + (select distinct x.concept_code + from de_subject_sample_mapping x + where x.trial_name = TrialId + and nvl(x.source_cd,'STD') = sourceCD + and x.platform = 'SNP'); + + + + + + + + + + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Delete data from observation_fact',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + select count(*) into dataParitioned + from all_tables + where table_name = 'DE_SUBJECT_MICROARRAY_DATA' + and partitioned = 'YES'; + + select count(*) + into pExists + from all_tab_partitions + where table_name = 'DE_SUBJECT_MICROARRAY_DATA' + and partition_name = TrialId || ':' || sourceCd; + + + if dataParitioned = 0 or pExists <> 0 then + -- dataset is not partitioned so must delete + delete from de_subject_microarray_data + where trial_source = TrialId || ':' || sourceCd + and assay_id in ( + select dssm.assay_id from + TM_LZ.lt_src_mrna_subj_samp_map ltssm + left join + deapp.de_subject_sample_mapping dssm + on + dssm.trial_name = ltssm.trial_name + and dssm.gpl_id = ltssm.platform + and dssm.subject_id = ltssm.subject_id + and dssm.sample_cd = ltssm.sample_cd + where + dssm.trial_name = TrialId + and nvl(dssm.source_cd,'STD') = sourceCd + and dssm.platform = 'SNP' + ); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Delete data from de_subject_microarray_data',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + end if; + + if dataParitioned <> 0 and pExists = 0 then + -- Create partition in de_subject_microarray_data if it doesn't exist else truncate partition + -- needed to add partition to de_subject_microarray_data + sqlText := 'alter table deapp.de_subject_microarray_data add PARTITION "' || TrialID || ':' || sourceCd || '" VALUES (' || '''' || TrialID || ':' || sourceCd || '''' || ') ' || + 'NOLOGGING COMPRESS '; + execute immediate(sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Adding partition to de_subject_microarray_data',0,stepCt,'Done'); + + end if; + + -- Cleanup any existing data in de_subject_sample_mapping. + delete from de_subject_sample_mapping where + assay_id in ( + select dssm.assay_id from + TM_LZ.lt_src_mrna_subj_samp_map ltssm + left join + deapp.de_subject_sample_mapping dssm + on + dssm.trial_name = ltssm.trial_name + and dssm.gpl_id = ltssm.platform + and dssm.subject_id = ltssm.subject_id + and dssm.sample_cd = ltssm.sample_cd + where + dssm.trial_name = TrialID + and nvl(dssm.source_cd,'STD') = sourceCd + and dssm.platform = 'SNP' + ); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Delete trial from DEAPP de_subject_sample_mapping',SQL%ROWCOUNT,stepCt,'Done'); + + commit; + +-- truncate tmp node table + + execute immediate('truncate table tm_wz.wt_mrna_nodes'); + + + +-- load temp table with leaf node path, use temp table with distinct sample_type, ATTR2, platform, and title this was faster than doing subselect +-- from wt_subject_mrna_data + + execute immediate('truncate table tm_wz.wt_mrna_node_values'); + + insert into wt_mrna_node_values + (category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,title + ) + select distinct a.category_cd + ,nvl(a.platform,'GPL570') + ,nvl(a.tissue_type,'Unspecified Tissue Type') + ,a.attribute_1 + ,a.attribute_2 + ,g.title + from lt_src_mrna_subj_samp_map a + ,de_gpl_info g + where a.trial_name = TrialID + and nvl(a.platform,'GPL570') = g.platform + and a.source_cd = sourceCD + and a.platform = g.platform + and upper(g.marker_type) = 'GENE EXPRESSION' + + + + + + + + + + -- and upper(g.organism) = 'HOMO SAPIENS' + ; + -- and decode(dataType,'R',sign(a.intensity_value),1) = 1; -- take all values when dataType T, only >0 for dataType R + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert node values into DEAPP wt_mrna_node_values',SQL%ROWCOUNT,stepCt,'Done'); + + + commit; + + + insert into wt_mrna_nodes + (leaf_node + ,category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,node_type + ) + select distinct topNode || regexp_replace(replace(replace(replace(replace(replace(replace( + category_cd,'PLATFORM',title),'ATTR1',attribute_1),'ATTR2',attribute_2),'TISSUETYPE',tissue_type),'+','\'),'_',' ') || '\','(\\){2,}', '\') + ,category_cd + ,platform as platform + ,tissue_type + ,attribute_1 as attribute_1 + ,attribute_2 as attribute_2 + ,'LEAF' + from wt_mrna_node_values; + + + + + + + + + + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create leaf nodes in DEAPP tmp_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + -- insert for platform node so platform concept can be populated + + + insert into wt_mrna_nodes + (leaf_node + ,category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,node_type + ) + select distinct topNode || regexp_replace(replace(replace(replace(replace(replace(replace( + substr(category_cd,1,instr(category_cd,'PLATFORM')+8),'PLATFORM',title),'ATTR1',attribute_1),'ATTR2',attribute_2),'TISSUETYPE',tissue_type),'+','\'),'_',' ') || '\', + '(\\){2,}', '\') + ,substr(category_cd,1,instr(category_cd,'PLATFORM')+8) + ,platform as platform + ,case when instr(substr(category_cd,1,instr(category_cd,'PLATFORM')+8),'TISSUETYPE') > 1 then tissue_type else null end as tissue_type + ,case when instr(substr(category_cd,1,instr(category_cd,'PLATFORM')+8),'ATTR1') > 1 then attribute_1 else null end as attribute_1 + ,case when instr(substr(category_cd,1,instr(category_cd,'PLATFORM')+8),'ATTR2') > 1 then attribute_2 else null end as attribute_2 + ,'PLATFORM' + from wt_mrna_node_values; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create platform nodes in wt_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + + + + + + + + + + + -- insert for ATTR1 node so ATTR1 concept can be populated in tissue_type_cd + + + insert into wt_mrna_nodes + (leaf_node + ,category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,node_type + ) + select distinct topNode || regexp_replace(replace(replace(replace(replace(replace(replace( + substr(category_cd,1,instr(category_cd,'ATTR1')+5),'PLATFORM',title),'ATTR1',attribute_1),'ATTR2',attribute_2),'TISSUETYPE',tissue_type),'+','\'),'_',' ') || '\', + '(\\){2,}', '\') + ,substr(category_cd,1,instr(category_cd,'ATTR1')+5) + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR1')+5),'PLATFORM') > 1 then platform else null end as platform + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR1')+5),'TISSUETYPE') > 1 then tissue_type else null end as tissue_type + ,attribute_1 as attribute_1 + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR1')+5),'ATTR2') > 1 then attribute_2 else null end as attribute_2 + ,'ATTR1' + from wt_mrna_node_values + where category_cd like '%ATTR1%' + and attribute_1 is not null; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create ATTR1 nodes in wt_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + + + + + + + + + + + -- insert for ATTR2 node so ATTR2 concept can be populated in timepoint_cd + + + insert into wt_mrna_nodes + (leaf_node + ,category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,node_type + ) + select distinct topNode || regexp_replace(replace(replace(replace(replace(replace(replace( + substr(category_cd,1,instr(category_cd,'ATTR2')+5),'PLATFORM',title),'ATTR1',attribute_1),'ATTR2',attribute_2),'TISSUETYPE',tissue_type),'+','\'),'_',' ') || '\', + '(\\){2,}', '\') + ,substr(category_cd,1,instr(category_cd,'ATTR2')+5) + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR2')+5),'PLATFORM') > 1 then platform else null end as platform + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR1')+5),'TISSUETYPE') > 1 then tissue_type else null end as tissue_type + ,case when instr(substr(category_cd,1,instr(category_cd,'ATTR2')+5),'ATTR1') > 1 then attribute_1 else null end as attribute_1 + ,attribute_2 as attribute_2 + ,'ATTR2' + from wt_mrna_node_values + where category_cd like '%ATTR2%' + and attribute_2 is not null; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create ATTR2 nodes in wt_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + + + + + + + + + + + -- insert for tissue_type node so sample_type_cd can be populated + + + insert into wt_mrna_nodes + (leaf_node + ,category_cd + ,platform + ,tissue_type + ,attribute_1 + ,attribute_2 + ,node_type + ) + select distinct topNode || regexp_replace(replace(replace(replace(replace(replace(replace( + substr(category_cd,1,instr(category_cd,'TISSUETYPE')+10),'PLATFORM',title),'ATTR1',attribute_1),'ATTR2',attribute_2),'TISSUETYPE',tissue_type),'+','\'),'_',' ') || '\', + '(\\){2,}', '\') + ,substr(category_cd,1,instr(category_cd,'TISSUETYPE')+10) + ,case when instr(substr(category_cd,1,instr(category_cd,'TISSUETYPE')+10),'PLATFORM') > 1 then platform else null end as platform + ,tissue_type as tissue_type + ,case when instr(substr(category_cd,1,instr(category_cd,'TISSUETYPE')+10),'ATTR1') > 1 then attribute_1 else null end as attribute_1 + ,case when instr(substr(category_cd,1,instr(category_cd,'TISSUETYPE')+10),'ATTR2') > 1 then attribute_2 else null end as attribute_2 + ,'TISSUETYPE' + from wt_mrna_node_values + where category_cd like '%TISSUETYPE%'; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create ATTR2 nodes in wt_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + + + + + + + + + + + update wt_mrna_nodes + set node_name=parse_nth_value(leaf_node,length(leaf_node)-length(replace(leaf_node,'\',null)),'\'); + + + + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Updated node_name in DEAPP tmp_mrna_nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + + + + + + + + + + +-- add leaf nodes for mRNA data The cursor will only add nodes that do not already exist. + + FOR r_addNodes in addNodes Loop + + --Add nodes for all types (ALSO DELETES EXISTING NODE) + + i2b2_add_node(TrialID, r_addNodes.leaf_node, r_addNodes.node_name, jobId); + stepCt := stepCt + 1; + tText := 'Added Leaf Node: ' || r_addNodes.leaf_node || ' Name: ' || r_addNodes.node_name; + + cz_write_audit(jobId,databaseName,procedureName,tText,SQL%ROWCOUNT,stepCt,'Done'); + + i2b2_fill_in_tree(TrialId, r_addNodes.leaf_node, jobID); + + END LOOP; + + -- set sourcesystem_cd, c_comment to null if any added upper-level nodes + + + update i2b2 b + set sourcesystem_cd=null,c_comment=null + where b.sourcesystem_cd = TrialId + and length(b.c_fullname) < length(topNode); + + + + + + + + + + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Set sourcesystem_cd to null for added upper level nodes',SQL%ROWCOUNT,stepCt,'Done'); + commit; + +-- update concept_cd for nodes, this is done to make the next insert easier + + + update wt_mrna_nodes t + set concept_cd=(select c.concept_cd from concept_dimension c + where c.concept_path = t.leaf_node + ) + where exists + (select 1 from concept_dimension x + where x.concept_path = t.leaf_node + ) + and t.concept_cd is null; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Update wt_mrna_nodes with newly created concept_cds',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + + + + + + + + + + + + + + + + + + --Load the DE_SUBJECT_SAMPLE_MAPPING from wt_subject_mrna_data + + + + + + + --PATIENT_ID = PATIENT_ID (SAME AS ID ON THE PATIENT_DIMENSION) + --SITE_ID = site_id + --SUBJECT_ID = subject_id + --SUBJECT_TYPE = NULL + --CONCEPT_CODE = from LEAF records in wt_mrna_nodes + --SAMPLE_TYPE = TISSUE_TYPE + --SAMPLE_TYPE_CD = concept_cd from TISSUETYPE records in wt_mrna_nodes + --TRIAL_NAME = TRIAL_NAME + --TIMEPOINT = attribute_2 + --TIMEPOINT_CD = concept_cd from ATTR2 records in wt_mrna_nodes + --TISSUE_TYPE = attribute_1 + --TISSUE_TYPE_CD = concept_cd from ATTR1 records in wt_mrna_nodes + --PLATFORM = MRNA_AFFYMETRIX - this is required by ui code + --PLATFORM_CD = concept_cd from PLATFORM records in wt_mrna_nodes + --DATA_UID = concatenation of concept_cd-patient_num + --GPL_ID = platform from wt_subject_mrna_data + --CATEGORY_CD = category_cd that generated ontology + --SAMPLE_ID = id of sample (trial:S:[site_id]:subject_id:sample_cd) from patient_dimension, may be the same as patient_num + --SAMPLE_CD = sample_cd + --SOURCE_CD = sourceCd + + --ASSAY_ID = generated by trigger + + + insert into de_subject_sample_mapping + (patient_id + ,site_id + ,subject_id + ,subject_type + ,concept_code + ,assay_id + ,sample_type + ,sample_type_cd + ,trial_name + ,timepoint + ,timepoint_cd + ,tissue_type + ,tissue_type_cd + ,platform + ,platform_cd + ,data_uid + ,gpl_id + ,sample_id + ,sample_cd + ,category_cd + ,source_cd + ,omic_source_study + ,omic_patient_id + + ) + select t.patient_id + ,t.site_id + ,t.subject_id + ,t.subject_type + ,t.concept_code + ,deapp.seq_assay_id.nextval + ,t.sample_type + ,t.sample_type_cd + ,t.trial_name + ,t.timepoint + ,t.timepoint_cd + ,t.tissue_type + ,t.tissue_type_cd + ,t.platform + ,t.platform_cd + ,t.data_uid + ,t.gpl_id + ,t.sample_id + ,t.sample_cd + ,t.category_cd + ,t.source_cd + ,t.omic_source_study + ,t.omic_patient_id + from (select distinct b.patient_num as patient_id + ,a.site_id + ,a.subject_id + ,null as subject_type + ,ln.concept_cd as concept_code + ,a.tissue_type as sample_type + ,ttp.concept_cd as sample_type_cd + ,a.trial_name + ,a.attribute_2 as timepoint + ,a2.concept_cd as timepoint_cd + ,a.attribute_1 as tissue_type + ,a1.concept_cd as tissue_type_cd + + ,'SNP' as platform + ,pn.concept_cd as platform_cd + ,ln.concept_cd || '-' || to_char(b.patient_num) as data_uid + ,a.platform as gpl_id + ,coalesce(sid.patient_num,b.patient_num) as sample_id + ,a.sample_cd + ,nvl(a.category_cd,'Biomarker_Data+Gene_Expression+PLATFORM+TISSUETYPE+ATTR1+ATTR2') as category_cd + ,a.source_cd + ,TrialId as omic_source_study + ,b.patient_num as omic_patient_id + from lt_src_mrna_subj_samp_map a + --Joining to Pat_dim to ensure the ID's match. If not I2B2 won't work. + inner join patient_dimension b + on regexp_replace(TrialID || ':' || a.site_id || ':' || a.subject_id,'(::){1,}', ':') = b.sourcesystem_cd + inner join wt_mrna_nodes ln + on a.platform = ln.platform + and a.tissue_type = ln.tissue_type + and nvl(a.attribute_1,'@') = nvl(ln.attribute_1,'@') + and nvl(a.attribute_2,'@') = nvl(ln.attribute_2,'@') + and ln.node_type = 'LEAF' + inner join wt_mrna_nodes pn + on a.platform = pn.platform + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'PLATFORM')+8),'TISSUETYPE') > 1 then a.tissue_type else '@' end = nvl(pn.tissue_type,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'PLATFORM')+8),'ATTR1') > 1 then a.attribute_1 else '@' end = nvl(pn.attribute_1,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'PLATFORM')+8),'ATTR2') > 1 then a.attribute_2 else '@' end = nvl(pn.attribute_2,'@') + and pn.node_type = 'PLATFORM' + left outer join wt_mrna_nodes ttp + on a.tissue_type = ttp.tissue_type + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'TISSUETYPE')+10),'PLATFORM') > 1 then a.platform else '@' end = nvl(ttp.platform,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'TISSUETYPE')+10),'ATTR1') > 1 then a.attribute_1 else '@' end = nvl(ttp.attribute_1,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'TISSUETYPE')+10),'ATTR2') > 1 then a.attribute_2 else '@' end = nvl(ttp.attribute_2,'@') + and ttp.node_type = 'TISSUETYPE' + left outer join wt_mrna_nodes a1 + on a.attribute_1 = a1.attribute_1 + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR1')+5),'PLATFORM') > 1 then a.platform else '@' end = nvl(a1.platform,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR1')+5),'TISSUETYPE') > 1 then a.tissue_type else '@' end = nvl(a1.tissue_type,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR1')+5),'ATTR2') > 1 then a.attribute_2 else '@' end = nvl(a1.attribute_2,'@') + and a1.node_type = 'ATTR1' + left outer join wt_mrna_nodes a2 + on a.attribute_2 = a1.attribute_2 + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR2')+5),'PLATFORM') > 1 then a.platform else '@' end = nvl(a2.platform,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR2')+5),'TISSUETYPE') > 1 then a.tissue_type else '@' end = nvl(a2.tissue_type,'@') + and case when instr(substr(a.category_cd,1,instr(a.category_cd,'ATTR2')+5),'ATTR1') > 1 then a.attribute_1 else '@' end = nvl(a2.attribute_1,'@') + and a2.node_type = 'ATTR2' + left outer join patient_dimension sid + on regexp_replace(TrialId || ':S:' || a.site_id || ':' || a.subject_id || ':' || a.sample_cd, + '(::){1,}', ':') = sid.sourcesystem_cd + where a.trial_name = TrialID + and a.source_cd = sourceCD + and ln.concept_cd is not null) t; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert trial into DEAPP de_subject_sample_mapping',SQL%ROWCOUNT,stepCt,'Done'); + + commit; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-- recreate de_subject_sample_mapping indexes + + + --execute immediate('create index de_subject_smpl_mpng_idx1 on de_subject_sample_mapping(timepoint, patient_id, trial_name) parallel nologging'); + --execute immediate('create index de_subject_smpl_mpng_idx2 on de_subject_sample_mapping(patient_id, timepoint_cd, platform_cd, assay_id, trial_name) parallel nologging'); + --execute immediate('create bitmap index de_subject_smpl_mpng_idx3 on de_subject_sample_mapping(sample_type_cd) parallel nologging'); + --execute immediate('create index de_subject_smpl_mpng_idx4 on de_subject_sample_mapping(gpl_id) parallel nologging'); + --execute immediate('create index de_subject_smpl_mpng_idx4 on de_subject_sample_mapping(platform, gpl_id) parallel nologging'); + --stepCt := stepCt + 1; + --cz_write_audit(jobId,databaseName,procedureName,'Recreate indexes on DEAPP de_subject_sample_mapping',0,stepCt,'Done'); + +-- Insert records for patients and samples into observation_fact + + insert into observation_fact + (patient_num + ,concept_cd + ,modifier_cd + ,valtype_cd + ,tval_char + ,nval_num + ,sourcesystem_cd + ,import_date + ,valueflag_cd + ,provider_id + ,location_cd + + + ,UNITS_CD + ,instance_num + ) + select distinct m.patient_id + ,m.concept_code + ,m.trial_name + ,'T' -- Text data type + ,'E' --Stands for Equals for Text Types + ,null -- not numeric for mRNA + ,m.trial_name + + ,sysdate + ,'@' + ,'@' + ,'@' + ,'' -- no units available + ,1 + from de_subject_sample_mapping m + where m.trial_name = TrialID + and m.source_cd = sourceCD + and m.platform = 'SNP'; + + + + + + + + + + + + + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert patient facts into I2B2DEMODATA observation_fact',SQL%ROWCOUNT,stepCt,'Done'); + + + commit; + + -- Insert sample facts + + insert into observation_fact + (patient_num + ,concept_cd + ,modifier_cd + ,valtype_cd + ,tval_char + ,nval_num + ,sourcesystem_cd + ,import_date + ,valueflag_cd + ,provider_id + ,location_cd + ,UNITS_CD + ,instance_num + ) + select distinct m.sample_id + ,m.concept_code + ,m.trial_name + ,'T' -- Text data type + ,'E' --Stands for Equals for Text Types + ,null -- not numeric for mRNA + ,m.trial_name + ,sysdate + ,'@' + ,'@' + ,'@' + ,'' -- no units available + ,1 + from de_subject_sample_mapping m + where m.trial_name = TrialID + and m.source_cd = sourceCd + and m.platform = 'SNP' + and m.patient_id != m.sample_id; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert sample facts into I2B2DEMODATA observation_fact',SQL%ROWCOUNT,stepCt,'Done'); + + commit; + + --Update I2b2 for correct data type + + update i2b2 t + set c_columndatatype = 'T', c_metadataxml = null, c_visualattributes='FA' + where t.c_basecode in (select distinct x.concept_cd from wt_mrna_nodes x); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Initialize data_type and xml in i2b2',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + + + + + + + + + update i2b2 + SET c_columndatatype = 'N', + --Static XML String + c_metadataxml = '3.0208/14/2008 01:22:59PosFloatY00100100100ratio' + where c_basecode IN ( + select xd.concept_cd + from wt_mrna_nodes xd + ,observation_fact xf + where xf.concept_cd = xd.concept_cd + group by xd.concept_Cd + having Max(xf.valtype_cd) = 'N'); + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Update c_columndatatype and c_metadataxml for numeric data types in I2B2METADATA i2b2',SQL%ROWCOUNT,stepCt,'Done'); + commit; + +/* + --UPDATE VISUAL ATTRIBUTES for Leaf Active (Default is folder) + update i2b2 a + set c_visualattributes = 'LA' + where 1 = ( + select count(*) + from i2b2 b + where b.c_fullname like (a.c_fullname || '%')) + and c_fullname like '%' || topNode || '%'; +*/ + + + + + --UPDATE VISUAL ATTRIBUTES for Leaf Active (Default is folder) + update i2b2 a + set c_visualattributes = 'LAH' + where a.c_basecode in (select distinct x.concept_code from de_subject_sample_mapping x + where x.trial_name = TrialId + and x.platform = 'SNP' + and x.concept_code is not null); + + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Update visual attributes for leaf nodes in I2B2METADATA i2b2',SQL%ROWCOUNT,stepCt,'Done'); + + COMMIT; + + --Build concept Counts + --Also marks any i2B2 records with no underlying data as Hidden, need to do at Trial level because there may be multiple platform and there is no longer + -- a unique top-level node for mRNA data + + i2b2_create_concept_counts(topNode ,jobID ); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Create concept counts',0,stepCt,'Done'); + + -- delete each node that is hidden + + FOR r_delNodes in delNodes Loop + + -- deletes hidden nodes for a trial one at a time + + i2b2_delete_1_node(r_delNodes.c_fullname); + stepCt := stepCt + 1; + tText := 'Deleted node: ' || r_delNodes.c_fullname; + + cz_write_audit(jobId,databaseName,procedureName,tText,SQL%ROWCOUNT,stepCt,'Done'); + + END LOOP; + + --Reload Security: Inserts one record for every I2B2 record into the security table + + + i2b2_load_security_data(jobId); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Load security data',0,stepCt,'Done'); + + delete from deapp.de_snp_calls_by_gsm + where patient_num in ( + select omic_patient_id + from deapp.de_subject_sample_mapping + where trial_name = TrialID + ); + + commit; + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Truncated de_snp_calls_by_gsm',0,stepCt,'Done'); + + delete from deapp.de_snp_copy_number + where patient_num in ( + select omic_patient_id + from deapp.de_subject_sample_mapping + where trial_name = TrialID + ); + + commit; + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Truncated de_snp_copy_number',0,stepCt,'Done'); + + insert into deapp.DE_SNP_CALLS_BY_GSM + (gsm_num, snp_name, snp_calls, patient_num) + select ltscbg.gsm_num, ltscbg.snp_name, ltscbg.snp_calls, sm.omic_patient_id from + tm_lz.lt_snp_calls_by_gsm ltscbg + inner join deapp.de_subject_sample_mapping sm + on sm.sample_cd = ltscbg.gsm_num + where sm.trial_name = TrialID; + commit; + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Inserting into DE_SNP_CALLS_BY_GSM',0,stepCt,'Done'); + + insert into deapp.DE_SNP_COPY_NUMBER + (snp_name, chrom, chrom_pos, copy_number, patient_num) + select lscn.snp_name, lscn.chrom, lscn.chrom_pos, power(2, lscn.copy_number) as copy_number, sm.omic_patient_id as patient_num from + tm_lz.LT_SNP_COPY_NUMBER lscn + inner join deapp.de_subject_sample_mapping sm + on sm.sample_cd = lscn.gsm_num + where sm.trial_name = TrialID; + commit; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Inserting into de_snp_copy_number',0,stepCt,'Done'); + + execute immediate ('truncate table tm_lz.lt_src_mrna_data'); + commit; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'trancated lt_src_mrna_data',0,stepCt,'Done'); + + insert into tm_lz.lt_src_mrna_data + (expr_id, probeset, intensity_value) + select gsm_num, snp_name, copy_number + from tm_lz.lt_snp_copy_number; + commit; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Inserting into lt_src_mrna_data',0,stepCt,'Done'); + + + + +-- tag data with probeset_id from reference.probeset_deapp + + execute immediate ('truncate table tm_wz.wt_subject_mrna_probeset'); + + -- note: assay_id represents a unique subject/site/sample + + + + insert into wt_subject_mrna_probeset + (probeset_id +-- ,expr_id + ,intensity_value + + ,patient_id +-- ,sample_cd +-- ,subject_id + ,trial_name + ,assay_id + ) + select gs.probeset_id +-- ,sd.sample_cd + ,cast(avg(cast (md.intensity_value as number(30,20))) as number) as aiv -- temporary fix to avoid overflow in some cases, need to address this properly by changing staging tables + + ,sd.patient_id +-- ,sd.sample_cd +-- ,sd.subject_id + ,TrialId + ,sd.assay_id + from de_subject_sample_mapping sd + ,lt_src_mrna_data md + ,probeset_deapp gs + + where sd.sample_cd = md.expr_id + and sd.platform = 'SNP' + and sd.trial_name = TrialId + and sd.source_cd = sourceCd + + + and sd.gpl_id = gs.platform + and md.probeset = gs.probeset + and decode(dataType,'R',sign(md.intensity_value),1) = 1 -- take only >0 for dataType R + group by gs.probeset_id + -- ,sd.sample_cd + ,sd.patient_id + -- ,sd.sample_cd + -- ,sd.subject_id + ,sd.assay_id; + + pExists := SQL%ROWCOUNT; + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert into DEAPP wt_subject_mrna_probeset',SQL%ROWCOUNT,stepCt,'Done'); + + commit; + + + if pExists = 0 then + raise no_probeset_recs; + end if; + + -- insert into de_subject_microarray_data when dataType is T (transformed) + + if dataType = 'T' then + insert into de_subject_microarray_data + (trial_source + ,probeset_id + ,assay_id + ,patient_id + --,sample_id + --,subject_id + ,trial_name + ,zscore + ) + select TrialId || ':' || sourceCd + ,probeset_id + ,assay_id + ,patient_id + --,sample_id + --,subject_id + ,trial_name + ,case when intensity_value < -2.5 + then -2.5 + when intensity_value > 2.5 + then 2.5 + else intensity_value + end as zscore + from wt_subject_mrna_probeset + where trial_name = TrialID; + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert transformed into DEAPP de_subject_microarray_data',SQL%ROWCOUNT,stepCt,'Done'); + + commit; + else + -- insert into de_subject_microarray_data when dataType is T (transformed) + + + if dataType = 'Z' then + insert into de_subject_microarray_data + (trial_source + ,probeset_id + ,assay_id + ,patient_id + --,sample_id + --,subject_id + ,TRIAL_NAME + ,log_intensity + ,zscore + + ) + select TrialId || ':' || sourceCd + ,probeset_id + ,assay_id + ,patient_id + --,sample_id + --,subject_id + ,TRIAL_NAME + ,intensity_value + ,case when intensity_value < -2.5 + + then -2.5 + when intensity_value > 2.5 + then 2.5 + else intensity_value + end as zscore + from wt_subject_mrna_probeset + where trial_name = TrialID; + STEPCT := STEPCT + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert transformed (workaround) into DEAPP de_subject_microarray_data',SQL%ROWCOUNT,stepCt,'Done'); + + + commit; + else + -- Calculate ZScores and insert data into de_subject_microarray_data. The 'L' parameter indicates that the gene expression data will be selected from + -- wt_subject_mrna_probeset as part of a Load. + + + if dataType = 'R' or dataType = 'L' then + i2b2_mrna_zscore_calc(TrialID,'L',jobId,dataType,logBase,sourceCD); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Calculate Z-Score',0,stepCt,'Done'); + commit; + + end if; + + end if; +end if; + + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'End i2b2_process_snp_data',0,stepCt,'Done'); + + IF newJobFlag = 1 + THEN + cz_end_audit (jobID, 'SUCCESS'); + END IF; + + + select 0 into rtn_code from dual; + + + EXCEPTION + --when unmapped_patients then + -- cz_write_audit(jobId,databasename,procedurename,'No site_id/subject_id mapped to patient_dimension',1,stepCt,'ERROR'); + -- cz_error_handler(jobid,procedurename); + -- cz_end_audit (jobId,'FAIL'); + when missing_platform then + cz_write_audit(jobId,databasename,procedurename,'Platform data missing from one or more subject_sample mapping records',1,stepCt,'ERROR'); + cz_error_handler(jobid,procedurename); + cz_end_audit (jobId,'FAIL'); + select 16 into rtn_code from dual; + when missing_tissue then + cz_write_audit(jobId,databasename,procedurename,'Tissue Type data missing from one or more subject_sample mapping records',1,stepCt,'ERROR'); + cz_error_handler(jobid,procedurename); + CZ_END_AUDIT (JOBID,'FAIL'); + select 16 into rtn_code from dual; + when unmapped_platform then + cz_write_audit(jobId,databasename,procedurename,'Platform not found in de_mrna_annotation',1,stepCt,'ERROR'); + CZ_ERROR_HANDLER(JOBID,PROCEDURENAME); + cz_end_audit (jobId,'FAIL'); + select 16 into rtn_code from dual; + when multiple_platform then + cz_write_audit(jobId,databasename,procedurename,'Multiple platforms for sample_cd in lt_src_mrna_subj_samp_map',1,stepCt,'ERROR'); + CZ_ERROR_HANDLER(JOBID,PROCEDURENAME); + cz_end_audit (jobId,'FAIL'); + select 16 into rtn_code from dual; + when no_probeset_recs then + cz_write_audit(jobId,databasename,procedurename,'Unable to match probesets to platform in probeset_deapp',1,stepCt,'ERROR'); + CZ_ERROR_HANDLER(JOBID,PROCEDURENAME); + cz_end_audit (jobId,'FAIL'); + select 16 into rtn_code from dual; + WHEN OTHERS THEN + --Handle errors. + cz_error_handler (jobID, procedureName); + --End Proc + cz_end_audit (jobID, 'FAIL'); + select 16 into rtn_code from dual; +END; +/ diff --git a/ddl/oracle/tm_cz/procedures/partition_gwas_data.sql b/ddl/oracle/tm_cz/procedures/partition_gwas_data.sql new file mode 100644 index 00000000..21e74282 --- /dev/null +++ b/ddl/oracle/tm_cz/procedures/partition_gwas_data.sql @@ -0,0 +1,112 @@ +-- +-- Type: PROCEDURE; Owner: TM_CZ; Name: PARTITION_GWAS_DATA +-- + CREATE OR REPLACE EDITIONABLE PROCEDURE "TM_CZ"."PARTITION_GWAS_DATA" +AS + + sqlText varchar2(1000); + tText varchar2(1000); + pExists number; + + --Audit variables + newJobFlag INTEGER(1); + databaseName VARCHAR(100); + procedureName VARCHAR(100); + jobID number(18,0); + stepCt number(18,0); + +BEGIN + + --Set Audit Parameters + newJobFlag := 0; -- False (Default) + jobID := -1; + + SELECT sys_context('USERENV', 'CURRENT_SCHEMA') INTO databaseName FROM dual; + procedureName := $$PLSQL_UNIT; + + --Audit JOB Initialization + --If Job ID does not exist, then this is a single procedure run and we need to create it + IF(jobID IS NULL or jobID < 1) + THEN + newJobFlag := 1; -- True + cz_start_audit (procedureName, databaseName, jobID); + END IF; + + for gwas_data in (select distinct bio_assay_analysis_id from biomart.bio_assay_analysis_gwas ) + loop + + stepCt := 0; + stepCt := stepCt + 1; + tText := 'Starting load for ' || to_char(gwas_data.bio_assay_analysis_id); + cz_write_audit(jobId,databaseName,procedureName,tText,0,stepCt,'Done'); + + -- Create partition in gwas_partition if it doesn't exist else truncate partition + + select count(*) + into pExists + from all_tab_partitions + where table_name = 'GWAS_PARTITION' + and partition_name = to_char(gwas_data.bio_assay_analysis_id); + + if pExists = 0 then + -- needed to add partition to GWAS_PARTITION + + sqlText := 'alter table biomart.GWAS_PARTITION add PARTITION "' || to_char(gwas_data.bio_assay_analysis_id) || '" VALUES (' || + to_char(gwas_data.bio_assay_analysis_id) || ') ' || + 'NOLOGGING TABLESPACE "BIOMART" '; + execute immediate(sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Adding partition to GWAS_PARTITION',0,stepCt,'Done'); + + else + sqlText := 'alter table biomart.GWAS_PARTITION truncate partition "' || to_char(gwas_data.bio_assay_analysis_id) || '"'; + execute immediate(sqlText); + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Truncating partition in GWAS_PARTITION',0,stepCt,'Done'); + end if; + + insert into biomart.GWAS_PARTITION + (bio_asy_analysis_gwas_id + ,bio_assay_analysis_id + ,rs_id + ,p_value_char + ,p_value + ,log_p_value + ,etl_id + ,ext_data + ) + select g.bio_asy_analysis_gwas_id + ,g.bio_assay_analysis_id + ,g.rs_id + ,g.p_value_char + ,g.p_value + ,g.log_p_value + ,g.etl_id + ,g.ext_data + from biomart.bio_assay_analysis_gwas g + where g.bio_assay_analysis_id = gwas_data.bio_assay_analysis_id; + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,'Insert data for analysis into GWAS_PARTITION',SQL%ROWCOUNT,stepCt,'Done'); + commit; + + end loop; + + ---Cleanup OVERALL JOB if this proc is being run standalone + + stepCt := stepCt + 1; + cz_write_audit(jobId,databaseName,procedureName,procedureName,0,stepCt,'Done'); + + IF newJobFlag = 1 + THEN + cz_end_audit (jobID, 'SUCCESS'); + END IF; + + EXCEPTION + WHEN OTHERS THEN + --Handle errors. + cz_error_handler (jobID, procedureName); + --End Proc + cz_end_audit (jobID, 'FAIL'); + --select 16 into rtn_code from dual; +END; +/ diff --git a/ddl/oracle/tm_cz/stg_rbm_antigen_gene.sql b/ddl/oracle/tm_cz/stg_rbm_antigen_gene.sql new file mode 100644 index 00000000..e1a5a25d --- /dev/null +++ b/ddl/oracle/tm_cz/stg_rbm_antigen_gene.sql @@ -0,0 +1,10 @@ +-- +-- Type: TABLE; Owner: TM_CZ; Name: STG_RBM_ANTIGEN_GENE +-- + CREATE TABLE "TM_CZ"."STG_RBM_ANTIGEN_GENE" + ( "ANTIGEN_NAME" VARCHAR2(255 BYTE), +"GENE_SYMBOL" VARCHAR2(100 BYTE), +"GENE_ID" VARCHAR2(100 BYTE) + ) SEGMENT CREATION DEFERRED +NOCOMPRESS LOGGING + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_cz/stg_subject_rbm_data.sql b/ddl/oracle/tm_cz/stg_subject_rbm_data.sql new file mode 100644 index 00000000..01c51056 --- /dev/null +++ b/ddl/oracle/tm_cz/stg_subject_rbm_data.sql @@ -0,0 +1,16 @@ +-- +-- Type: TABLE; Owner: TM_CZ; Name: STG_SUBJECT_RBM_DATA +-- + CREATE TABLE "TM_CZ"."STG_SUBJECT_RBM_DATA" + ( "TRIAL_NAME" VARCHAR2(100 BYTE), +"ANTIGEN_NAME" VARCHAR2(100 BYTE), +"VALUE_TEXT" VARCHAR2(100 BYTE), +"VALUE_NUMBER" NUMBER, +"TIMEPOINT" VARCHAR2(100 BYTE), +"ASSAY_ID" VARCHAR2(100 BYTE), +"SAMPLE_ID" VARCHAR2(100 BYTE), +"SUBJECT_ID" VARCHAR2(100 BYTE), +"SITE_ID" VARCHAR2(100 BYTE) + ) SEGMENT CREATION DEFERRED +NOCOMPRESS LOGGING + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_cz/stg_subject_rbm_data_raw.sql b/ddl/oracle/tm_cz/stg_subject_rbm_data_raw.sql new file mode 100644 index 00000000..94cd1f8c --- /dev/null +++ b/ddl/oracle/tm_cz/stg_subject_rbm_data_raw.sql @@ -0,0 +1,16 @@ +-- +-- Type: TABLE; Owner: TM_CZ; Name: STG_SUBJECT_RBM_DATA_RAW +-- + CREATE TABLE "TM_CZ"."STG_SUBJECT_RBM_DATA_RAW" + ( "TRIAL_NAME" VARCHAR2(100 BYTE), +"ANTIGEN_NAME" VARCHAR2(100 BYTE), +"VALUE_TEXT" VARCHAR2(100 BYTE), +"VALUE_NUMBER" NUMBER, +"TIMEPOINT" VARCHAR2(100 BYTE), +"ASSAY_ID" VARCHAR2(100 BYTE), +"SAMPLE_ID" VARCHAR2(100 BYTE), +"SUBJECT_ID" VARCHAR2(100 BYTE), +"SITE_ID" VARCHAR2(100 BYTE) + ) SEGMENT CREATION DEFERRED +NOCOMPRESS LOGGING + TABLESPACE "TRANSMART" ; diff --git a/ddl/oracle/tm_cz/tmp_subject_info.sql b/ddl/oracle/tm_cz/tmp_subject_info.sql index 7dae0263..b1cb450c 100644 --- a/ddl/oracle/tm_cz/tmp_subject_info.sql +++ b/ddl/oracle/tm_cz/tmp_subject_info.sql @@ -9,3 +9,9 @@ ) SEGMENT CREATION IMMEDIATE TABLESPACE "TRANSMART" ; +-- +-- Type: INDEX; Owner: TM_CZ; Name: IDX_TMP_SUBJ_USUBJID +-- +CREATE INDEX "TM_CZ"."IDX_TMP_SUBJ_USUBJID" ON "TM_CZ"."TMP_SUBJECT_INFO" ("USUBJID") +TABLESPACE "TRANSMART" ; + diff --git a/ddl/oracle/tm_cz/views/patient_info.sql b/ddl/oracle/tm_cz/views/patient_info.sql new file mode 100644 index 00000000..6167edf2 --- /dev/null +++ b/ddl/oracle/tm_cz/views/patient_info.sql @@ -0,0 +1,6 @@ +-- +-- Type: VIEW; Owner: TM_CZ; Name: PATIENT_INFO +-- +CREATE OR REPLACE FORCE EDITIONABLE VIEW "TM_CZ"."PATIENT_INFO" ("STUDY_ID", "SUBJECT_ID", "SITE_ID", "USUBJID") AS +select TRIAL_NAME as STUDY_ID, SUBJECT_ID, SITE_ID, REGEXP_REPLACE(TRIAL_NAME || ':' || SITE_ID || ':' || SUBJECT_ID, + '(::){1,}', ':') as usubjid from tm_cz.stg_subject_rbm_data; From 93a739a10ff21efb65fcfa780ee9ae9eb74dd92b Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Tue, 12 Aug 2014 13:37:07 +0100 Subject: [PATCH 29/31] user roles updated from oracle test server --- ddl/oracle/GLOBAL/amapp.sql | 55 ++------ ddl/oracle/GLOBAL/biomart.sql | 25 +--- ddl/oracle/GLOBAL/biomart_stage.sql | 25 +--- ddl/oracle/GLOBAL/biomart_user.sql | 44 +----- ddl/oracle/GLOBAL/deapp.sql | 210 ++++++++++++++++++++++++---- ddl/oracle/GLOBAL/fmapp.sql | 48 +------ ddl/oracle/GLOBAL/i2b2demodata.sql | 48 +------ ddl/oracle/GLOBAL/i2b2metadata.sql | 48 +------ ddl/oracle/GLOBAL/searchapp.sql | 48 +------ ddl/oracle/GLOBAL/tm_cz.sql | 204 +++++++++++++++++++++++---- ddl/oracle/GLOBAL/tm_lz.sql | 47 +------ ddl/oracle/GLOBAL/tm_wz.sql | 47 +------ 12 files changed, 396 insertions(+), 453 deletions(-) diff --git a/ddl/oracle/GLOBAL/amapp.sql b/ddl/oracle/GLOBAL/amapp.sql index 9bf64634..b8eb019c 100644 --- a/ddl/oracle/GLOBAL/amapp.sql +++ b/ddl/oracle/GLOBAL/amapp.sql @@ -4,55 +4,24 @@ CREATE USER "AMAPP" IDENTIFIED BY VALUES 'S:9571FFB20AE27E19978ABB02101BD2F2057143B93D977AC576CC50197513;02955D58870FE54F' DEFAULT TABLESPACE "TRANSMART" TEMPORARY TABLESPACE "TEMP"; - -- -- Type: ROLE_GRANT; Name: AMAPP -- -- -- Type: TABLESPACE_QUOTA; Name: AMAPP -- - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "AMAPP" QUOTA UNLIMITED ON "TRANSMART"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''TRANSMART'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "AMAPP" QUOTA UNLIMITED ON "INDX"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''INDX'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - -- -- Type: SYSTEM_GRANT; Name: AMAPP -- +GRANT GLOBAL QUERY REWRITE TO "AMAPP" WITH ADMIN OPTION; +GRANT QUERY REWRITE TO "AMAPP" WITH ADMIN OPTION; +GRANT DROP ANY MATERIALIZED VIEW TO "AMAPP" WITH ADMIN OPTION; +GRANT ALTER ANY MATERIALIZED VIEW TO "AMAPP" WITH ADMIN OPTION; +GRANT CREATE ANY MATERIALIZED VIEW TO "AMAPP" WITH ADMIN OPTION; +GRANT CREATE TRIGGER TO "AMAPP"; +GRANT CREATE PROCEDURE TO "AMAPP"; +GRANT CREATE VIEW TO "AMAPP"; +GRANT SELECT ANY TABLE TO "AMAPP"; +GRANT CREATE TABLE TO "AMAPP"; +GRANT UNLIMITED TABLESPACE TO "AMAPP"; +GRANT CREATE SESSION TO "AMAPP"; diff --git a/ddl/oracle/GLOBAL/biomart.sql b/ddl/oracle/GLOBAL/biomart.sql index 50d9bd54..f4b9d511 100644 --- a/ddl/oracle/GLOBAL/biomart.sql +++ b/ddl/oracle/GLOBAL/biomart.sql @@ -4,31 +4,9 @@ CREATE USER "BIOMART" IDENTIFIED BY VALUES 'S:AC6B55347D02816D681B481FB130C75B6334E91A6B9AC3EE02B5D80AB4B0;EE8EC2CF8301F8AE' DEFAULT TABLESPACE "TRANSMART" TEMPORARY TABLESPACE "TEMP"; - -- -- Type: TABLESPACE_QUOTA; Name: BIOMART -- - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "BIOMART" QUOTA UNLIMITED ON "INDX"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''INDX'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - DECLARE TEMP_COUNT NUMBER; SQLSTR VARCHAR2(200); @@ -50,15 +28,18 @@ EXCEPTION END; / + -- -- Type: ROLE_GRANT; Name: BIOMART -- GRANT "CONNECT" TO "BIOMART"; GRANT "RESOURCE" TO "BIOMART"; +GRANT "DBA" TO "BIOMART"; -- -- Type: SYSTEM_GRANT; Name: BIOMART -- GRANT CREATE TABLE TO "BIOMART"; +GRANT UNLIMITED TABLESPACE TO "BIOMART"; diff --git a/ddl/oracle/GLOBAL/biomart_stage.sql b/ddl/oracle/GLOBAL/biomart_stage.sql index baa41c68..b4a0b021 100644 --- a/ddl/oracle/GLOBAL/biomart_stage.sql +++ b/ddl/oracle/GLOBAL/biomart_stage.sql @@ -4,7 +4,6 @@ CREATE USER "BIOMART_STAGE" IDENTIFIED BY VALUES 'S:FA2819401185E87BB34E022CB387A6B2D56735660A55BF2E96FF9621D7C8;0AF103800E386834' DEFAULT TABLESPACE "TRANSMART" TEMPORARY TABLESPACE "TEMP"; - -- -- Type: TABLESPACE_QUOTA; Name: BIOMART_STAGE -- @@ -29,36 +28,16 @@ EXCEPTION END; / - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "BIOMART_STAGE" QUOTA UNLIMITED ON "INDX"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''INDX'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ -- -- Type: SYSTEM_GRANT; Name: BIOMART_STAGE -- +GRANT UNLIMITED TABLESPACE TO "BIOMART_STAGE"; + -- -- Type: ROLE_GRANT; Name: BIOMART_STAGE -- GRANT "CONNECT" TO "BIOMART_STAGE"; GRANT "RESOURCE" TO "BIOMART_STAGE"; - GRANT "DBA" TO "BIOMART_STAGE"; - diff --git a/ddl/oracle/GLOBAL/biomart_user.sql b/ddl/oracle/GLOBAL/biomart_user.sql index d2aa0da7..98b6c63b 100644 --- a/ddl/oracle/GLOBAL/biomart_user.sql +++ b/ddl/oracle/GLOBAL/biomart_user.sql @@ -12,51 +12,11 @@ GRANT "CONNECT" TO "BIOMART_USER"; GRANT "RESOURCE" TO "BIOMART_USER"; +GRANT "DBA" TO "BIOMART_USER"; -- -- Type: TABLESPACE_QUOTA; Name: BIOMART_USER -- - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "BIOMART_USER" QUOTA UNLIMITED ON "TRANSMART"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''TRANSMART'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "BIOMART_USER" QUOTA UNLIMITED ON "INDX"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''INDX'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - -- -- Type: SYSTEM_GRANT; Name: BIOMART_USER -- +GRANT UNLIMITED TABLESPACE TO "BIOMART_USER"; diff --git a/ddl/oracle/GLOBAL/deapp.sql b/ddl/oracle/GLOBAL/deapp.sql index 2567fc11..df2237d1 100644 --- a/ddl/oracle/GLOBAL/deapp.sql +++ b/ddl/oracle/GLOBAL/deapp.sql @@ -4,17 +4,200 @@ CREATE USER "DEAPP" IDENTIFIED BY VALUES 'S:499EBB6329A6A236B428E5AEB991C06E27856F29A3480065D019B36F570E;9F7EF5372B0017FD' DEFAULT TABLESPACE "TRANSMART" TEMPORARY TABLESPACE "TEMP"; - -- -- Type: SYSTEM_GRANT; Name: DEAPP -- +GRANT FLASHBACK ARCHIVE ADMINISTER TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER DATABASE LINK TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER PUBLIC DATABASE LINK TO "DEAPP" WITH ADMIN OPTION; +GRANT ADMINISTER SQL MANAGEMENT OBJECT TO "DEAPP" WITH ADMIN OPTION; +GRANT UPDATE ANY CUBE DIMENSION TO "DEAPP" WITH ADMIN OPTION; +GRANT UPDATE ANY CUBE BUILD PROCESS TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY CUBE BUILD PROCESS TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY CUBE BUILD PROCESS TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE CUBE BUILD PROCESS TO "DEAPP" WITH ADMIN OPTION; +GRANT INSERT ANY MEASURE FOLDER TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY MEASURE FOLDER TO "DEAPP" WITH ADMIN OPTION; +GRANT DELETE ANY MEASURE FOLDER TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY MEASURE FOLDER TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE MEASURE FOLDER TO "DEAPP" WITH ADMIN OPTION; +GRANT UPDATE ANY CUBE TO "DEAPP" WITH ADMIN OPTION; +GRANT SELECT ANY CUBE TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY CUBE TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY CUBE TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY CUBE TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE CUBE TO "DEAPP" WITH ADMIN OPTION; +GRANT SELECT ANY CUBE DIMENSION TO "DEAPP" WITH ADMIN OPTION; +GRANT INSERT ANY CUBE DIMENSION TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY CUBE DIMENSION TO "DEAPP" WITH ADMIN OPTION; +GRANT DELETE ANY CUBE DIMENSION TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY CUBE DIMENSION TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY CUBE DIMENSION TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE CUBE DIMENSION TO "DEAPP" WITH ADMIN OPTION; +GRANT COMMENT ANY MINING MODEL TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY MINING MODEL TO "DEAPP" WITH ADMIN OPTION; +GRANT SELECT ANY MINING MODEL TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY MINING MODEL TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY MINING MODEL TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE MINING MODEL TO "DEAPP" WITH ADMIN OPTION; +GRANT EXECUTE ASSEMBLY TO "DEAPP" WITH ADMIN OPTION; +GRANT EXECUTE ANY ASSEMBLY TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY ASSEMBLY TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY ASSEMBLY TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY ASSEMBLY TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ASSEMBLY TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY EDITION TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY EDITION TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY EDITION TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE EXTERNAL JOB TO "DEAPP" WITH ADMIN OPTION; +GRANT CHANGE NOTIFICATION TO "DEAPP" WITH ADMIN OPTION; +GRANT EXEMPT IDENTITY POLICY TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY SQL PROFILE TO "DEAPP" WITH ADMIN OPTION; +GRANT ADMINISTER ANY SQL TUNING SET TO "DEAPP" WITH ADMIN OPTION; +GRANT ADMINISTER SQL TUNING SET TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY SQL PROFILE TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY SQL PROFILE TO "DEAPP" WITH ADMIN OPTION; +GRANT SELECT ANY TRANSACTION TO "DEAPP" WITH ADMIN OPTION; +GRANT MANAGE SCHEDULER TO "DEAPP" WITH ADMIN OPTION; +GRANT EXECUTE ANY CLASS TO "DEAPP" WITH ADMIN OPTION; +GRANT EXECUTE ANY PROGRAM TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY JOB TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE JOB TO "DEAPP" WITH ADMIN OPTION; +GRANT ADVISOR TO "DEAPP" WITH ADMIN OPTION; +GRANT ANALYZE ANY DICTIONARY TO "DEAPP" WITH ADMIN OPTION; +GRANT IMPORT FULL DATABASE TO "DEAPP" WITH ADMIN OPTION; +GRANT EXPORT FULL DATABASE TO "DEAPP" WITH ADMIN OPTION; +GRANT GRANT ANY OBJECT PRIVILEGE TO "DEAPP" WITH ADMIN OPTION; +GRANT FLASHBACK ANY TABLE TO "DEAPP" WITH ADMIN OPTION; +GRANT DEBUG ANY PROCEDURE TO "DEAPP" WITH ADMIN OPTION; +GRANT DEBUG CONNECT SESSION TO "DEAPP" WITH ADMIN OPTION; +GRANT SELECT ANY DICTIONARY TO "DEAPP" WITH ADMIN OPTION; +GRANT RESUMABLE TO "DEAPP" WITH ADMIN OPTION; +GRANT EXEMPT ACCESS POLICY TO "DEAPP" WITH ADMIN OPTION; +GRANT ON COMMIT REFRESH TO "DEAPP" WITH ADMIN OPTION; +GRANT MERGE ANY VIEW TO "DEAPP" WITH ADMIN OPTION; +GRANT ADMINISTER DATABASE TRIGGER TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY OUTLINE TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY OUTLINE TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY OUTLINE TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY CONTEXT TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY CONTEXT TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY DIMENSION TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY DIMENSION TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY DIMENSION TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE DIMENSION TO "DEAPP" WITH ADMIN OPTION; +GRANT UNDER ANY TABLE TO "DEAPP" WITH ADMIN OPTION; +GRANT EXECUTE ANY INDEXTYPE TO "DEAPP" WITH ADMIN OPTION; +GRANT GLOBAL QUERY REWRITE TO "DEAPP" WITH ADMIN OPTION; +GRANT QUERY REWRITE TO "DEAPP" WITH ADMIN OPTION; +GRANT UNDER ANY VIEW TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY INDEXTYPE TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY INDEXTYPE TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY INDEXTYPE TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE INDEXTYPE TO "DEAPP" WITH ADMIN OPTION; +GRANT EXECUTE ANY OPERATOR TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY OPERATOR TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY OPERATOR TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY OPERATOR TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE OPERATOR TO "DEAPP" WITH ADMIN OPTION; +GRANT EXECUTE ANY LIBRARY TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY LIBRARY TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY LIBRARY TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY LIBRARY TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE LIBRARY TO "DEAPP" WITH ADMIN OPTION; +GRANT UNDER ANY TYPE TO "DEAPP" WITH ADMIN OPTION; +GRANT EXECUTE ANY TYPE TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY TYPE TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY TYPE TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY TYPE TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE TYPE TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY DIRECTORY TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY DIRECTORY TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY MATERIALIZED VIEW TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY MATERIALIZED VIEW TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY MATERIALIZED VIEW TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE MATERIALIZED VIEW TO "DEAPP" WITH ADMIN OPTION; + +GRANT GRANT ANY PRIVILEGE TO "DEAPP" WITH ADMIN OPTION; +GRANT ANALYZE ANY TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER RESOURCE COST TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP PROFILE TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER PROFILE TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE PROFILE TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY TRIGGER TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY TRIGGER TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY TRIGGER TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE TRIGGER TO "DEAPP" WITH ADMIN OPTION; +GRANT EXECUTE ANY PROCEDURE TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY PROCEDURE TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY PROCEDURE TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY PROCEDURE TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE PROCEDURE TO "DEAPP" WITH ADMIN OPTION; +GRANT FORCE ANY TRANSACTION TO "DEAPP" WITH ADMIN OPTION; +GRANT FORCE TRANSACTION TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER DATABASE TO "DEAPP" WITH ADMIN OPTION; +GRANT AUDIT ANY TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY ROLE TO "DEAPP" WITH ADMIN OPTION; +GRANT GRANT ANY ROLE TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY ROLE TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ROLE TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP PUBLIC DATABASE LINK TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE PUBLIC DATABASE LINK TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE DATABASE LINK TO "DEAPP" WITH ADMIN OPTION; +GRANT SELECT ANY SEQUENCE TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY SEQUENCE TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY SEQUENCE TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY SEQUENCE TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE SEQUENCE TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY VIEW TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY VIEW TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE VIEW TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP PUBLIC SYNONYM TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE PUBLIC SYNONYM TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY SYNONYM TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY SYNONYM TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE SYNONYM TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY INDEX TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY INDEX TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY INDEX TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY CLUSTER TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY CLUSTER TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY CLUSTER TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE CLUSTER TO "DEAPP" WITH ADMIN OPTION; +GRANT DELETE ANY TABLE TO "DEAPP" WITH ADMIN OPTION; +GRANT UPDATE ANY TABLE TO "DEAPP" WITH ADMIN OPTION; +GRANT INSERT ANY TABLE TO "DEAPP" WITH ADMIN OPTION; +GRANT SELECT ANY TABLE TO "DEAPP" WITH ADMIN OPTION; +GRANT COMMENT ANY TABLE TO "DEAPP" WITH ADMIN OPTION; +GRANT LOCK ANY TABLE TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ANY TABLE TO "DEAPP" WITH ADMIN OPTION; +GRANT BACKUP ANY TABLE TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ANY TABLE TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ANY TABLE TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE TABLE TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP ROLLBACK SEGMENT TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER ROLLBACK SEGMENT TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE ROLLBACK SEGMENT TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP USER TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER USER TO "DEAPP" WITH ADMIN OPTION; +GRANT BECOME USER TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE USER TO "DEAPP" WITH ADMIN OPTION; +GRANT UNLIMITED TABLESPACE TO "DEAPP" WITH ADMIN OPTION; +GRANT DROP TABLESPACE TO "DEAPP" WITH ADMIN OPTION; +GRANT MANAGE TABLESPACE TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER TABLESPACE TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE TABLESPACE TO "DEAPP" WITH ADMIN OPTION; +GRANT RESTRICTED SESSION TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER SESSION TO "DEAPP" WITH ADMIN OPTION; +GRANT CREATE SESSION TO "DEAPP" WITH ADMIN OPTION; +GRANT AUDIT SYSTEM TO "DEAPP" WITH ADMIN OPTION; +GRANT ALTER SYSTEM TO "DEAPP" WITH ADMIN OPTION; -- -- Type: ROLE_GRANT; Name: DEAPP -- GRANT "CONNECT" TO "DEAPP"; - GRANT "RESOURCE" TO "DEAPP"; - +GRANT "DBA" TO "DEAPP"; -- -- Type: TABLESPACE_QUOTA; Name: DEAPP -- @@ -37,26 +220,5 @@ EXCEPTION RAISE; END IF; END; -/ - - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "DEAPP" QUOTA UNLIMITED ON "INDX"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''INDX'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; / diff --git a/ddl/oracle/GLOBAL/fmapp.sql b/ddl/oracle/GLOBAL/fmapp.sql index 7a55335b..16d86c35 100644 --- a/ddl/oracle/GLOBAL/fmapp.sql +++ b/ddl/oracle/GLOBAL/fmapp.sql @@ -4,7 +4,6 @@ CREATE USER "FMAPP" IDENTIFIED BY VALUES 'S:2AFD1E3EB1A960DE3051FCAEEF5E3AEB06302157ADD0D3240063327453F3;D684DB54467F1F56' DEFAULT TABLESPACE "TRANSMART" TEMPORARY TABLESPACE "TEMP"; - -- -- Type: ROLE_GRANT; Name: FMAPP -- @@ -12,55 +11,10 @@ CREATE USER "FMAPP" IDENTIFIED BY VALUES 'S:2AFD1E3EB1A960DE3051FCAEEF5E3AEB0630 -- Type: SYSTEM_GRANT; Name: FMAPP -- GRANT CREATE TRIGGER TO "FMAPP"; - GRANT CREATE PROCEDURE TO "FMAPP"; - GRANT CREATE TABLE TO "FMAPP"; - +GRANT UNLIMITED TABLESPACE TO "FMAPP"; GRANT CREATE SESSION TO "FMAPP"; - -- -- Type: TABLESPACE_QUOTA; Name: FMAPP -- - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "FMAPP" QUOTA UNLIMITED ON "TRANSMART"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''TRANSMART'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "FMAPP" QUOTA UNLIMITED ON "INDX"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''INDX'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - diff --git a/ddl/oracle/GLOBAL/i2b2demodata.sql b/ddl/oracle/GLOBAL/i2b2demodata.sql index d1d950b8..7318da42 100644 --- a/ddl/oracle/GLOBAL/i2b2demodata.sql +++ b/ddl/oracle/GLOBAL/i2b2demodata.sql @@ -4,61 +4,17 @@ CREATE USER "I2B2DEMODATA" IDENTIFIED BY VALUES 'S:00C945EB67B2A497CD615FA4D750635389749696075B29F80E2E3E474C71;4EE49A6D1DE00414' DEFAULT TABLESPACE "TRANSMART" TEMPORARY TABLESPACE "TEMP"; - -- -- Type: SYSTEM_GRANT; Name: I2B2DEMODATA -- +GRANT UNLIMITED TABLESPACE TO "I2B2DEMODATA"; GRANT CREATE SESSION TO "I2B2DEMODATA"; - -- -- Type: TABLESPACE_QUOTA; Name: I2B2DEMODATA -- - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "I2B2DEMODATA" QUOTA UNLIMITED ON "TRANSMART"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''TRANSMART'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "I2B2DEMODATA" QUOTA UNLIMITED ON "INDX"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''INDX'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - -- -- Type: ROLE_GRANT; Name: I2B2DEMODATA -- GRANT "CONNECT" TO "I2B2DEMODATA"; - GRANT "RESOURCE" TO "I2B2DEMODATA"; - +GRANT "DBA" TO "I2B2DEMODATA"; diff --git a/ddl/oracle/GLOBAL/i2b2metadata.sql b/ddl/oracle/GLOBAL/i2b2metadata.sql index 5bf7667c..8b34e91f 100644 --- a/ddl/oracle/GLOBAL/i2b2metadata.sql +++ b/ddl/oracle/GLOBAL/i2b2metadata.sql @@ -4,61 +4,17 @@ CREATE USER "I2B2METADATA" IDENTIFIED BY VALUES 'S:C73A8B4E8B2A62D16A9AB6BA9B9C5980E37D87D05BB946D1C222BEF89011;61AA7B443983457E' DEFAULT TABLESPACE "TRANSMART" TEMPORARY TABLESPACE "TEMP"; - -- -- Type: ROLE_GRANT; Name: I2B2METADATA -- GRANT "CONNECT" TO "I2B2METADATA"; - GRANT "RESOURCE" TO "I2B2METADATA"; - +GRANT "DBA" TO "I2B2METADATA"; -- -- Type: TABLESPACE_QUOTA; Name: I2B2METADATA -- - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "I2B2METADATA" QUOTA UNLIMITED ON "TRANSMART"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''TRANSMART'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "I2B2METADATA" QUOTA UNLIMITED ON "INDX"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''INDX'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - -- -- Type: SYSTEM_GRANT; Name: I2B2METADATA -- +GRANT UNLIMITED TABLESPACE TO "I2B2METADATA"; GRANT CREATE SESSION TO "I2B2METADATA"; - diff --git a/ddl/oracle/GLOBAL/searchapp.sql b/ddl/oracle/GLOBAL/searchapp.sql index b870560c..3148af49 100644 --- a/ddl/oracle/GLOBAL/searchapp.sql +++ b/ddl/oracle/GLOBAL/searchapp.sql @@ -10,8 +10,11 @@ CREATE USER "SEARCHAPP" IDENTIFIED BY VALUES 'S:57DA75ABEE5261239772396129231919 -- GRANT ON COMMIT REFRESH TO "SEARCHAPP"; -GRANT CREATE TABLE TO "SEARCHAPP"; +GRANT CREATE MATERIALIZED VIEW TO "SEARCHAPP"; + +GRANT CREATE TABLE TO "SEARCHAPP"; +GRANT UNLIMITED TABLESPACE TO "SEARCHAPP"; -- -- Type: ROLE_GRANT; Name: SEARCHAPP -- @@ -19,48 +22,7 @@ GRANT "CONNECT" TO "SEARCHAPP"; GRANT "RESOURCE" TO "SEARCHAPP"; +GRANT "DBA" TO "SEARCHAPP"; -- -- Type: TABLESPACE_QUOTA; Name: SEARCHAPP -- - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "SEARCHAPP" QUOTA UNLIMITED ON "TRANSMART"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''TRANSMART'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "SEARCHAPP" QUOTA UNLIMITED ON "INDX"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''INDX'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - diff --git a/ddl/oracle/GLOBAL/tm_cz.sql b/ddl/oracle/GLOBAL/tm_cz.sql index 9aabe669..549c4649 100644 --- a/ddl/oracle/GLOBAL/tm_cz.sql +++ b/ddl/oracle/GLOBAL/tm_cz.sql @@ -4,7 +4,6 @@ CREATE USER "TM_CZ" IDENTIFIED BY VALUES 'S:75081C84B645CEC6972544D98598A31EC0FC0EE20AD66BBF6A8C71430CA5;5DFF82A621539D10' DEFAULT TABLESPACE "TRANSMART" TEMPORARY TABLESPACE "TEMP"; - -- -- Type: TABLESPACE_QUOTA; Name: TM_CZ -- @@ -27,42 +26,193 @@ EXCEPTION RAISE; END IF; END; -/ - - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "TM_CZ" QUOTA UNLIMITED ON "TRANSMART"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''TRANSMART'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; / -- -- Type: SYSTEM_GRANT; Name: TM_CZ -- +GRANT FLASHBACK ARCHIVE ADMINISTER TO "TM_CZ"; +GRANT ADMINISTER SQL MANAGEMENT OBJECT TO "TM_CZ"; +GRANT UPDATE ANY CUBE DIMENSION TO "TM_CZ"; +GRANT UPDATE ANY CUBE BUILD PROCESS TO "TM_CZ"; +GRANT DROP ANY CUBE BUILD PROCESS TO "TM_CZ"; +GRANT CREATE ANY CUBE BUILD PROCESS TO "TM_CZ"; +GRANT CREATE CUBE BUILD PROCESS TO "TM_CZ"; +GRANT INSERT ANY MEASURE FOLDER TO "TM_CZ"; +GRANT DROP ANY MEASURE FOLDER TO "TM_CZ"; +GRANT DELETE ANY MEASURE FOLDER TO "TM_CZ"; +GRANT CREATE ANY MEASURE FOLDER TO "TM_CZ"; +GRANT CREATE MEASURE FOLDER TO "TM_CZ"; +GRANT UPDATE ANY CUBE TO "TM_CZ"; +GRANT SELECT ANY CUBE TO "TM_CZ"; +GRANT DROP ANY CUBE TO "TM_CZ"; +GRANT CREATE ANY CUBE TO "TM_CZ"; +GRANT ALTER ANY CUBE TO "TM_CZ"; +GRANT CREATE CUBE TO "TM_CZ"; +GRANT SELECT ANY CUBE DIMENSION TO "TM_CZ"; +GRANT INSERT ANY CUBE DIMENSION TO "TM_CZ"; +GRANT DROP ANY CUBE DIMENSION TO "TM_CZ"; +GRANT DELETE ANY CUBE DIMENSION TO "TM_CZ"; +GRANT CREATE ANY CUBE DIMENSION TO "TM_CZ"; +GRANT ALTER ANY CUBE DIMENSION TO "TM_CZ"; +GRANT CREATE CUBE DIMENSION TO "TM_CZ"; +GRANT COMMENT ANY MINING MODEL TO "TM_CZ"; +GRANT ALTER ANY MINING MODEL TO "TM_CZ"; +GRANT SELECT ANY MINING MODEL TO "TM_CZ"; +GRANT DROP ANY MINING MODEL TO "TM_CZ"; +GRANT CREATE ANY MINING MODEL TO "TM_CZ"; +GRANT CREATE MINING MODEL TO "TM_CZ"; +GRANT EXECUTE ASSEMBLY TO "TM_CZ"; +GRANT EXECUTE ANY ASSEMBLY TO "TM_CZ"; +GRANT DROP ANY ASSEMBLY TO "TM_CZ"; +GRANT ALTER ANY ASSEMBLY TO "TM_CZ"; +GRANT CREATE ANY ASSEMBLY TO "TM_CZ"; +GRANT CREATE ASSEMBLY TO "TM_CZ"; +GRANT ALTER ANY EDITION TO "TM_CZ"; +GRANT DROP ANY EDITION TO "TM_CZ"; +GRANT CREATE ANY EDITION TO "TM_CZ"; +GRANT CREATE EXTERNAL JOB TO "TM_CZ"; +GRANT CHANGE NOTIFICATION TO "TM_CZ"; +GRANT CREATE ANY SQL PROFILE TO "TM_CZ"; +GRANT ADMINISTER ANY SQL TUNING SET TO "TM_CZ"; +GRANT ADMINISTER SQL TUNING SET TO "TM_CZ"; +GRANT ALTER ANY SQL PROFILE TO "TM_CZ"; +GRANT DROP ANY SQL PROFILE TO "TM_CZ"; +GRANT SELECT ANY TRANSACTION TO "TM_CZ"; +GRANT MANAGE SCHEDULER TO "TM_CZ"; +GRANT EXECUTE ANY CLASS TO "TM_CZ"; +GRANT EXECUTE ANY PROGRAM TO "TM_CZ"; +GRANT CREATE ANY JOB TO "TM_CZ"; +GRANT CREATE JOB TO "TM_CZ"; +GRANT ADVISOR TO "TM_CZ"; +GRANT IMPORT FULL DATABASE TO "TM_CZ"; +GRANT EXPORT FULL DATABASE TO "TM_CZ"; +GRANT GRANT ANY OBJECT PRIVILEGE TO "TM_CZ"; +GRANT FLASHBACK ANY TABLE TO "TM_CZ"; +GRANT DEBUG ANY PROCEDURE TO "TM_CZ"; +GRANT DEBUG CONNECT SESSION TO "TM_CZ"; +GRANT RESUMABLE TO "TM_CZ"; +GRANT ON COMMIT REFRESH TO "TM_CZ"; +GRANT MERGE ANY VIEW TO "TM_CZ"; +GRANT ADMINISTER DATABASE TRIGGER TO "TM_CZ"; +GRANT DROP ANY OUTLINE TO "TM_CZ"; +GRANT ALTER ANY OUTLINE TO "TM_CZ"; +GRANT CREATE ANY OUTLINE TO "TM_CZ"; +GRANT DROP ANY CONTEXT TO "TM_CZ"; +GRANT CREATE ANY CONTEXT TO "TM_CZ"; +GRANT DROP ANY DIMENSION TO "TM_CZ"; +GRANT ALTER ANY DIMENSION TO "TM_CZ"; +GRANT CREATE ANY DIMENSION TO "TM_CZ"; +GRANT CREATE DIMENSION TO "TM_CZ"; +GRANT UNDER ANY TABLE TO "TM_CZ"; +GRANT EXECUTE ANY INDEXTYPE TO "TM_CZ"; +GRANT GLOBAL QUERY REWRITE TO "TM_CZ"; +GRANT QUERY REWRITE TO "TM_CZ"; +GRANT UNDER ANY VIEW TO "TM_CZ"; +GRANT DROP ANY INDEXTYPE TO "TM_CZ"; +GRANT ALTER ANY INDEXTYPE TO "TM_CZ"; +GRANT CREATE ANY INDEXTYPE TO "TM_CZ"; +GRANT CREATE INDEXTYPE TO "TM_CZ"; +GRANT EXECUTE ANY OPERATOR TO "TM_CZ"; +GRANT DROP ANY OPERATOR TO "TM_CZ"; +GRANT ALTER ANY OPERATOR TO "TM_CZ"; +GRANT CREATE ANY OPERATOR TO "TM_CZ"; +GRANT CREATE OPERATOR TO "TM_CZ"; +GRANT EXECUTE ANY LIBRARY TO "TM_CZ"; +GRANT DROP ANY LIBRARY TO "TM_CZ"; +GRANT ALTER ANY LIBRARY TO "TM_CZ"; +GRANT CREATE ANY LIBRARY TO "TM_CZ"; +GRANT CREATE LIBRARY TO "TM_CZ"; +GRANT UNDER ANY TYPE TO "TM_CZ"; +GRANT EXECUTE ANY TYPE TO "TM_CZ"; +GRANT DROP ANY TYPE TO "TM_CZ"; +GRANT ALTER ANY TYPE TO "TM_CZ"; +GRANT CREATE ANY TYPE TO "TM_CZ"; +GRANT CREATE TYPE TO "TM_CZ"; +GRANT DROP ANY DIRECTORY TO "TM_CZ"; +GRANT CREATE ANY DIRECTORY TO "TM_CZ"; +GRANT DROP ANY MATERIALIZED VIEW TO "TM_CZ"; +GRANT ALTER ANY MATERIALIZED VIEW TO "TM_CZ"; +GRANT CREATE ANY MATERIALIZED VIEW TO "TM_CZ"; +GRANT CREATE MATERIALIZED VIEW TO "TM_CZ"; + +GRANT GRANT ANY PRIVILEGE TO "TM_CZ"; +GRANT ANALYZE ANY TO "TM_CZ"; +GRANT ALTER RESOURCE COST TO "TM_CZ"; +GRANT DROP PROFILE TO "TM_CZ"; +GRANT ALTER PROFILE TO "TM_CZ"; +GRANT CREATE PROFILE TO "TM_CZ"; +GRANT DROP ANY TRIGGER TO "TM_CZ"; +GRANT ALTER ANY TRIGGER TO "TM_CZ"; +GRANT CREATE ANY TRIGGER TO "TM_CZ"; +GRANT CREATE TRIGGER TO "TM_CZ"; +GRANT EXECUTE ANY PROCEDURE TO "TM_CZ"; +GRANT DROP ANY PROCEDURE TO "TM_CZ"; +GRANT ALTER ANY PROCEDURE TO "TM_CZ"; +GRANT CREATE ANY PROCEDURE TO "TM_CZ"; +GRANT CREATE PROCEDURE TO "TM_CZ"; +GRANT FORCE ANY TRANSACTION TO "TM_CZ"; +GRANT FORCE TRANSACTION TO "TM_CZ"; +GRANT ALTER DATABASE TO "TM_CZ"; +GRANT AUDIT ANY TO "TM_CZ"; +GRANT ALTER ANY ROLE TO "TM_CZ"; +GRANT GRANT ANY ROLE TO "TM_CZ"; +GRANT DROP ANY ROLE TO "TM_CZ"; +GRANT CREATE ROLE TO "TM_CZ"; +GRANT DROP PUBLIC DATABASE LINK TO "TM_CZ"; +GRANT CREATE PUBLIC DATABASE LINK TO "TM_CZ"; +GRANT CREATE DATABASE LINK TO "TM_CZ"; +GRANT SELECT ANY SEQUENCE TO "TM_CZ"; +GRANT DROP ANY SEQUENCE TO "TM_CZ"; +GRANT ALTER ANY SEQUENCE TO "TM_CZ"; +GRANT CREATE ANY SEQUENCE TO "TM_CZ"; +GRANT CREATE SEQUENCE TO "TM_CZ"; +GRANT DROP ANY VIEW TO "TM_CZ"; +GRANT CREATE ANY VIEW TO "TM_CZ"; +GRANT CREATE VIEW TO "TM_CZ"; +GRANT DROP PUBLIC SYNONYM TO "TM_CZ"; +GRANT CREATE PUBLIC SYNONYM TO "TM_CZ"; +GRANT DROP ANY SYNONYM TO "TM_CZ"; +GRANT CREATE ANY SYNONYM TO "TM_CZ"; +GRANT CREATE SYNONYM TO "TM_CZ"; GRANT DROP ANY INDEX TO "TM_CZ"; - +GRANT ALTER ANY INDEX TO "TM_CZ"; GRANT CREATE ANY INDEX TO "TM_CZ"; - +GRANT DROP ANY CLUSTER TO "TM_CZ"; +GRANT ALTER ANY CLUSTER TO "TM_CZ"; +GRANT CREATE ANY CLUSTER TO "TM_CZ"; +GRANT CREATE CLUSTER TO "TM_CZ"; +GRANT DELETE ANY TABLE TO "TM_CZ"; +GRANT UPDATE ANY TABLE TO "TM_CZ"; +GRANT INSERT ANY TABLE TO "TM_CZ"; +GRANT SELECT ANY TABLE TO "TM_CZ"; +GRANT COMMENT ANY TABLE TO "TM_CZ"; +GRANT LOCK ANY TABLE TO "TM_CZ"; GRANT DROP ANY TABLE TO "TM_CZ"; - +GRANT BACKUP ANY TABLE TO "TM_CZ"; +GRANT ALTER ANY TABLE TO "TM_CZ"; +GRANT CREATE ANY TABLE TO "TM_CZ"; +GRANT CREATE TABLE TO "TM_CZ"; +GRANT DROP ROLLBACK SEGMENT TO "TM_CZ"; +GRANT ALTER ROLLBACK SEGMENT TO "TM_CZ"; +GRANT CREATE ROLLBACK SEGMENT TO "TM_CZ"; +GRANT DROP USER TO "TM_CZ"; +GRANT ALTER USER TO "TM_CZ"; +GRANT BECOME USER TO "TM_CZ"; +GRANT CREATE USER TO "TM_CZ"; +GRANT UNLIMITED TABLESPACE TO "TM_CZ"; +GRANT DROP TABLESPACE TO "TM_CZ"; +GRANT MANAGE TABLESPACE TO "TM_CZ"; +GRANT ALTER TABLESPACE TO "TM_CZ"; +GRANT CREATE TABLESPACE TO "TM_CZ"; +GRANT RESTRICTED SESSION TO "TM_CZ"; +GRANT ALTER SESSION TO "TM_CZ"; +GRANT CREATE SESSION TO "TM_CZ"; +GRANT AUDIT SYSTEM TO "TM_CZ"; +GRANT ALTER SYSTEM TO "TM_CZ"; -- -- Type: ROLE_GRANT; Name: TM_CZ -- GRANT "CONNECT" TO "TM_CZ"; - GRANT "RESOURCE" TO "TM_CZ"; - +GRANT "DBA" TO "TM_CZ"; diff --git a/ddl/oracle/GLOBAL/tm_lz.sql b/ddl/oracle/GLOBAL/tm_lz.sql index 3a5b2580..a652fa18 100644 --- a/ddl/oracle/GLOBAL/tm_lz.sql +++ b/ddl/oracle/GLOBAL/tm_lz.sql @@ -4,59 +4,16 @@ CREATE USER "TM_LZ" IDENTIFIED BY VALUES 'S:6F9B91291DD92132F98582AF777B6FE0AC75037237D6F3905CA5DE935E3E;61EBD96BB8F1822E' DEFAULT TABLESPACE "TRANSMART" TEMPORARY TABLESPACE "TEMP"; - -- -- Type: SYSTEM_GRANT; Name: TM_LZ -- +GRANT UNLIMITED TABLESPACE TO "TM_LZ"; -- -- Type: TABLESPACE_QUOTA; Name: TM_LZ -- - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "TM_LZ" QUOTA UNLIMITED ON "TRANSMART"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''TRANSMART'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "TM_LZ" QUOTA UNLIMITED ON "INDX"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''INDX'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - -- -- Type: ROLE_GRANT; Name: TM_LZ -- GRANT "CONNECT" TO "TM_LZ"; - GRANT "RESOURCE" TO "TM_LZ"; - +GRANT "DBA" TO "TM_LZ"; diff --git a/ddl/oracle/GLOBAL/tm_wz.sql b/ddl/oracle/GLOBAL/tm_wz.sql index 2d453748..9474ea0e 100644 --- a/ddl/oracle/GLOBAL/tm_wz.sql +++ b/ddl/oracle/GLOBAL/tm_wz.sql @@ -4,59 +4,16 @@ CREATE USER "TM_WZ" IDENTIFIED BY VALUES 'S:DA4EDB9C0E0DCCADB7B62185D4D3BFC6000ED28FA8A99F1AAD6BB5770299;4F6EDC12B7127966' DEFAULT TABLESPACE "TRANSMART" TEMPORARY TABLESPACE "TEMP"; - -- -- Type: TABLESPACE_QUOTA; Name: TM_WZ -- - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "TM_WZ" QUOTA UNLIMITED ON "TRANSMART"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''TRANSMART'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - - DECLARE - TEMP_COUNT NUMBER; - SQLSTR VARCHAR2(200); -BEGIN - SQLSTR := 'ALTER USER "TM_WZ" QUOTA UNLIMITED ON "INDX"'; - EXECUTE IMMEDIATE SQLSTR; -EXCEPTION - WHEN OTHERS THEN - IF SQLCODE = -30041 THEN - SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES - WHERE TABLESPACE_NAME = ''INDX'' AND CONTENTS = ''TEMPORARY'''; - EXECUTE IMMEDIATE SQLSTR INTO TEMP_COUNT; - IF TEMP_COUNT = 1 THEN RETURN; - ELSE RAISE; - END IF; - ELSE - RAISE; - END IF; -END; -/ - -- -- Type: SYSTEM_GRANT; Name: TM_WZ -- +GRANT UNLIMITED TABLESPACE TO "TM_WZ"; -- -- Type: ROLE_GRANT; Name: TM_WZ -- GRANT "CONNECT" TO "TM_WZ"; - GRANT "RESOURCE" TO "TM_WZ"; - +GRANT "DBA" TO "TM_WZ"; From 30554f53a716e0e01903a9b258489953bbff1f42 Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Tue, 12 Aug 2014 13:38:38 +0100 Subject: [PATCH 30/31] load_analysis was only on postgres --- samples/oracle/load_analysis.sh | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 samples/oracle/load_analysis.sh diff --git a/samples/oracle/load_analysis.sh b/samples/oracle/load_analysis.sh new file mode 100755 index 00000000..80f89706 --- /dev/null +++ b/samples/oracle/load_analysis.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +set -x +set -e + +if [ -z "$KETTLE_HOME" ]; then + echo "KETTLE_HOME is not set" + exit 1 +fi +if [ -z "$DATA_LOCATION" ]; then + echo "DATA_LOCATION is not set" + exit 1 +fi + +# $KETTLE_HOME should have been set by the caller +export KETTLE_HOME + +# Should define ANALYSIS_DATA_FILENAME, ANALYSIS_FILENAME, COHORTS_FILENAME, +# SAMPLES_FILENAME, STUDY_DATA_CATEGORY AND STUDY_DISPLAY_CATEGORY +source $1 + +# the ETL script insist on interpreting LOG_FILENAME as a relative path... +if [ -h $DATA_LOCATION/logs ]; then + rm $DATA_LOCATION/logs +fi +ln -s `pwd`/logs $DATA_LOCATION/logs + +$KITCHEN -norep=Y \ +-file=$KETTLE_JOBS/ETL.search.process_analysis_data.kjb \ +-log=logs/search.process_analysis_data_$(date +"%Y%m%d%H%M").log \ +-param:DATA_LOCATION="$DATA_LOCATION" \ +-param:ANALYSIS_DATA_FILENAME="$ANALYSIS_DATA_FILENAME" \ +-param:ANALYSIS_FILENAME="$ANALYSIS_FILENAME" \ +-param:COHORTS_FILENAME="$COHORTS_FILENAME" \ +-param:LOG_FILENAME=logs/search.process_analysis_data_e \ +-param:SAMPLES_FILENAME="$SAMPLES_FILENAME" \ +-param:STUDY_ID="$STUDY_ID" \ +-param:SORT_DIR=/tmp \ +-param:STUDY_DATA_CATEGORY="$STUDY_DATA_CATEGORY" \ +-param:STUDY_DISPLAY_CATEGORY="$STUDY_DISPLAY_CATEGORY" + +echo -e '\e[32mDONE\e[m Do not forget to reindex Solr' + +rm $DATA_LOCATION/logs From 2fc5276d10b231e56d9acbc9711925b93c345ba1 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Wed, 13 Aug 2014 09:56:59 +0200 Subject: [PATCH 31/31] Fix syntax error in pg/gen_kettle_properties.php --- samples/postgres/gen_kettle_properties.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/postgres/gen_kettle_properties.php b/samples/postgres/gen_kettle_properties.php index c6dc8d45..d1f170a4 100644 --- a/samples/postgres/gen_kettle_properties.php +++ b/samples/postgres/gen_kettle_properties.php @@ -1,4 +1,4 @@ -