Skip to content

Commit

Permalink
fix: molecular trait sumstats filtered process loads twice
Browse files Browse the repository at this point in the history
  • Loading branch information
mkarmona committed Nov 4, 2021
1 parent 342faba commit 81d09bf
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions loaders/clickhouse/v2d_sa_molecular_traits.sql
Original file line number Diff line number Diff line change
@@ -1,35 +1,6 @@
create table if not exists ot.v2d_sa_molecular_trait
engine MergeTree partition by (chrom) order by (chrom, pos)
as
select
cast(assumeNotNull(type_id) as Enum8('eqtl' = 1, 'pqtl' = 2)) as type_id,
study_id,
cast(
assumeNotNull(chrom) as Enum8('1' = 1, '2' = 2, '3' = 3, '4' = 4, '5' = 5, '6' = 6, '7' = 7, '8' = 8, '9' = 9, '10' = 10, '11' = 11, '12' = 12, '13' = 13, '14' = 14, '15' = 15, '16' = 16, '17' = 17, '18' = 18, '19' = 19, '20' = 20, '21' = 21, '22' = 22, 'X'= 23, 'Y' = 24, 'MT'=25 )) as chrom,
pos,
ref,
alt,
beta,
se,
pval,
n_total,
eaf,
mac,
num_tests,
if(isNull(info), 0.0, info),
is_cc,
phenotype_id,
gene_id,
bio_feature
from (
SELECT *
FROM ot.v2d_sa_molecular_trait_log
WHERE chrom IN
('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13',
'14', '15', '16', '17', '18', '19', '20', '21', '22', 'X', 'Y', 'MT')
);

insert into ot.v2d_sa_molecular_trait
select
cast(assumeNotNull(type_id) as Enum8('eqtl' = 1, 'pqtl' = 2)) as type_id,
study_id,
Expand Down

0 comments on commit 81d09bf

Please sign in to comment.