-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.biospecimen_r4`
(
  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"),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  Histology_Assessment_By STRING OPTIONS(description="Text term describing who (in what role) made the histological assessments of the sample"),
  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]"),
  Analyte_Type STRING OPTIONS(description="The kind of molecular specimen analyte: a molecular derivative (I.e. RNA / DNA / Protein Lysate) obtained from a specimen"),
  Sectioning_Days_from_Index STRING OPTIONS(description="Number of days from the research participant's index date that the biospecimen was sectioned after collection. If not applicable please enter 'Not Applicable'"),
  Percent_Lymphocyte_Infiltration STRING OPTIONS(description="Numeric value to represent the percentage of infiltration by lymphocytes in a solid tissue normal sample or specimen."),
  Lysis_Buffer STRING OPTIONS(description="scRNA-seq specific: Type of lysis buffer used"),
  Slide_Charge_Type STRING OPTIONS(description="A description of the charge on the glass slide."),
  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."),
  Preinvasive_Morphology STRING OPTIONS(description="Histologic Morphology not included in ICD-O-3 morphology codes, for preinvasive lesions included in the HTAN"),
  Collection_Days_from_Index STRING OPTIONS(description="Number of days from the research participant's index date that the biospecimen was obtained. If not applicable please enter 'Not Applicable'"),
  Tumor_Infiltrating_Lymphocytes STRING OPTIONS(description="Measure of Tumor-Infiltrating Lymphocytes [Number]"),
  Percent_Monocyte_Infiltration STRING OPTIONS(description="Numeric value to represent the percentage of monocyte infiltration in a sample or specimen."),
  Specimen_Laterality STRING OPTIONS(description="For tumors in paired organs, designates the side on which the specimen was obtained."),
  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."),
  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."),
  Slicing_Method STRING OPTIONS(description="Imaging specific: the method by which the tissue was sliced."),
  Percent_Neutrophil_Infiltration STRING OPTIONS(description="Numeric value to represent the percentage of infiltration by neutrophils 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."),
  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"),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  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."),
  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"),
  Acquisition_Method_Other_Specify STRING OPTIONS(description="A custom acquisition method [Text - max length 100 characters]"),
  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]"),
  Collection_Media STRING OPTIONS(description="Material Specimen is collected into post procedure"),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Percent_Eosinophil_Infiltration STRING OPTIONS(description="Numeric value to represent the percentage of infiltration by eosinophils in a tumor sample or specimen."),
  Preservation_Method STRING OPTIONS(description="Text term that represents the method used to preserve the sample."),
  Shipping_Condition_Type STRING OPTIONS(description="Text descriptor of the shipping environment of a biospecimen."),
  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)."),
  Percent_Granulocyte_Infiltration STRING OPTIONS(description="Numeric value to represent the percentage of infiltration by granulocytes in a tumor sample or specimen."),
  HTAN_Biospecimen_ID STRING OPTIONS(description="HTAN ID associated with a biosample based on HTAN ID SOP (eg HTANx_yyy_zzz)"),
  Percent_Normal_Cells STRING OPTIONS(description="Numeric value to represent the percentage of normal cell content in a malignant tumor sample or specimen."),
  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."),
  Ischemic_Temperature STRING OPTIONS(description="Specify whether specimen experienced warm or cold ischemia."),
  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. If not applicable please enter 'Not Applicable'"),
  Percent_Necrosis STRING OPTIONS(description="Numeric value to represent the percentage of cell death in a malignant tumor sample or specimen."),
  Site_of_Resection_or_Biopsy STRING OPTIONS(description="The text term used to describe the anatomic site of the resection or biopsy of the patient's malignant disease, as described by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O)."),
  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."),
  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"),
  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"),
  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."),
  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"),
  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"),
  Histology_Assessment_Medium STRING OPTIONS(description="The method of assessment used to characterize histology"),
  Number_Proliferating_Cells STRING OPTIONS(description="Numeric value that represents the count of proliferating cells determined during pathologic review of the sample slide(s)."),
  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)"),
  Acquisition_Method_Type STRING OPTIONS(description="Records the method of acquisition or source for the specimen under consideration."),
  Fiducial_Marker STRING OPTIONS(description="Imaging specific: fiducial markers for the alignment of images taken across multiple rounds of imaging."),
  Percent_Tumor_Nuclei STRING OPTIONS(description="Numeric value to represent the percentage of tumor nuclei in a malignant neoplasm sample or specimen."),
  Fixative_Type STRING OPTIONS(description="Text term to identify the type of fixative used to preserve a tissue 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)"),
  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)."),
  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."),
  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 BIOSPECIMEN DATA R4 VERSIONED",
  description="This table captures essential biospecimen data elements from HTAN samples. Data was extracted from HTAN Synapse projects in October 2023. 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_r4` (Biospecimen_Dimension_1, Id, Histology_Assessment_By, Dysplasia_Fraction, Analyte_Type, Sectioning_Days_from_Index, Percent_Lymphocyte_Infiltration, Lysis_Buffer, Slide_Charge_Type, Timepoint_Label, Preinvasive_Morphology, Collection_Days_from_Index, Tumor_Infiltrating_Lymphocytes, Percent_Monocyte_Infiltration, Specimen_Laterality, HTAN_Parent_ID, Protocol_Link, Slicing_Method, Percent_Neutrophil_Infiltration, Percent_Inflam_Infiltration, Biospecimen_Dimension_2, entityId, Percent_Stromal_Cells, Percent_Tumor_Cells, Portion_Weight, Total_Volume, Acquisition_Method_Other_Specify, Method_of_Nucleic_Acid_Isolation, Collection_Media, Component, Percent_Eosinophil_Infiltration, Preservation_Method, Shipping_Condition_Type, Section_Thickness_Value, Percent_Granulocyte_Infiltration, HTAN_Biospecimen_ID, Percent_Normal_Cells, Degree_of_Dysplasia, Ischemic_Temperature, Storage_Method, Processing_Days_from_Index, Percent_Necrosis, Site_of_Resection_or_Biopsy, Fixation_Duration, Ischemic_Time, Histologic_Morphology_Code, Biospecimen_Dimension_3, Site_Data_Source, Adjacent_Biospecimen_IDs, Biospecimen_Type, Mounting_Medium, Histology_Assessment_Medium, Number_Proliferating_Cells, Section_Number_in_Sequence, Acquisition_Method_Type, Fiducial_Marker, Percent_Tumor_Nuclei, Fixative_Type, Tumor_Tissue_Type, Source_HTAN_Biospecimen_ID, Processing_Location, HTAN_Center, Manifest_Id, Manifest_Version) VALUES (NULL, 'a5e6f903-9102-4857-8692-ec78c35eeb5a', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'final', NULL, '20980', NULL, NULL, NULL, 'HTA8_1026', 'https://www.protocols.io/view/copy-of-cell-preparation-for-scrna-seq-from-dilute-bnyymfxw', NULL, NULL, NULL, NULL, 'syn24983217', NULL, NULL, NULL, NULL, 'Needle aspiration', NULL, NULL, 'Biospecimen', NULL, 'Fresh dissociated and single cell sorted', NULL, NULL, NULL, 'HTA8_1026_1', NULL, NULL, NULL, 'Fresh', '20980', NULL, 'Brain NOS', NULL, NULL, '8140/3', NULL, NULL, NULL, 'Fluids Biospecimen Type', NULL, NULL, NULL, NULL, 'Other Acquisition Method', NULL, NULL, NULL, 'Metastatic', NULL, NULL, 'HTAN MSK', 'syn39256250', 9), (NULL, 'be7662f5-f4e1-497c-b3b4-68326fad794f', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'on treatment', NULL, '23008', NULL, NULL, NULL, 'HTA8_1027', 'https://www.protocols.io/view/copy-of-cell-preparation-for-scrna-seq-from-dilute-bnyymfxw', NULL, NULL, NULL, NULL, 'syn24983218', NULL, NULL, NULL, NULL, 'Needle aspiration', NULL, NULL, 'Biospecimen', NULL, 'Fresh dissociated and single cell sorted', NULL, NULL, NULL, 'HTA8_1027_1', NULL, NULL, NULL, 'Fresh', '23008', NULL, 'Brain NOS', NULL, NULL, '8140/3', NULL, NULL, NULL, 'Fluids Biospecimen Type', NULL, NULL, NULL, NULL, 'Other Acquisition Method', NULL, NULL, NULL, 'Metastatic', NULL, NULL, 'HTAN MSK', 'syn39256250', 9), (NULL, '4b7d9a6b-0529-4763-bd9d-fce742bc2c24', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'baseline', NULL, '26678', NULL, NULL, NULL, 'HTA8_2012', 'dx.doi.org/10.17504/protocols.io.bjyzkpx6', NULL, NULL, NULL, NULL, 'syn24983234', NULL, NULL, NULL, NULL, 'Needle aspiration', NULL, NULL, 'Biospecimen', NULL, 'Fresh dissociated and single cell sorted', NULL, NULL, NULL, 'HTA8_2012_1', NULL, NULL, NULL, 'Fresh', '26678', NULL, 'Pleura NOS', NULL, NULL, '8041/3', NULL, NULL, NULL, 'Fluids Biospecimen Type', NULL, NULL, NULL, NULL, 'Other Acquisition Method', NULL, NULL, NULL, 'Metastatic', NULL, NULL, 'HTAN MSK', 'syn39256250', 9), (NULL, '9ccd07ce-bb78-4f21-aaae-24f8e99130b3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Not recorded', NULL, '18834', NULL, NULL, NULL, 'HTA1_613', 'Not Available', NULL, NULL, NULL, NULL, 'syn27208165', NULL, NULL, NULL, NULL, 'Paracentesis', NULL, NULL, 'Biospecimen', NULL, 'Fresh', NULL, NULL, NULL, 'HTA1_613_3121', NULL, NULL, NULL, 'Fresh', '18834', NULL, 'Other ill-defined sites', NULL, NULL, '8441/3', NULL, NULL, NULL, 'Ascites Biospecimen Type', NULL, NULL, NULL, NULL, 'Other Acquisition Method', NULL, NULL, NULL, NULL, NULL, NULL, 'HTAN HTAPP', 'syn42243451', 1), (NULL, '24e4cfd1-7779-4e27-992f-1a3a9fc7992c', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Not recorded', NULL, '18834', NULL, NULL, NULL, 'HTA1_613_3121', 'Not Available', NULL, NULL, NULL, NULL, 'syn27208166', NULL, NULL, NULL, NULL, 'Paracentesis', NULL, NULL, 'Biospecimen', NULL, 'Fresh', NULL, NULL, NULL, 'HTA1_613_31211', NULL, NULL, NULL, 'Fresh', '18834', NULL, 'Other ill-defined sites', NULL, NULL, '8441/3', NULL, NULL, NULL, 'Ascites Biospecimen Type', NULL, NULL, NULL, NULL, 'Other Acquisition Method', NULL, NULL, NULL, NULL, NULL, NULL, 'HTAN HTAPP', 'syn42243451', 1);