<commit_before>-- update records left blank by MTB data load script
update ENVIRONMENTAL_FACTOR ef
set ef.IS_INDUCED_MUTATION_TRIGGER = '0'
where ef.IS_INDUCED_MUTATION_TRIGGER is null
/

--  does not work yet
-- sub-select returns 4023 rows, I manually changed 7 rows on dev
update ENVIRONMENTAL_FACTOR ef
set ef.TYPE = ef.TYPE_ALTERN_ENTRY
where ef.TYPE is null
and ef.ENVIRONMENTAL_FACTOR_ID is IN (
select ef.ENVIRONMENTAL_FACTOR_ID
from environmental_factor ef, abs_cancer_model ac, carcinogen_exposure ce
where ef.ENVIRONMENTAL_FACTOR_ID = ce.ENVIRONMENTAL_FACTOR_ID
and ce.ABS_CANCER_MODEL_ID = ac.ABS_CANCER_MODEL_ID
and ac.EXTERNAL_SOURCE = 'Jax MTB'
order by ef.TYPE, ef.TYPE_ALTERN_ENTRY)
/


-- then null out the typeAlternEntry field
update ENVIRONMENTAL_FACTOR ef
set ef.TYPE_ALTERN_ENTRY = null
where ef.ENVIRONMENTAL_FACTOR_ID is IN (
select ef.ENVIRONMENTAL_FACTOR_ID
from environmental_factor ef, abs_cancer_model ac, carcinogen_exposure ce
where ef.ENVIRONMENTAL_FACTOR_ID = ce.ENVIRONMENTAL_FACTOR_ID
and ce.ABS_CANCER_MODEL_ID = ac.ABS_CANCER_MODEL_ID
and ac.EXTERNAL_SOURCE = 'Jax MTB'
order by ef.TYPE, ef.TYPE_ALTERN_ENTRY
/

-- repeat for name and nameAlternEntry fields
-- sub-select returns 4023 rows, I manually changed 7 rows on dev
update ENVIRONMENTAL_FACTOR ef
set ef.name = ef.name_ALTERN_ENTRY
where ef.name is null
and ef.ENVIRONMENTAL_FACTOR_ID is IN (
select ef.ENVIRONMENTAL_FACTOR_ID
from environmental_factor ef, abs_cancer_model ac, carcinogen_exposure ce
where ef.ENVIRONMENTAL_FACTOR_ID = ce.ENVIRONMENTAL_FACTOR_ID
and ce.ABS_CANCER_MODEL_ID = ac.ABS_CANCER_MODEL_ID
and ac.EXTERNAL_SOURCE = 'Jax MTB'
order by ef.TYPE, ef.TYPE_ALTERN_ENTRY)
/


-- then null out the nameAlternEntry field
update ENVIRONMENTAL_FACTOR ef
set ef.name_ALTERN_ENTRY = null
where ef.ENVIRONMENTAL_FACTOR_ID is IN (
select ef.ENVIRONMENTAL_FACTOR_ID
from environmental_factor ef, abs_cancer_model ac, carcinogen_exposure ce
where ef.ENVIRONMENTAL_FACTOR_ID = ce.ENVIRONMENTAL_FACTOR_ID
and ce.ABS_CANCER_MODEL_ID = ac.ABS_CANCER_MODEL_ID
and ac.EXTERNAL_SOURCE = 'Jax MTB'
order by ef.TYPE, ef.TYPE_ALTERN_ENTRY
/<commit_msg>upgraded to final copy run on DEV DB.  Changed ";" to "/" to signal end of sql statement as per BDA instructions.<commit_after>update ENVIRONMENTAL_FACTOR ef
set ef.IS_INDUCED_MUTATION_TRIGGER = '0'
where ef.IS_INDUCED_MUTATION_TRIGGER is null
/

-- ran on dev manually - will automate in BDA (Fixed 1730 rows)
update ENVIRONMENTAL_FACTOR ef
set ef.TYPE = ef.TYPE_ALTERN_ENTRY
where ef.TYPE is null
and ef.ENVIRONMENTAL_FACTOR_ID IN (
select ef.ENVIRONMENTAL_FACTOR_ID 
From environmental_factor ef, abs_cancer_model ac, carcinogen_exposure ce 
where ef.ENVIRONMENTAL_FACTOR_ID = ce.ENVIRONMENTAL_FACTOR_ID
and ce.ABS_CANCER_MODEL_ID = ac.ABS_CANCER_MODEL_ID
and ac.EXTERNAL_SOURCE = 'Jax MTB')
/

-- then null out the typeAlternEntry field (Fixed 1730 rows)
update ENVIRONMENTAL_FACTOR ef
set ef.TYPE_ALTERN_ENTRY = null
where ef.ENVIRONMENTAL_FACTOR_ID IN (
select ef.ENVIRONMENTAL_FACTOR_ID 
From environmental_factor ef, abs_cancer_model ac, carcinogen_exposure ce 
where ef.ENVIRONMENTAL_FACTOR_ID = ce.ENVIRONMENTAL_FACTOR_ID
and ce.ABS_CANCER_MODEL_ID = ac.ABS_CANCER_MODEL_ID
and ac.EXTERNAL_SOURCE = 'Jax MTB')
/

-- repeat for name and nameAlternEntry fields (Fixed 1723 rows)
update ENVIRONMENTAL_FACTOR ef
set ef.NAME = ef.NAME_ALTERN_ENTRY
where ef.NAME is null
and ef.ENVIRONMENTAL_FACTOR_ID IN (
select ef.ENVIRONMENTAL_FACTOR_ID 
From environmental_factor ef, abs_cancer_model ac, carcinogen_exposure ce 
where ef.ENVIRONMENTAL_FACTOR_ID = ce.ENVIRONMENTAL_FACTOR_ID
and ce.ABS_CANCER_MODEL_ID = ac.ABS_CANCER_MODEL_ID
and ac.EXTERNAL_SOURCE = 'Jax MTB')
/

-- then null out the typeAlternEntry field (Fixed 1730 rows)
update ENVIRONMENTAL_FACTOR ef
set ef.NAME_ALTERN_ENTRY = null
where ef.ENVIRONMENTAL_FACTOR_ID IN (
select ef.ENVIRONMENTAL_FACTOR_ID 
From environmental_factor ef, abs_cancer_model ac, carcinogen_exposure ce 
where ef.ENVIRONMENTAL_FACTOR_ID = ce.ENVIRONMENTAL_FACTOR_ID
and ce.ABS_CANCER_MODEL_ID = ac.ABS_CANCER_MODEL_ID
and ac.EXTERNAL_SOURCE = 'Jax MTB')
/ 
{'fraction_non_alphanumeric': 0.05574324324324324, 'fraction_numerical': 0.006756756756756757, 'mean_word_length': 5.931438127090301, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2887451', 'n_tokens_mistral': 1719, 'n_tokens_neox': 1594, 'n_words': 391}