-- DBMS: bigquery
CREATE TABLE `open-targets-genetics.genetics.variants`
(
  chr_id STRING,
  position INT64,
  ref_allele STRING,
  alt_allele STRING,
  chr_id_b37 STRING,
  position_b37 INT64,
  rs_id STRING,
  most_severe_consequence STRING,
  cadd STRUCT<raw FLOAT64, phred FLOAT64>,
  af STRUCT<gnomad_afr FLOAT64, gnomad_amr FLOAT64, gnomad_asj FLOAT64, gnomad_eas FLOAT64, gnomad_fin FLOAT64, gnomad_nfe FLOAT64, gnomad_nfe_est FLOAT64, gnomad_nfe_nwe FLOAT64, gnomad_nfe_onf FLOAT64, gnomad_nfe_seu FLOAT64, gnomad_oth FLOAT64>,
  gene_id_any_distance INT64,
  gene_id_any STRING,
  gene_id_prot_coding_distance INT64,
  gene_id_prot_coding STRING
)
OPTIONS(
  description="Variant index"
);

INSERT INTO `open-targets-genetics.genetics.variants` (chr_id, position, ref_allele, alt_allele, chr_id_b37, position_b37, rs_id, most_severe_consequence, cadd, af, gene_id_any_distance, gene_id_any, gene_id_prot_coding_distance, gene_id_prot_coding) VALUES ('14_KI270846v1_alt', 425400, 'A', 'G', '14', 106533583, 'rs190248779', 'intergenic_variant', {'raw': 0.139211, 'phred': 4.907}, {'gnomad_afr': 0.5167055167055167, 'gnomad_amr': 0.05817610062893082, 'gnomad_asj': 0.03508771929824561, 'gnomad_eas': 0.10329341317365269, 'gnomad_fin': 0.008982035928143712, 'gnomad_nfe': 0.02240872123204707, 'gnomad_nfe_est': 0.020151869158878503, 'gnomad_nfe_nwe': 0.01932591218305504, 'gnomad_nfe_onf': 0.03889585947302384, 'gnomad_nfe_seu': 0.041666666666666664, 'gnomad_oth': 0.05995203836930456}, NULL, NULL, NULL, NULL), ('1_KI270706v1_random', 4801, 'G', 'T', '1', 143122562, 'rs1437403429', 'intron_variant', {'raw': -0.016349, 'phred': 2.382}, {'gnomad_afr': 0.0, 'gnomad_amr': 0.0, 'gnomad_asj': 0.0, 'gnomad_eas': 0.0, 'gnomad_fin': 0.001736111111111111, 'gnomad_nfe': 0.00013070186903672723, 'gnomad_nfe_est': 0.0002213368747233289, 'gnomad_nfe_nwe': 0.0, 'gnomad_nfe_onf': 0.00046992481203007516, 'gnomad_nfe_seu': 0.0, 'gnomad_oth': 0.0018484288354898336}, NULL, NULL, NULL, NULL), ('1_KI270766v1_alt', 4028, 'C', 'A', '1', 13125957, 'rs557005844', 'non_coding_transcript_exon_variant', {'raw': -0.30158, 'phred': 0.36}, {'gnomad_afr': 0.010060975609756098, 'gnomad_amr': 0.05379746835443038, 'gnomad_asj': 0.015151515151515152, 'gnomad_eas': 0.09, 'gnomad_fin': 0.046012269938650305, 'gnomad_nfe': 0.0680161943319838, 'gnomad_nfe_est': 0.07370184254606366, 'gnomad_nfe_nwe': 0.07128647214854111, 'gnomad_nfe_onf': 0.045706371191135735, 'gnomad_nfe_seu': 0.0, 'gnomad_oth': 0.0391566265060241}, NULL, NULL, NULL, NULL), ('15_KI270850v1_alt', 23039, 'C', 'G', '15', 82902684, 'rs571956503', 'intron_variant', {'raw': -0.289664, 'phred': 0.391}, {'gnomad_afr': 0.001965527668581796, 'gnomad_amr': 0.0024937655860349127, 'gnomad_asj': 0.0038461538461538464, 'gnomad_eas': 0.002857142857142857, 'gnomad_fin': 0.000939261114589856, 'gnomad_nfe': 0.002883762200532387, 'gnomad_nfe_est': 0.001081665765278529, 'gnomad_nfe_nwe': 0.0035998971457958345, 'gnomad_nfe_onf': 0.003567787971457696, 'gnomad_nfe_seu': 0.0, 'gnomad_oth': 0.0021231422505307855}, NULL, NULL, NULL, NULL), ('15_KI270850v1_alt', 131055, 'G', 'A', '15', 83010700, 'rs1299746901', 'downstream_gene_variant', {'raw': 0.017543, 'phred': 2.896}, {'gnomad_afr': 0.0, 'gnomad_amr': 0.0, 'gnomad_asj': 0.0, 'gnomad_eas': 0.0, 'gnomad_fin': 0.0, 'gnomad_nfe': 0.0006711409395973154, 'gnomad_nfe_est': 0.0, 'gnomad_nfe_nwe': 0.0, 'gnomad_nfe_onf': 0.005235602094240838, 'gnomad_nfe_seu': None, 'gnomad_oth': 0.0}, NULL, NULL, NULL, NULL);