Skip to content
Permalink
Browse files

Merge pull request #77 from seattleflu/link-new-targets

Link new targets
  • Loading branch information
joverlee521 committed Mar 25, 2020
2 parents 6a08f0d + 81e815d commit e6e7493e6299fa5469c098366418b1560fec08cd
Showing with 164 additions and 4 deletions.
  1. +9 −4 schema/deploy/warehouse/target/data.sql
  2. +152 −0 schema/deploy/warehouse/target/data@2020-03-24b.sql
  3. +3 −0 schema/sqitch.plan
@@ -80,6 +80,8 @@ with target_lineage (identifier, lineage) as (
('CoV_229E_CoV_OC43', 'Human_coronavirus'),
('CoV_HKU1_CoV_NL63', 'Human_coronavirus'),
('COVID-19', 'Human_coronavirus.2019'),
('COVID-19_Orf1b', 'Human_coronavirus.2019'),
('COVID-19-S_gene', 'Human_coronavirus.2019'),
('nCoV', 'Human_coronavirus.2019'),
('CoV_HKU1', 'Human_coronavirus.HKU1'),
('CoV_NL63', 'Human_coronavirus.NL63'),
@@ -121,10 +123,13 @@ with target_lineage (identifier, lineage) as (
('S. pneumoniae_APZTD4A', 'Streptococcus_pneumoniae'),
('S.pneumoniae', 'Streptococcus_pneumoniae'),

-- Targets reported by Ellume & Cepheid using SNOMED CT
('http://snomed.info/id/181000124108', 'Influenza.A'),
('http://snomed.info/id/441345003', 'Influenza.B'),
('http://snomed.info/id/441278007', 'RSV')
-- Snomed CT targets used by Ellume, Cepheid, UW Retros
('http://snomed.info/id/440930009', 'Adenovirus'),
('http://snomed.info/id/1240581000000104', 'Human_coronavirus.2019'),
('http://snomed.info/id/181000124108', 'Influenza.A'),
('http://snomed.info/id/441345003', 'Influenza.B'),
('http://snomed.info/id/440925005', 'Rhinovirus'),
('http://snomed.info/id/441278007', 'RSV')
)

insert into warehouse.target (identifier, organism_id, control)
@@ -0,0 +1,152 @@
-- Deploy seattleflu/id3c-data:warehouse/target/data to pg
-- requires: seattleflu/schema:warehouse/target/organism

begin;

insert into warehouse.organism (lineage, identifiers, details)
values
('Adenovirus', 'NCBITAXON => 10508', null),
('Bordetella_pertussis', 'NCBITAXON => 520', null),
('Chlamydophila_pneumoniae','NCBITAXON => 83558', null),
('Enterovirus', 'NCBITAXON => 12059', null),
('Enterovirus.D', 'NCBITAXON => 138951', null),
('Enterovirus.D.68', 'NCBITAXON => 42789', null),
('Rhinovirus', null, null),
('Human_bocavirus', 'NCBITAXON => 329641', null),
('Human_coronavirus', null, null),
('Human_coronavirus.HKU1', 'NCBITAXON => 290028', null),
('Human_coronavirus.NL63', 'NCBITAXON => 277944', null),
('Human_coronavirus.229E', 'NCBITAXON => 11137', null),
('Human_coronavirus.OC43', 'NCBITAXON => 31631', null),
('Human_coronavirus.2019', 'NCBITAXON => 2697049', '{"report_to_public_health": true}'),
('Human_metapneumovirus', 'NCBITAXON => 162145', null),
('Human_parainfluenza', null, null),
('Human_parainfluenza.1', 'NCBITAXON => 12730', null),
('Human_parainfluenza.2', 'NCBITAXON => 1979160', null),
('Human_parainfluenza.3', 'NCBITAXON => 11216', null),
('Human_parainfluenza.4', 'NCBITAXON => 1979161', null),
('Human_parechovirus', 'NCBITAXON => 1803956', null),
('Influenza', null, null),
('Influenza.A', 'NCBITAXON => 11320', null),
('Influenza.A.H1N1', 'NCBITAXON => 114727', null),
('Influenza.A.H3N2', 'NCBITAXON => 119210', null),
('Influenza.B', 'NCBITAXON => 11520', null),
('Influenza.B.Vic', null, null),
('Influenza.B.Yam', null, null),
('Influenza.C', 'NCBITAXON => 11552', null),
('Measles', 'NCBITAXON => 11234', null),
('Mumps', 'NCBITAXON => 1979165', null),
('Mycoplasma_pneumoniae', 'NCBITAXON => 2104', null),
('RSV', 'NCBITAXON => 11250', null),
('RSV.A', 'NCBITAXON => 208893', null),
('RSV.B', 'NCBITAXON => 208895', null),
('Streptococcus_pneumoniae','NCBITAXON => 1313', null)


on conflict (lineage) do update
set identifiers = coalesce(organism.identifiers, '') || EXCLUDED.identifiers,
details = coalesce(organism.details, '{}') || EXCLUDED.details
;

delete from warehouse.organism
where lineage = 'Human_coronavirus.2019_nCoV';

with target_lineage (identifier, lineage) as (
values
-- Targets reported by NWGC from Thermo Fisher's OpenArray cards
('Adenovirus_pan_1', 'Adenovirus'::ltree),
('Adenovirus_pan_2', 'Adenovirus'),
('AdV_1of2', 'Adenovirus'),
('AdV_2of2', 'Adenovirus'),
('AI20U8U', 'Bordetella_pertussis'),
('B.pertussis', 'Bordetella_pertussis'),
('B.Pertussis', 'Bordetella_pertussis'),
('AI1RW2H', 'Chlamydophila_pneumoniae'),
('C_pneumoniae', 'Chlamydophila_pneumoniae'),
('C. pneumoniae', 'Chlamydophila_pneumoniae'),
('C. pneumoniae_AI1RW2H', 'Chlamydophila_pneumoniae'),
('C.pneumoniae', 'Chlamydophila_pneumoniae'),
('AP7DPVF', 'Enterovirus'),
('EnterovirusA_B 1_AP7DPVF', 'Enterovirus'),
('Enterovirus_pan', 'Enterovirus'),
('Ev_pan', 'Enterovirus'),
('EV_pan', 'Enterovirus'),
('APFVK4U', 'Enterovirus.D.68'),
('enterovirus-D_APFVK4U', 'Enterovirus.D.68'),
('Enterovirus-D_APFVK4U', 'Enterovirus.D.68'),
('EV_D68', 'Enterovirus.D.68'),
('Bocavirus', 'Human_bocavirus'),
('HBoV', 'Human_bocavirus'),
('CoV_229E_CoV_OC43', 'Human_coronavirus'),
('CoV_HKU1_CoV_NL63', 'Human_coronavirus'),
('COVID-19', 'Human_coronavirus.2019'),
('COVID-19_Orf1b', 'Human_coronavirus.2019'),
('COVID-19-S_gene', 'Human_coronavirus.2019'),
('nCoV', 'Human_coronavirus.2019'),
('CoV_HKU1', 'Human_coronavirus.HKU1'),
('CoV_NL63', 'Human_coronavirus.NL63'),
('CoV_229E', 'Human_coronavirus.229E'),
('CoV_OC43', 'Human_coronavirus.OC43'),
('hMPV', 'Human_metapneumovirus'),
('hPIV1_hPIV2', 'Human_parainfluenza'),
('hPIV3_hPIV4', 'Human_parainfluenza'),
('hPIV1', 'Human_parainfluenza.1'),
('hPIV2', 'Human_parainfluenza.2'),
('hPIV3', 'Human_parainfluenza.3'),
('hPIV4', 'Human_parainfluenza.4'),
('HPeV', 'Human_parechovirus'),
('flu_A_pan', 'Influenza.A'),
('Flu_A_pan', 'Influenza.A'),
('Flu_A_H1', 'Influenza.A.H1N1'),
('Flu_A_H3', 'Influenza.A.H3N2'),
('Flu_b_pan', 'Influenza.B'),
('Flu_B_pan', 'Influenza.B'),
('Influenza_B', 'Influenza.B'),
('AP324NU', 'Influenza.C'),
('Measles', 'Measles'),
('APKA3DE', 'Mumps'),
('Mumps', 'Mumps'),
('AI5IRK5', 'Mycoplasma_pneumoniae'),
('M_pneumoniae', 'Mycoplasma_pneumoniae'),
('M. pneumoniae', 'Mycoplasma_pneumoniae'),
('M. pneumoniae_AI5IRK5', 'Mycoplasma_pneumoniae'),
('M.pneumoniae', 'Mycoplasma_pneumoniae'),
('11 Rhinovirus_pan_1', 'Rhinovirus'),
('12 Rhinovirus_pan_2', 'Rhinovirus'),
('RV_1of2', 'Rhinovirus'),
('RV_2of2', 'Rhinovirus'),
('RSVA', 'RSV.A'),
('RSVB', 'RSV.B'),
('APZTD4A', 'Streptococcus_pneumoniae'),
('S_pneumoniae', 'Streptococcus_pneumoniae'),
('S. pneumoniae', 'Streptococcus_pneumoniae'),
('S. pneumoniae_APZTD4A', 'Streptococcus_pneumoniae'),
('S.pneumoniae', 'Streptococcus_pneumoniae'),

-- Targets reported by Ellume & Cepheid using SNOMED CT
('http://snomed.info/id/181000124108', 'Influenza.A'),
('http://snomed.info/id/441345003', 'Influenza.B'),
('http://snomed.info/id/441278007', 'RSV')
)

insert into warehouse.target (identifier, organism_id, control)

select identifier, organism_id, false
from target_lineage
join warehouse.organism using (lineage)

on conflict (identifier) do update
set organism_id = EXCLUDED.organism_id
;


insert into warehouse.target (identifier, control)
values
('Hs04930436_g1', 't'),
('Ac00010014_a1', 't')

on conflict (identifier) do update
set control = EXCLUDED.control
;

commit;
@@ -126,3 +126,6 @@ shipping/views [shipping/views@2020-03-23] 2020-03-24T16:14:12Z Jover Lee <jover

shipping/views [shipping/views@2020-03-24] 2020-03-24T19:06:10Z Kairsten Fay <kfay@fredhutch.org> # Update hcov19_observation date and add result timestamp to SCAN RoR
@2020-03-24b 2020-03-24T19:31:48Z Kairsten Fay <kfay@fredhutch.org> # Schema as of later on 24 Mar 2020

warehouse/target/data [warehouse/target/data@2020-03-24b] 2020-03-25T00:56:30Z Jover Lee <joverlee@fredhutch.org> # Link new targets (uw-retro & covid) to organisms
@2020-03-24c 2020-03-25T01:00:57Z Jover Lee <joverlee@fredhutch.org> # Schema as of later on 24 March 2020

0 comments on commit e6e7493

Please sign in to comment.
You can’t perform that action at this time.