@@ -96,9 +96,10 @@ CREATE TABLE IF NOT EXISTS genomic_event_derived
96
96
cna_alteration Nullable(Int8),
97
97
cna_cytoband String,
98
98
sv_event_info String,
99
- patient_unique_id String
99
+ patient_unique_id String,
100
+ off_panel Boolean DEFAULT FALSE
100
101
) ENGINE = MergeTree
101
- ORDER BY ( variant_type, entrez_gene_id, hugo_gene_symbol, genetic_profile_stable_id, sample_unique_id);
102
+ ORDER BY (variant_type, entrez_gene_id, hugo_gene_symbol, genetic_profile_stable_id, sample_unique_id);
102
103
103
104
INSERT INTO genomic_event_derived
104
105
-- Insert Mutations
@@ -117,7 +118,11 @@ SELECT concat(cs.cancer_study_identifier, '_', sample.stable_id) AS sample_uniqu
117
118
NULL AS cna_alteration,
118
119
' ' AS cna_cytoband,
119
120
' ' AS sv_event_info,
120
- concat(cs .cancer_study_identifier , ' _' , patient .stable_id ) AS patient_unique_id
121
+ concat(cs .cancer_study_identifier , ' _' , patient .stable_id ) AS patient_unique_id,
122
+ (gene_panel_stable_id, hugo_gene_symbol) NOT IN (
123
+ SELECT gene_panel_id, gene
124
+ FROM gene_panel_to_gene_derived
125
+ ) AS off_panel
121
126
FROM mutation
122
127
INNER JOIN mutation_event AS me ON mutation .mutation_event_id = me .mutation_event_id
123
128
INNER JOIN sample_profile sp
@@ -145,7 +150,11 @@ SELECT concat(cs.cancer_study_identifier, '_', sample.stable_id) AS sample_uniqu
145
150
ce .alteration AS cna_alteration,
146
151
rgg .cytoband AS cna_cytoband,
147
152
' ' AS sv_event_info,
148
- concat(cs .cancer_study_identifier , ' _' , patient .stable_id ) AS patient_unique_id
153
+ concat(cs .cancer_study_identifier , ' _' , patient .stable_id ) AS patient_unique_id,
154
+ (gene_panel_stable_id, hugo_gene_symbol) NOT IN (
155
+ SELECT gene_panel_id, gene
156
+ FROM gene_panel_to_gene_derived
157
+ ) AS off_panel
149
158
FROM cna_event ce
150
159
INNER JOIN sample_cna_event sce ON ce .cna_event_id = sce .cna_event_id
151
160
INNER JOIN sample_profile sp ON sce .sample_id = sp .sample_id AND sce .genetic_profile_id = sp .genetic_profile_id
@@ -173,7 +182,11 @@ SELECT concat(cs.cancer_study_identifier, '_', s.stable_id) AS sample_unique_id,
173
182
NULL AS cna_alteration,
174
183
' ' AS cna_cytoband,
175
184
event_info AS sv_event_info,
176
- concat(cs .cancer_study_identifier , ' _' , patient .stable_id ) AS patient_unique_id
185
+ concat(cs .cancer_study_identifier , ' _' , patient .stable_id ) AS patient_unique_id,
186
+ (gene_panel_stable_id, hugo_gene_symbol) NOT IN (
187
+ SELECT gene_panel_id, gene
188
+ FROM gene_panel_to_gene_derived
189
+ ) AS off_panel
177
190
FROM structural_variant sv
178
191
INNER JOIN genetic_profile gp ON sv .genetic_profile_id = gp .genetic_profile_id
179
192
INNER JOIN sample s ON sv .sample_id = s .internal_id
@@ -199,7 +212,11 @@ SELECT concat(cs.cancer_study_identifier, '_', s.stable_id) AS sample_unique_id,
199
212
NULL AS cna_alteration,
200
213
' ' AS cna_cytoband,
201
214
event_info AS sv_event_info,
202
- concat(cs .cancer_study_identifier , ' _' , patient .stable_id ) AS patient_unique_id
215
+ concat(cs .cancer_study_identifier , ' _' , patient .stable_id ) AS patient_unique_id,
216
+ (gene_panel_stable_id, hugo_gene_symbol) NOT IN (
217
+ SELECT gene_panel_id, gene
218
+ FROM gene_panel_to_gene_derived
219
+ ) AS off_panel
203
220
FROM structural_variant sv
204
221
INNER JOIN genetic_profile gp ON sv .genetic_profile_id = gp .genetic_profile_id
205
222
INNER JOIN sample s ON sv .sample_id = s .internal_id
0 commit comments