-- DBMS: bigquery
CREATE TABLE `open-targets-genetics.genetics.disease_variant_gene`
(
  study_id STRING,
  source STRING,
  pmid STRING,
  pub_date STRING,
  pub_journal STRING,
  pub_title STRING,
  pub_author STRING,
  has_sumstats BOOL,
  trait_reported STRING,
  trait_efos STRUCT<list ARRAY<STRUCT<element STRING>>>,
  ancestry_initial STRUCT<list ARRAY<STRUCT<element STRING>>>,
  ancestry_replication STRUCT<list ARRAY<STRUCT<element STRING>>>,
  n_initial INT64,
  n_replication INT64,
  n_cases INT64,
  trait_category STRING,
  num_assoc_loci INT64,
  lead_chrom STRING,
  lead_pos INT64,
  lead_ref STRING,
  lead_alt STRING,
  tag_chrom STRING,
  tag_pos INT64,
  tag_ref STRING,
  tag_alt STRING,
  overall_r2 FLOAT64,
  AFR_1000G_prop FLOAT64,
  AMR_1000G_prop FLOAT64,
  EAS_1000G_prop FLOAT64,
  EUR_1000G_prop FLOAT64,
  SAS_1000G_prop FLOAT64,
  log10_ABF FLOAT64,
  posterior_prob FLOAT64,
  odds_ratio FLOAT64,
  oddsr_ci_lower FLOAT64,
  oddsr_ci_upper FLOAT64,
  direction STRING,
  beta FLOAT64,
  beta_ci_lower FLOAT64,
  beta_ci_upper FLOAT64,
  pval_mantissa FLOAT64,
  pval_exponent INT64,
  pval FLOAT64,
  gene_id STRING,
  feature STRING,
  type_id STRING,
  source_id STRING,
  fpred_labels STRUCT<list ARRAY<STRUCT<element STRING>>>,
  fpred_scores STRUCT<list ARRAY<STRUCT<element FLOAT64>>>,
  fpred_max_label STRING,
  fpred_max_score FLOAT64,
  qtl_beta FLOAT64,
  qtl_se FLOAT64,
  qtl_pval FLOAT64,
  qtl_score FLOAT64,
  interval_score FLOAT64,
  qtl_score_q FLOAT64,
  interval_score_q FLOAT64,
  d INT64,
  distance_score FLOAT64,
  distance_score_q FLOAT64
)
OPTIONS(
  description="Gene to variant to study-trait index"
);

