-- DBMS: bigquery
CREATE TABLE `bigquery-public-data.open_targets_platform.pharmacogenomics`
(
  datasourceId STRING,
  datasourceVersion STRING,
  datatypeId STRING,
  directionality STRING,
  evidenceLevel STRING,
  genotype STRING,
  genotypeAnnotationText STRING,
  genotypeId STRING,
  haplotypeFromSourceId STRING,
  haplotypeId STRING,
  literature STRUCT<list ARRAY<STRUCT<element STRING>>>,
  pgxCategory STRING,
  phenotypeFromSourceId STRING,
  phenotypeText STRING,
  studyId STRING,
  targetFromSourceId STRING,
  variantFunctionalConsequenceId STRING,
  variantRsId STRING,
  isDirectTarget BOOL NOT NULL,
  drugs STRUCT<list ARRAY<STRUCT<element STRUCT<drugFromSource STRING, drugId STRING> NOT NULL>>> NOT NULL
);

INSERT INTO `bigquery-public-data.open_targets_platform.pharmacogenomics` (datasourceId, datasourceVersion, datatypeId, directionality, evidenceLevel, genotype, genotypeAnnotationText, genotypeId, haplotypeFromSourceId, haplotypeId, literature, pgxCategory, phenotypeFromSourceId, phenotypeText, studyId, targetFromSourceId, variantFunctionalConsequenceId, variantRsId, isDirectTarget, drugs) VALUES ('pharmgkb', '2024-05-05', 'clinical_annotation', NULL, '3', 'GG', 'Patients with the GG genotype may require an increased dose of carbamazepine as compared to patients with the AA genotype, although this is contradicted in one study. Other genetic and clinical factors may also influence dose of carbamazepine.', '1_225838705_A_G,G', NULL, NULL, {'list': "[{'element': '23252947'} {'element': '19620853'} {'element': '22188362'}\n {'element': '15692831'} {'element': '25495409'} {'element': '26555147'}\n {'element': '26555147'}]"}, 'dosage', NULL, 'increased dose of carbamazepine', '613976757', 'ENSG00000143819', 'SO_0001583', 'rs2234922', False, {'list': "[{'element': {'drugFromSource': 'carbamazepine', 'drugId': 'CHEMBL108'}}]"}), ('pharmgkb', '2024-05-05', 'clinical_annotation', NULL, '3', 'AG', 'Patients with the AG genotype may require an increased dose of carbamazepine as compared to patients with the AA genotype, although this is contradicted in one study. Other genetic and clinical factors may also influence dose of carbamazepine.', '1_225838705_A_A,G', NULL, NULL, {'list': "[{'element': '23252947'} {'element': '19620853'} {'element': '22188362'}\n {'element': '15692831'} {'element': '25495409'} {'element': '26555147'}\n {'element': '26555147'}]"}, 'dosage', NULL, 'increased dose of carbamazepine', '613976757', 'ENSG00000143819', 'SO_0001583', 'rs2234922', False, {'list': "[{'element': {'drugFromSource': 'carbamazepine', 'drugId': 'CHEMBL108'}}]"}), ('pharmgkb', '2024-05-05', 'clinical_annotation', NULL, '3', 'AA', 'Patients with the AA genotype may require a decreased dose of carbamazepine as compared to patients with the AG or GG genotype, although this is contradicted in one study. Other genetic and clinical factors may also influence dose of carbamazepine.', '1_225838705_A_A,A', NULL, NULL, {'list': "[{'element': '23252947'} {'element': '19620853'} {'element': '22188362'}\n {'element': '15692831'} {'element': '25495409'} {'element': '26555147'}\n {'element': '26555147'}]"}, 'dosage', NULL, 'decreased dose of carbamazepine', '613976757', 'ENSG00000143819', 'SO_0002073', 'rs2234922', False, {'list': "[{'element': {'drugFromSource': 'carbamazepine', 'drugId': 'CHEMBL108'}}]"}), ('pharmgkb', '2024-05-05', 'clinical_annotation', NULL, '3', 'CC', 'Patients with the CC genotype who are treated with carbamazepine may have an increased risk of Stevens-Johnson syndrome as compared to patients with the TT genotype. Other genetic and clinical factors may also influence a patient''s risk for Stevens-Johnson syndrome with carbamazepine treatment.', '6_31639273_C_C,C', NULL, NULL, {'list': "[{'element': '16538176'}]"}, 'toxicity', NULL, 'increased risk of Stevens-Johnson syndrome', '613976848', 'ENSG00000204463', 'SO_0002073', 'rs750332', False, {'list': "[{'element': {'drugFromSource': 'carbamazepine', 'drugId': 'CHEMBL108'}}]"}), ('pharmgkb', '2024-05-05', 'clinical_annotation', NULL, '3', 'CT', 'Patients with the CT genotype who are treated with carbamazepine may have an increased risk of Stevens-Johnson syndrome as compared to patients with the TT genotype. Other genetic and clinical factors may also influence a patient''s risk for Stevens-Johnson syndrome with carbamazepine treatment.', '6_31639273_C_C,T', NULL, NULL, {'list': "[{'element': '16538176'}]"}, 'toxicity', NULL, 'increased risk of Stevens-Johnson syndrome', '613976848', 'ENSG00000204463', 'SO_0001627', 'rs750332', False, {'list': "[{'element': {'drugFromSource': 'carbamazepine', 'drugId': 'CHEMBL108'}}]"});