From 15049ab73c3dac6d2f091358d6d2590a727855f8 Mon Sep 17 00:00:00 2001 From: Charles Haynes Date: Thu, 10 Oct 2024 12:21:28 -0400 Subject: [PATCH] Update SQL to remove duplicate Reference Genome entry --- src/main/resources/db-scripts/clickhouse/clickhouse.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/db-scripts/clickhouse/clickhouse.sql b/src/main/resources/db-scripts/clickhouse/clickhouse.sql index 8743d4b0c6c..79c2b4469c2 100644 --- a/src/main/resources/db-scripts/clickhouse/clickhouse.sql +++ b/src/main/resources/db-scripts/clickhouse/clickhouse.sql @@ -153,7 +153,7 @@ FROM cna_event ce INNER JOIN sample ON sce.sample_id = sample.internal_id INNER JOIN patient on sample.patient_id = patient.internal_id INNER JOIN gene ON ce.entrez_gene_id = gene.entrez_gene_id - INNER JOIN reference_genome_gene rgg ON rgg.entrez_gene_id = ce.entrez_gene_id + INNER JOIN reference_genome_gene rgg ON rgg.entrez_gene_id = ce.entrez_gene_id AND rgg.reference_genome_id = cs.reference_genome_id UNION ALL -- Insert Structural Variants Site1 SELECT concat(cs.cancer_study_identifier, '_', s.stable_id) AS sample_unique_id,