-- DBMS: snowflake
create or replace TABLE PHARMACOGENOMICS (
	"datasourceId" VARCHAR(16777216),
	"datasourceVersion" VARCHAR(16777216),
	"datatypeId" VARCHAR(16777216),
	"directionality" VARCHAR(16777216),
	"evidenceLevel" VARCHAR(16777216),
	"genotype" VARCHAR(16777216),
	"genotypeAnnotationText" VARCHAR(16777216),
	"genotypeId" VARCHAR(16777216),
	"haplotypeFromSourceId" VARCHAR(16777216),
	"haplotypeId" VARCHAR(16777216),
	"literature" VARIANT,
	"pgxCategory" VARCHAR(16777216),
	"phenotypeFromSourceId" VARCHAR(16777216),
	"phenotypeText" VARCHAR(16777216),
	"studyId" VARCHAR(16777216),
	"targetFromSourceId" VARCHAR(16777216),
	"variantFunctionalConsequenceId" VARCHAR(16777216),
	"variantRsId" VARCHAR(16777216),
	"isDirectTarget" BOOLEAN,
	"drugs" VARIANT
);

INSERT INTO "OPEN_TARGETS_PLATFORM_2"."OPEN_TARGETS_PLATFORM"."PHARMACOGENOMICS" (studyId, phenotypeFromSourceId, directionality, targetFromSourceId, genotypeAnnotationText, literature, haplotypeFromSourceId, genotypeId, isDirectTarget, datasourceId, datatypeId, haplotypeId, genotype, datasourceVersion, variantFunctionalConsequenceId, pgxCategory, phenotypeText, evidenceLevel, variantRsId, drugs) VALUES ('613976757', NULL, NULL, 'ENSG00000143819', '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.', '{
  "list": [
    {
      "element": "23252947"
    },
    {
      "element": "19620853"
    },
    {
      "element": "22188362"
    },
    {
      "element": "15692831"
    },
    {
      "element": "25495409"
    },
    {
      "element": "26555147"
    },
    {
      "element": "26555147"
    }
  ]
}', NULL, '1_225838705_A_G,G', False, 'pharmgkb', 'clinical_annotation', NULL, 'GG', '2024-05-05', 'SO_0001583', 'dosage', 'increased dose of carbamazepine', '3', 'rs2234922', '{
  "list": [
    {
      "element": {
        "drugFromSource": "carbamazepine",
        "drugId": "CHEMBL108"
      }
    }
  ]
}'), ('613976757', NULL, NULL, 'ENSG00000143819', '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.', '{
  "list": [
    {
      "element": "23252947"
    },
    {
      "element": "19620853"
    },
    {
      "element": "22188362"
    },
    {
      "element": "15692831"
    },
    {
      "element": "25495409"
    },
    {
      "element": "26555147"
    },
    {
      "element": "26555147"
    }
  ]
}', NULL, '1_225838705_A_A,G', False, 'pharmgkb', 'clinical_annotation', NULL, 'AG', '2024-05-05', 'SO_0001583', 'dosage', 'increased dose of carbamazepine', '3', 'rs2234922', '{
  "list": [
    {
      "element": {
        "drugFromSource": "carbamazepine",
        "drugId": "CHEMBL108"
      }
    }
  ]
}'), ('613976848', NULL, NULL, 'ENSG00000204463', '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.', '{
  "list": [
    {
      "element": "16538176"
    }
  ]
}', NULL, '6_31639273_C_C,C', False, 'pharmgkb', 'clinical_annotation', NULL, 'CC', '2024-05-05', 'SO_0002073', 'toxicity', 'increased risk of Stevens-Johnson syndrome', '3', 'rs750332', '{
  "list": [
    {
      "element": {
        "drugFromSource": "carbamazepine",
        "drugId": "CHEMBL108"
      }
    }
  ]
}'), ('613977037', NULL, NULL, 'ENSG00000204390', 'Patients with the AG genotype may have a decreased but not non-existent chance of severe hypersensitivity to carbamazepine treatment as compared to patients with the AA genotype. Other genetic and clinical factors may also influence a patient''s chance of adverse response.', '{
  "list": [
    {
      "element": "16538175"
    }
  ]
}', NULL, '6_31810495_G_A,G', False, 'pharmgkb', 'clinical_annotation', NULL, 'AG', '2024-05-05', 'SO_0001583', 'toxicity', 'decreased chance of severe hypersensitivity to carbamazepine treatment', '3', 'rs2227956', '{
  "list": [
    {
      "element": {
        "drugFromSource": "carbamazepine",
        "drugId": "CHEMBL108"
      }
    }
  ]
}'), ('613977064', NULL, NULL, 'ENSG00000101204', 'Patients with the AG genotype may have an increased risk for nicotine dependence as compared to patients with the GG genotype. Other genetic and clinical factors may also influence a patient''s risk for nicotine dependence.', '{
  "list": [
    {
      "element": "15790597"
    }
  ]
}', NULL, '20_63346204_G_A,G', True, 'pharmgkb', 'clinical_annotation', NULL, 'AG', '2024-05-05', 'SO_0001624', 'other', 'increased risk for nicotine dependence', '3', 'rs2236196', '{
  "list": [
    {
      "element": {
        "drugFromSource": "nicotine",
        "drugId": "CHEMBL3"
      }
    }
  ]
}');