-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.biospecimen_r2`
(
  HTAN_Biospecimen_ID STRING OPTIONS(description="HTAN ID associated with a biosample based on HTAN ID SOP (eg HTANx_yyy_zzz)"),
  HTAN_Parent_ID STRING OPTIONS(description="HTAN ID of parent from which the biospecimen was obtained. Parent could be another biospecimen or a research participant."),
  HTAN_Parent_Biospecimen_ID STRING OPTIONS(description="HTAN Biospecimen Identifier (eg HTANx_yyy_zzz) indicating the biospecimen(s) from which these files were derived; multiple parent biospecimen should be comma-separated"),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Source_HTAN_Biospecimen_ID STRING OPTIONS(description="This is the HTAN ID that may have been assigned to the biospecimen at the site of biospecimen origin (e.g. BU)."),
  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."),
  Collection_Days_from_Index STRING OPTIONS(description="Number of days from the research participant's index date that the biospecimen was obtained."),
  Adjacent_Biospecimen_IDs STRING OPTIONS(description="List of HTAN Identifiers (separated by commas) of adjacent biospecimens cut from the same sample; for example HTA3_3000_3, HTA3_3000_4, ..."),
  Biospecimen_Type STRING OPTIONS(description="Biospecimen Type"),
  Acquisition_Method_Type STRING OPTIONS(description="Records the method of acquisition or source for the specimen under consideration."),
  Fixative_Type STRING OPTIONS(description="Text term to identify the type of fixative used to preserve a tissue specimen"),
  Site_of_Resection_or_Biopsy STRING OPTIONS(description="The text term used to describe the anatomic site of origin, of the patient's malignant disease, as described by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O)."),
  Storage_Method STRING OPTIONS(description="The method by which a biomaterial was stored after preservation or before another protocol was used."),
  Processing_Days_from_Index STRING OPTIONS(description="Number of days from the research participant's index date that the biospecimen was processed"),
  Protocol_Link STRING OPTIONS(description="Protocols.io ID or DOI link to a free/open protocol resource describing in detail the assay protocol (e.g. surface markers used in Smart-seq, dissociation duration,  lot/batch numbers for key reagents such as primers, sequencing reagent kits, etc.) or the protocol by which the sample was obtained or generated."),
  Site_Data_Source STRING OPTIONS(description="Text to identify the data source for the specimen/sample from within the HTAN center, if applicable. Any identifier used within the center to identify data sources. No PHI/PII is allowed."),
  Collection_Media STRING OPTIONS(description="Material Specimen is collected into post procedure"),
  Mounting_Medium STRING OPTIONS(description="The solution in which the specimen is embedded, generally under a cover glass. It may be liquid, gum or resinous, soluble in water, alcohol or other solvents and be sealed from the external atmosphere by non-soluble ringing media"),
  Processing_Location STRING OPTIONS(description="Site with an HTAN center where specimen processing occurs, if applicable. Any identifier used within the center to identify processing location. No PHI/PII is allowed."),
  Histology_Assessment_By STRING OPTIONS(description="Text term describing who (in what role) made the histological assessments of the sample"),
  Histology_Assessment_Medium STRING OPTIONS(description="The method of assessment used to characterize histology"),
  Preinvasive_Morphology STRING OPTIONS(description="Histologic Morphology not included in ICD-O-3 morphology codes, for preinvasive lesions included in the HTAN"),
  Tumor_Infiltrating_Lymphocytes STRING OPTIONS(description="Measure of Tumor-Infiltrating Lymphocytes [Number]"),
  Degree_of_Dysplasia STRING OPTIONS(description="Information related to the presence of cells that look abnormal under a microscope but are not cancer. Records the degree of dysplasia for the cyst or lesion under consideration."),
  Dysplasia_Fraction STRING OPTIONS(description="Resulting value to represent the number of pieces of dysplasia divided by the total number of pieces. [Text: max length 5]"),
  Number_Proliferating_Cells STRING OPTIONS(description="Numeric value that represents the count of proliferating cells determined during pathologic review of the sample slide(s)."),
  Percent_Eosinophil_Infiltration STRING OPTIONS(description="Numeric value to represent the percentage of infiltration by eosinophils in a tumor sample or specimen."),
  Percent_Granulocyte_Infiltration STRING OPTIONS(description="Numeric value to represent the percentage of infiltration by granulocytes in a tumor sample or specimen."),
  Percent_Inflam_Infiltration STRING OPTIONS(description="Numeric value to represent local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."),
  Percent_Lymphocyte_Infiltration STRING OPTIONS(description="Numeric value to represent the percentage of infiltration by lymphocytes in a solid tissue normal sample or specimen."),
  Percent_Monocyte_Infiltration STRING OPTIONS(description="Numeric value to represent the percentage of monocyte infiltration in a sample or specimen."),
  Percent_Necrosis STRING OPTIONS(description="Numeric value to represent the percentage of cell death in a malignant tumor sample or specimen."),
  Percent_Neutrophil_Infiltration STRING OPTIONS(description="Numeric value to represent the percentage of infiltration by neutrophils in a tumor sample or specimen."),
  Percent_Normal_Cells STRING OPTIONS(description="Numeric value to represent the percentage of normal cell content in a malignant tumor sample or specimen."),
  Percent_Stromal_Cells STRING OPTIONS(description="Numeric value to represent the percentage of reactive cells that are present in a malignant tumor sample or specimen but are not malignant such as fibroblasts, vascular structures, etc."),
  Percent_Tumor_Cells STRING OPTIONS(description="Numeric value that represents the percentage of infiltration by tumor cells in a sample."),
  Percent_Tumor_Nuclei STRING OPTIONS(description="Numeric value to represent the percentage of tumor nuclei in a malignant neoplasm sample or specimen."),
  Fiducial_Marker STRING OPTIONS(description="Imaging specific: fiducial markers for the alignment of images taken across multiple rounds of imaging."),
  Slicing_Method STRING OPTIONS(description="Imaging specific: the method by which the tissue was sliced."),
  Lysis_Buffer STRING OPTIONS(description="scRNA-seq specific: Type of lysis buffer used"),
  Method_of_Nucleic_Acid_Isolation STRING OPTIONS(description="Bulk RNA & DNA-seq specific: method used for nucleic acid isolation. E.g. Qiagen Allprep, Qiagen miRNAeasy. [Text - max length 100]"),
  Analyte_Type STRING OPTIONS(description="The kind of molecular specimen analyte: a molecular derivative (I.e. RNA / DNA / Protein Lysate) obtained from a specimen"),
  Acquisition_Method_Other_Specify STRING OPTIONS(description="A custom acquisition method [Text - max length 100 characters]"),
  Preservation_Method STRING OPTIONS(description="Text term that represents the method used to preserve the sample."),
  Fixation_Duration STRING OPTIONS(description="The length of time, from beginning to end, required to process or preserve biospecimens in fixative (measured in minutes)"),
  Ischemic_Time STRING OPTIONS(description="Duration of time, in seconds, between when the specimen stopped receiving oxygen and when it was preserved or processed. Integer value."),
  Ischemic_Temperature STRING OPTIONS(description="Specify whether specimen experienced warm or cold ischemia."),
  Specimen_Laterality STRING OPTIONS(description="For tumors in paired organs, designates the side on which the specimen was obtained."),
  Portion_Weight STRING OPTIONS(description="Numeric value that represents the sample portion weight, measured in milligrams."),
  Total_Volume STRING OPTIONS(description="Numeric value for the total amount of sample or specimen"),
  Total_Volume_Unit STRING OPTIONS(description="Unit of measurement used for the total amount of sample or specimen"),
  Tumor_Tissue_Type STRING OPTIONS(description="Text that describes the kind of disease present in the tumor specimen as related to a specific timepoint (add rows to select multiple values along with timepoints)"),
  Histologic_Morphology_Code STRING OPTIONS(description="Histologic Morphology Code, based on ICD-O-3. Any valid ICD-O-3 morphology code. See https://seer.cancer.gov/icd-o-3/ and https://seer.cancer.gov/icd-o-3/sitetype.icdo3.20200629.xlsx. Examples: 80510"),
  Slide_Charge_Type STRING OPTIONS(description="A description of the charge on the glass slide."),
  Section_Thickness_Value STRING OPTIONS(description="Numeric value to describe the thickness of a slice to tissue taken from a biospecimen, measured in microns (um)."),
  Sectioning_Days_from_Index STRING OPTIONS(description="Number of days from the research participant's index date that the biospecimen was sectioned after collection"),
  Shipping_Condition_Type STRING OPTIONS(description="Text descriptor of the shipping environment of a biospecimen."),
  Antigen_Retrieval STRING OPTIONS(description="Imaging specific: information on antigen retrieval when it is used for a pathology specimen. E.g. pH 6 (Citric Acid), pH 8 (tris), or pH 10. [Text - max length 100] "),
  Biospecimen_Slide_Location STRING OPTIONS(description="Imaging specific: text term to capture the relative position and orientation of the core location within a piece of tissue on the slide relative to the region of interest slide coordinates. use https://docs.openmicroscopy.org/ome-model/6.0.1/developers/roi.html#shape-concrete-implementations if applciable"),
  Staining_Markers STRING OPTIONS(description="Imaging specific: text to identify proteins/ antibodies selected for staining"),
  Biospecimen_Dimension_1 STRING OPTIONS(description="First dimension of tissue fragment (number, up to one decimal place) measured in units as defined by the \"dimensions_unit\" CDE"),
  Biospecimen_Dimension_2 STRING OPTIONS(description="Second dimension of tissue fragment (number, up to one decimal place) measured in units as defined by the \"dimensions_unit\" CDE"),
  Biospecimen_Dimension_3 STRING OPTIONS(description="Third dimension of tissue fragment (number, up to one decimal place) measured in units as defined by the \"dimensions_unit\" CDE"),
  Dimensions_Unit STRING OPTIONS(description="Unit of measurement used for dimension CDEs in metric system (i.e. cm, mm, etc)"),
  Section_Number_in_Sequence STRING OPTIONS(description="Numeric value (integer, including ranges) provided to a sample in a series of sections (list all adjacent sections in the Adjacent Biospecimen IDs field)"),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  HTAN_Center STRING OPTIONS(description="Name of HTAN Center e.g. HTAN HTAPP"),
  Data_Release STRING OPTIONS(description="Inclusion in HTAN Data Release e.g. Release 1.0")
)
OPTIONS(
  friendly_name="HTAN BIOSPECIMEN DATA R2 VERSIONED",
  description="Data was extracted from HTAN Synapse projects in April 2022. More details: see https://data.humantumoratlas.org/standard/biospecimen",
  labels=[("access", "open"), ("data_type", "biospecimen"), ("program", "htan"), ("source", "htan"), ("category", "clinical_biospecimen_data"), ("status", "current")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.biospecimen_r2` (HTAN_Biospecimen_ID, HTAN_Parent_ID, HTAN_Parent_Biospecimen_ID, Component, Source_HTAN_Biospecimen_ID, Timepoint_Label, Collection_Days_from_Index, Adjacent_Biospecimen_IDs, Biospecimen_Type, Acquisition_Method_Type, Fixative_Type, Site_of_Resection_or_Biopsy, Storage_Method, Processing_Days_from_Index, Protocol_Link, Site_Data_Source, Collection_Media, Mounting_Medium, Processing_Location, Histology_Assessment_By, Histology_Assessment_Medium, Preinvasive_Morphology, Tumor_Infiltrating_Lymphocytes, Degree_of_Dysplasia, Dysplasia_Fraction, Number_Proliferating_Cells, Percent_Eosinophil_Infiltration, Percent_Granulocyte_Infiltration, Percent_Inflam_Infiltration, Percent_Lymphocyte_Infiltration, Percent_Monocyte_Infiltration, Percent_Necrosis, Percent_Neutrophil_Infiltration, Percent_Normal_Cells, Percent_Stromal_Cells, Percent_Tumor_Cells, Percent_Tumor_Nuclei, Fiducial_Marker, Slicing_Method, Lysis_Buffer, Method_of_Nucleic_Acid_Isolation, Analyte_Type, Acquisition_Method_Other_Specify, Preservation_Method, Fixation_Duration, Ischemic_Time, Ischemic_Temperature, Specimen_Laterality, Portion_Weight, Total_Volume, Total_Volume_Unit, Tumor_Tissue_Type, Histologic_Morphology_Code, Slide_Charge_Type, Section_Thickness_Value, Sectioning_Days_from_Index, Shipping_Condition_Type, Antigen_Retrieval, Biospecimen_Slide_Location, Staining_Markers, Biospecimen_Dimension_1, Biospecimen_Dimension_2, Biospecimen_Dimension_3, Dimensions_Unit, Section_Number_in_Sequence, entityId, HTAN_Center, Data_Release) VALUES ('HTA11_10167_2000002021', 'HTA11_10167', 'None', 'Biospecimen', 'None', 'Enrollment', '19147', 'None', 'Tissue Biospecimen Type', 'Biopsy', 'None', 'Descending colon', 'Fresh', '19147', '0', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'Fresh', 'None', 'None', 'None', 'Not Applicable', 'None', 'None', 'None', 'Normal', '0', 'None', 'None', 'None', 'Not Shipped', 'None', 'None', 'None', 'Not Applicable', 'Not Applicable', 'Not Applicable', 'None', 'Not Applicable', 'syn27121780', 'HTAN Vanderbilt', 'Release 2.0'), ('HTA11_104_2000002011', 'HTA11_104', 'None', 'Biospecimen', 'None', 'Enrollment', '19759', 'None', 'Tissue Biospecimen Type', 'Biopsy', 'None', 'Ascending colon', 'Fresh', '19759', '0', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'Fresh', 'None', 'None', 'None', 'Not Applicable', 'None', 'None', 'None', 'Normal', '0', 'None', 'None', 'None', 'Not Shipped', 'None', 'None', 'None', 'Not Applicable', 'Not Applicable', 'Not Applicable', 'None', 'Not Applicable', 'syn27121783', 'HTAN Vanderbilt', 'Release 2.0'), ('HTA11_1938_2000002011', 'HTA11_1938', 'None', 'Biospecimen', 'None', 'Enrollment', '19518', 'None', 'Tissue Biospecimen Type', 'Biopsy', 'None', 'Ascending colon', 'Fresh', '19518', '0', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'Fresh', 'None', 'None', 'None', 'Not Applicable', 'None', 'None', 'None', 'Normal', '0', 'None', 'None', 'None', 'Not Shipped', 'None', 'None', 'None', 'Not Applicable', 'Not Applicable', 'Not Applicable', 'None', 'Not Applicable', 'syn27121798', 'HTAN Vanderbilt', 'Release 2.0'), ('HTA11_2487_2000002011', 'HTA11_2487', 'None', 'Biospecimen', 'None', 'Enrollment', '23720', 'None', 'Tissue Biospecimen Type', 'Biopsy', 'None', 'Ascending colon', 'Fresh', '23720', '0', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'Fresh', 'None', 'None', 'None', 'Not Applicable', 'None', 'None', 'None', 'Normal', '0', 'None', 'None', 'None', 'Not Shipped', 'None', 'None', 'None', 'Not Applicable', 'Not Applicable', 'Not Applicable', 'None', 'Not Applicable', 'syn27121807', 'HTAN Vanderbilt', 'Release 2.0'), ('HTA11_2951_2000002011', 'HTA11_2951', 'None', 'Biospecimen', 'None', 'Enrollment', '18325', 'None', 'Tissue Biospecimen Type', 'Biopsy', 'None', 'Ascending colon', 'Fresh', '18325', '0', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'Fresh', 'None', 'None', 'None', 'Not Applicable', 'None', 'None', 'None', 'Normal', '0', 'None', 'None', 'None', 'Not Shipped', 'None', 'None', 'None', 'Not Applicable', 'Not Applicable', 'Not Applicable', 'None', 'Not Applicable', 'syn27121810', 'HTAN Vanderbilt', 'Release 2.0');