INSERT INTO `open-targets-genetics.genetics.disease_variant_gene` (study_id, source, pmid, pub_date, pub_journal, pub_title, pub_author, has_sumstats, trait_reported, trait_efos, ancestry_initial, ancestry_replication, n_initial, n_replication, n_cases, trait_category, num_assoc_loci, lead_chrom, lead_pos, lead_ref, lead_alt, tag_chrom, tag_pos, tag_ref, tag_alt, overall_r2, AFR_1000G_prop, AMR_1000G_prop, EAS_1000G_prop, EUR_1000G_prop, SAS_1000G_prop, log10_ABF, posterior_prob, odds_ratio, oddsr_ci_lower, oddsr_ci_upper, direction, beta, beta_ci_lower, beta_ci_upper, pval_mantissa, pval_exponent, pval, gene_id, feature, type_id, source_id, fpred_labels, fpred_scores, fpred_max_label, fpred_max_score, qtl_beta, qtl_se, qtl_pval, qtl_score, interval_score, qtl_score_q, interval_score_q, d, distance_score, distance_score_q) VALUES ('SAIGE_172', 'SAIGE', NULL, '2018-10-24', NULL, NULL, 'UKB SAIGE', True, 'Skin cancer', {'list': "[{'element': 'MONDO_0002898'}]"}, {'list': "[{'element': 'European=408823'}]"}, {'list': '[]'}, 408823, 0, 13752, 'cell proliferation disorder', 41, '1', 150157902, 'G', 'A', '1', 150714820, 'C', 'T', nan, nan, nan, nan, nan, nan, 8.831749701274259, 0.002511258301404, 1.1829366106478107, 1.116259020133697, 1.2535970590798258, '+', nan, nan, nan, 1.33, -8, 1.3300000000000002e-08, 'ENSG00000143387', 'Schmiedel_2018-CD4_T-CELL_ANTI-CD3-CD28', 'eqtl', 'eqtl', {'list': '[]'}, {'list': '[]'}, NULL, nan, -0.363261, 0.0564515, 1.04262e-08, 7.981873948499417, nan, 0.6, nan, NULL, nan, nan), ('SAIGE_172', 'SAIGE', NULL, '2018-10-24', NULL, NULL, 'UKB SAIGE', True, 'Skin cancer', {'list': "[{'element': 'MONDO_0002898'}]"}, {'list': "[{'element': 'European=408823'}]"}, {'list': '[]'}, 408823, 0, 13752, 'cell proliferation disorder', 41, '2', 201286440, 'A', 'G', '2', 201296310, 'T', 'C', 0.6197121795239999, 0.0, 0.0, 0.0, 1.0, 0.0, nan, nan, 0.8564151774836135, 0.8325812047576392, 0.8809314359165632, '-', nan, nan, nan, 5.5600000000000005, -27, 5.560000000000001e-27, 'ENSG00000155749', 'GTEx-eQTL-ADIPOSE_VISCERAL', 'eqtl', 'eqtl', {'list': '[]'}, {'list': '[]'}, NULL, nan, -0.196961, 0.0394072, 8.27542e-07, 6.0822099553705415, nan, 0.2, nan, NULL, nan, nan), ('SAIGE_172', 'SAIGE', NULL, '2018-10-24', NULL, NULL, 'UKB SAIGE', True, 'Skin cancer', {'list': "[{'element': 'MONDO_0002898'}]"}, {'list': "[{'element': 'European=408823'}]"}, {'list': '[]'}, 408823, 0, 13752, 'cell proliferation disorder', 41, '16', 89463679, 'A', 'T', '16', 89496854, 'G', 'A', 0.795185959824, 0.0, 0.0, 0.0, 1.0, 0.0, nan, nan, 0.9122875888183186, 0.8900332532042148, 0.9350983704436724, '-', nan, nan, nan, 3.5700000000000003, -13, 3.5700000000000004e-13, 'ENSG00000197912', 'GTEx-eQTL-MUSCLE', 'eqtl', 'eqtl', {'list': '[]'}, {'list': '[]'}, NULL, nan, 0.0709426, 0.0136429, 2.63171e-07, 6.579761969290127, nan, 0.3, nan, NULL, nan, nan), ('SAIGE_172', 'SAIGE', NULL, '2018-10-24', NULL, NULL, 'UKB SAIGE', True, 'Skin cancer', {'list': "[{'element': 'MONDO_0002898'}]"}, {'list': "[{'element': 'European=408823'}]"}, {'list': '[]'}, 408823, 0, 13752, 'cell proliferation disorder', 41, '16', 89463679, 'A', 'T', '16', 89413365, 'C', 'T', 0.5863960352250001, 0.0, 0.0, 0.0, 1.0, 0.0, nan, nan, 0.9122875888183186, 0.8900332532042148, 0.9350983704436724, '-', nan, nan, nan, 3.5700000000000003, -13, 3.5700000000000004e-13, 'ENSG00000197912', 'Fairfax_2014-MONOCYTE_NAIVE', 'eqtl', 'eqtl', {'list': '[]'}, {'list': '[]'}, NULL, nan, 0.113715, 0.0118242, 7.33095e-20, 19.13483974254522, nan, 0.8, nan, NULL, nan, nan), ('SAIGE_172', 'SAIGE', NULL, '2018-10-24', NULL, NULL, 'UKB SAIGE', True, 'Skin cancer', {'list': "[{'element': 'MONDO_0002898'}]"}, {'list': "[{'element': 'European=408823'}]"}, {'list': '[]'}, 408823, 0, 13752, 'cell proliferation disorder', 41, '12', 95985029, 'C', 'T', '12', 95980972, 'G', 'A', nan, nan, nan, nan, nan, nan, 13.39355791462942, 0.062565366087176, 0.9245020599315532, 0.9008896756658212, 0.9487333265152564, '-', nan, nan, nan, 2.58, -9, 2.58e-09, 'ENSG00000139344', 'eQTLGen-UBERON_0000178', 'eqtl', 'eqtl', {'list': '[]'}, {'list': '[]'}, NULL, nan, 0.2579024110814544, 0.007934286969353893, 9.1212e-232, 231.03994802141992, nan, 1.0, nan, NULL, nan, nan);