-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.clinical_tier1_moleculartest_r4`
(
  Molecular_Analysis_Method STRING OPTIONS(description="The text term used to describe the method used for molecular analysis. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  Clinical_Biospecimen_Type STRING OPTIONS(description="The text term used to describe the biological material used for testing, diagnostic, treatment or research purposes. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Timepoint_Label STRING OPTIONS(description="Label to identify the time point at which the clinical data or biospecimen was obtained (e.g. Baseline, End of Treatment, Overall survival, Final). NO PHI/PII INFORMATION IS ALLOWED."),
  Exon STRING OPTIONS(description="Exon number targeted or included in a molecular analysis. If a specific genetic variant is being reported, this property can be used to capture the exon where that variant is located. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Transcript STRING OPTIONS(description="Alphanumeric value used to describe the transcript of a specific genetic variant. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Antigen STRING OPTIONS(description="The text term used to describe an antigen included in molecular testing. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  Locus STRING OPTIONS(description="Alphanumeric value used to describe the locus of a specific genetic variant. Example: NM_001126114."),
  Ploidy STRING OPTIONS(description="Text term used to describe the number of sets of homologous chromosomes."),
  Zygosity STRING OPTIONS(description="The text term used to describe the zygosity of a specific genetic variant."),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Molecular_Consequence STRING OPTIONS(description="The text term used to describe the molecular consequence of genetic variation. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Specialized_Molecular_Test STRING OPTIONS(description="Text term used to describe a specific test that is not covered in the list of molecular analysis methods. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Blood_Test_Normal_Range_Upper STRING OPTIONS(description="Numeric value used to describe the upper limit of the normal range used to describe a healthy individual at the institution where the test was completed."),
  Pathogenicity STRING OPTIONS(description="The text used to describe a variant's level of involvement in the cause of the patient's disease according to the standards outlined by the American College of Medical Genetics and Genomics (ACMG)."),
  Blood_Test_Normal_Range_Lower STRING OPTIONS(description="Numeric value used to describe the lower limit of the normal range used to describe a healthy individual at the institution where the test was completed."),
  HTAN_Participant_ID STRING OPTIONS(description="HTAN ID associated with a patient based on HTAN ID SOP (eg HTANx_yyy )"),
  Histone_Family STRING OPTIONS(description="The text term used to describe the family, or classification of a group of basic proteins found in chromatin, called histones."),
  Variant_Type STRING OPTIONS(description="The text term used to describe the type of genetic variation."),
  Copy_Number STRING OPTIONS(description="Numeric value used to describe the number of times a section of the genome is repeated or copied within an insertion, duplication or deletion variant. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Loci_Abnormal_Count STRING OPTIONS(description="Numeric value used to describe the number of loci determined to be abnormal."),
  Test_Units STRING OPTIONS(description="The text term used to describe the units of the test value for a molecular test. This property is used in conjunction with test_value. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Variant_Origin STRING OPTIONS(description="The text term used to describe the biological origin of a specific genetic variant. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  AA_Change STRING OPTIONS(description="Alphanumeric value used to describe the amino acid change for a specific genetic variant. Example: R116Q. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Chromosome STRING OPTIONS(description="The text term used to describe a chromosome targeted or included in molecular testing. If a specific genetic variant is being reported, this property can be used to capture the chromosome where that variant is located. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Laboratory_Test STRING OPTIONS(description="The text term used to describe the medical testing used to diagnose, treat or further understand a patient's disease."),
  Gene_Symbol STRING OPTIONS(description="The text term used to describe a gene targeted or included in molecular analysis. For rearrangements, this is should be used to represent the reference gene. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Intron STRING OPTIONS(description="Intron number targeted or included in molecular analysis. If a specific genetic variant is being reported, this property can be used to capture the intron where that variant is located."),
  Stop_Days_from_Index STRING OPTIONS(description="Number of days from the date of birth (index date) to the end date of the event (e.g. exposure to environmental factor, treatment start, etc.). Note: if the event occurs at a single time point, e.g. a diagnosis or a lab test, the values for this column is 'Not Applicable'"),
  Histone_Variant STRING OPTIONS(description="The text term used to describe a specific histone variants, which are proteins that substitute for the core canonical histones."),
  Test_Result STRING OPTIONS(description="The text term used to describe the result of the molecular test. If the test result was a numeric value see test_value. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Loci_Count STRING OPTIONS(description="Numeric value used to describe the number of loci tested."),
  Second_Gene_Symbol STRING OPTIONS(description="The text term used to describe a secondary gene targeted or included in molecular analysis. For rearrangements, this is should represent the location of the variant. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Test_Analyte_Type STRING OPTIONS(description="The text term used to describe the type of analyte used for molecular testing. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Cell_Count STRING OPTIONS(description="Numeric value used to describe the number of cells used for molecular testing. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Second_Exon STRING OPTIONS(description="The second exon number involved in molecular variation. If a specific genetic variant is being reported, this property can be used to capture the second exon where that variant is located. This property is typically used for a translocation where two different locations are involved in the variation."),
  Test_Value STRING OPTIONS(description="The text term or numeric value used to describe a specific result of a molecular test. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here"),
  Mismatch_Repair_Mutation STRING OPTIONS(description="The yes/no/unknown indicator used to describe whether the mutation included in molecular testing was known to have an affect on the mismatch repair process. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Clonality STRING OPTIONS(description="The text term used to describe whether a genomic variant is related by descent from a single progenitor cell. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  Start_Days_from_Index STRING OPTIONS(description="Number of days from the date of birth (index date) to the date of an event (e.g. exposure to environmental factor, treatment start, etc.). If not applicable please enter 'Not Applicable'"),
  Cytoband STRING OPTIONS(description="Alphanumeric value used to describe the cytoband or chromosomal location targeted or included in molecular analysis. If a specific genetic variant is being reported, this property can be used to capture the cytoband where the variant is located. Format: [chromosome][chromosome arm].[band+sub-bands]. Example: 17p13.1. Note: This node is meant to capture molecular tests that were completed clinically for the participant and only includes data from diagnostic array that was completed prior to research sequencing was done. Do not include data related to research assay outputs here."),
  HTAN_Center STRING OPTIONS(description="Name of HTAN Center e.g. HTAN HTAPP"),
  Manifest_Id STRING OPTIONS(description="Synapse ID of manifest containing file annotation"),
  Manifest_Version INT64 OPTIONS(description="Latest version of metadata manifest")
)
OPTIONS(
  friendly_name="HTAN CLINICAL TIER 1 DATA - MOLECULAR TEST R4 VERSIONED",
  description="This table contains clinical molecular test information about HTAN patient cases. Data was extracted from HTAN Synapse projects in October 2023. More details: see https://data.humantumoratlas.org/standard/clinical",
  labels=[("access", "open"), ("data_type", "clinical_data"), ("program", "htan"), ("source", "htan"), ("category", "clinical_biospecimen_data"), ("status", "current")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.clinical_tier1_moleculartest_r4` (Molecular_Analysis_Method, Id, Clinical_Biospecimen_Type, Timepoint_Label, Exon, Transcript, Antigen, entityId, Locus, Ploidy, Zygosity, Component, Molecular_Consequence, Specialized_Molecular_Test, Blood_Test_Normal_Range_Upper, Pathogenicity, Blood_Test_Normal_Range_Lower, HTAN_Participant_ID, Histone_Family, Variant_Type, Copy_Number, Loci_Abnormal_Count, Test_Units, Variant_Origin, AA_Change, Chromosome, Laboratory_Test, Gene_Symbol, Intron, Stop_Days_from_Index, Histone_Variant, Test_Result, Loci_Count, Second_Gene_Symbol, Test_Analyte_Type, Cell_Count, Second_Exon, Test_Value, Mismatch_Repair_Mutation, Clonality, Start_Days_from_Index, Cytoband, HTAN_Center, Manifest_Id, Manifest_Version) VALUES ('Not Reported', '8a35fb7c-2347-4f28-b5c5-34af6abf6fd1', NULL, 'Not Applicable', NULL, NULL, 'Not Reported', NULL, NULL, 'Not Reported', 'Not Reported', 'MolecularTest', NULL, NULL, NULL, NULL, NULL, 'HTA11_10034', 'Not Reported', 'Not Reported', NULL, NULL, NULL, NULL, NULL, 'Not Reported', 'Not Reported', 'Not Reported', NULL, NULL, 'Not Reported', 'Not Reported', NULL, 'Not Reported', 'Not Reported', NULL, NULL, NULL, 'Not Reported', NULL, '0', NULL, 'HTAN Vanderbilt', 'syn39051938', 8), ('Not Reported', 'aa1ef098-76a5-44ae-b91b-5228354fc38b', NULL, 'Not Applicable', NULL, NULL, 'Not Reported', NULL, NULL, 'Not Reported', 'Not Reported', 'MolecularTest', NULL, NULL, NULL, NULL, NULL, 'HTA11_10167', 'Not Reported', 'Not Reported', NULL, NULL, NULL, NULL, NULL, 'Not Reported', 'Not Reported', 'Not Reported', NULL, NULL, 'Not Reported', 'Not Reported', NULL, 'Not Reported', 'Not Reported', NULL, NULL, NULL, 'Not Reported', NULL, '0', NULL, 'HTAN Vanderbilt', 'syn39051938', 8), ('Not Reported', '5693d155-c204-4337-bcb5-e652aa57d6aa', NULL, 'Not Applicable', NULL, NULL, 'Not Reported', NULL, NULL, 'Not Reported', 'Not Reported', 'MolecularTest', NULL, NULL, NULL, NULL, NULL, 'HTA11_104', 'Not Reported', 'Not Reported', NULL, NULL, NULL, NULL, NULL, 'Not Reported', 'Not Reported', 'Not Reported', NULL, NULL, 'Not Reported', 'Not Reported', NULL, 'Not Reported', 'Not Reported', NULL, NULL, NULL, 'Not Reported', NULL, '0', NULL, 'HTAN Vanderbilt', 'syn39051938', 8), ('Not Reported', 'b921b4cf-59f4-4375-9b7f-794288f532bf', NULL, 'Not Applicable', NULL, NULL, 'Not Reported', NULL, NULL, 'Not Reported', 'Not Reported', 'MolecularTest', NULL, NULL, NULL, NULL, NULL, 'HTA11_10466', 'Not Reported', 'Not Reported', NULL, NULL, NULL, NULL, NULL, 'Not Reported', 'Not Reported', 'Not Reported', NULL, NULL, 'Not Reported', 'Not Reported', NULL, 'Not Reported', 'Not Reported', NULL, NULL, NULL, 'Not Reported', NULL, '0', NULL, 'HTAN Vanderbilt', 'syn39051938', 8), ('Not Reported', '32371e83-a47d-43c9-b2a6-9c99395c3ee1', NULL, 'Not Applicable', NULL, NULL, 'Not Reported', NULL, NULL, 'Not Reported', 'Not Reported', 'MolecularTest', NULL, NULL, NULL, NULL, NULL, 'HTA11_10557', 'Not Reported', 'Not Reported', NULL, NULL, NULL, NULL, NULL, 'Not Reported', 'Not Reported', 'Not Reported', NULL, NULL, 'Not Reported', 'Not Reported', NULL, 'Not Reported', 'Not Reported', NULL, NULL, NULL, 'Not Reported', NULL, '0', NULL, 'HTAN Vanderbilt', 'syn39051938', 8);