-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.imaging_level2_metadata_r3`
(
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Filename STRING OPTIONS(description="Name of a file"),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  HTAN_Participant_ID STRING OPTIONS(description="HTAN ID associated with a patient based on HTAN ID SOP (eg HTANx_yyy )"),
  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"),
  HTAN_Data_File_ID STRING OPTIONS(description="Self-identifier for this data file - HTAN ID of this file HTAN ID SOP (eg HTANx_yyy_zzz)"),
  Channel_Metadata_Filename STRING OPTIONS(description="Full path within Synapse project of uploaded companion CSV file containing channel-level metadata details"),
  Imaging_Assay_Type STRING OPTIONS(description="Type of imaging assay"),
  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."),
  Software_and_Version STRING OPTIONS(description="Name of software used to generate expression values. String"),
  Microscope STRING OPTIONS(description="Microscope type (manufacturer, model, etc) used for this experiment"),
  Objective STRING OPTIONS(description="Objective"),
  NominalMagnification STRING OPTIONS(description="The magnification of the lens as specified by the manufacturer - i.e. '60' is a 60X lens. floating point value > 1(no units)"),
  LensNA STRING OPTIONS(description="The numerical aperture of the lens. Floating point value > 0."),
  WorkingDistance STRING OPTIONS(description="The working distance of the lens, expressed as a floating point number. Floating point > 0."),
  WorkingDistanceUnit STRING OPTIONS(description="The units of the working distance. See OME enumeration of allowed values for the UnitsLength attribute -- default: microns (um)"),
  Immersion STRING OPTIONS(description="Immersion medium"),
  Pyramid STRING OPTIONS(description="Does data file contain pyramid of images"),
  Zstack STRING OPTIONS(description="Does data file contain a Z-stack of images"),
  Tseries STRING OPTIONS(description="Does data file contain a time-series of images"),
  Passed_QC STRING OPTIONS(description="Did all channels pass QC (if not add free text Comment)"),
  Comment STRING OPTIONS(description="Free text field (generally for QC comment)"),
  FOV_number STRING OPTIONS(description="Index of FOV (as it pertains to its sequence order). Integer >= 1"),
  FOVX STRING OPTIONS(description="Field of view X dimension. Floating point"),
  FOVXUnit STRING OPTIONS(description="Field of view X dimension units. See OME enumeration of allowed values for the UnitsLength attribute -- default: microns (um)"),
  FOVY STRING OPTIONS(description="Field  of view Y dimension. Floating point value"),
  FOVYUnit STRING OPTIONS(description="Field of view Y dimension units. See OME enumeration of allowed values for the UnitsLength attribute -- default: microns (um)"),
  Frame_Averaging STRING OPTIONS(description="Number of frames averaged together (if no averaging, set to 1). Integer >= 1"),
  Image_ID STRING OPTIONS(description="Unique internal image identifier. eg \"Image:0\". (To be extracted from OME-XML)"),
  DimensionOrder STRING OPTIONS(description="The order in which the individual planes of data are interleaved."),
  PhysicalSizeX STRING OPTIONS(description="Physical size (X-dimension) of a pixel. Units are set by PhysicalSizeXUnit. Floating point value > 0."),
  PhysicalSizeXUnit STRING OPTIONS(description="The units of the physical size of a pixel. See OME enumeration of allowed values for the UnitsLength attribute -- default: microns (um)"),
  PhysicalSizeY STRING OPTIONS(description="Physical size (Y-dimension) of a pixel. Units are set by PhysicalSizeYUnit. Floating point value > 0."),
  PhysicalSizeYUnit STRING OPTIONS(description="The units of the physical size of a pixel. See OME enumeration of allowed values for the UnitsLength attribute -- default: microns (um)"),
  PhysicalSizeZ STRING OPTIONS(description="Physical size (Z-dimension) of a pixel. Units are set by PhysicalSizeZUnit. Floating point value > 0."),
  PhysicalSizeZUnit STRING OPTIONS(description="The units of the physical size of a pixel. See OME enumeration of allowed values for the UnitsLength attribute -- default: microns (um)"),
  Pixels_BigEndian STRING OPTIONS(description="Boolean (True/False)"),
  PlaneCount STRING OPTIONS(description="Number of Z-planes (not to be confused with downsampled \"pyramid\"). Integer >=1"),
  SizeC STRING OPTIONS(description="Number of channels. Integer >= 1"),
  SizeT STRING OPTIONS(description="Number of time points. Integer >= 1"),
  SizeX STRING OPTIONS(description="Size of image: X dimension (in pixels). Integer >= 1"),
  SizeY STRING OPTIONS(description="Size of image: Y dimension (in pixels). Integer >= 1"),
  SizeZ STRING OPTIONS(description="Size of image: Z dimension (in pixels). Integer >= 1"),
  PixelType STRING OPTIONS(description="Data type for each pixel value. E.g. \"uint16\""),
  MERFISH_Positions_File STRING OPTIONS(description="The positions file is an auxiliary MERFISH file that describes the location of bead positions in the assay."),
  MERFISH_Codebook_File STRING OPTIONS(description="The codebook is an auxiliary MERFISH file that describes how each grouping of bits is converted to a gene name."),
  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"),
  Manifest_Version INT64 OPTIONS(description="Latest version of metadata manifest"),
  Uuid STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  File_Size INT64 OPTIONS(description="Size of file (bucket object) in bytes"),
  md5 STRING OPTIONS(description="md5 hash of file"),
  CDS_Release STRING OPTIONS(description="CDS transfer package in which file was included e.g. v22.6.1.seq")
)
OPTIONS(
  friendly_name="HTAN IMAGING LEVEL 2 METADATA R3 VERSIONED",
  description="This table contains the file metadata for imaging information in a single file format, such as tiled and pyramidal OME-TIFFs. Multiplex imaging files are accompanied by a csv file containing channel metadata. Data was extracted from HTAN Synapse projects in April 2023. More details: see https://data.humantumoratlas.org/standard/imaging",
  labels=[("access", "open"), ("data_type", "file_metadata"), ("program", "htan"), ("source", "htan"), ("status", "current"), ("category", "metadata")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.imaging_level2_metadata_r3` (Component, Filename, File_Format, HTAN_Participant_ID, HTAN_Parent_Biospecimen_ID, HTAN_Data_File_ID, Channel_Metadata_Filename, Imaging_Assay_Type, Protocol_Link, Software_and_Version, Microscope, Objective, NominalMagnification, LensNA, WorkingDistance, WorkingDistanceUnit, Immersion, Pyramid, Zstack, Tseries, Passed_QC, Comment, FOV_number, FOVX, FOVXUnit, FOVY, FOVYUnit, Frame_Averaging, Image_ID, DimensionOrder, PhysicalSizeX, PhysicalSizeXUnit, PhysicalSizeY, PhysicalSizeYUnit, PhysicalSizeZ, PhysicalSizeZUnit, Pixels_BigEndian, PlaneCount, SizeC, SizeT, SizeX, SizeY, SizeZ, PixelType, MERFISH_Positions_File, MERFISH_Codebook_File, entityId, HTAN_Center, Data_Release, Manifest_Version, Uuid, File_Size, md5, CDS_Release) VALUES ('ImagingLevel2', 'h_and_e_multi_assay_breast/BPC-20-ZC-1879-3.svs', 'svs', 'HTA1_213', 'HTA1_213_6752301', 'HTA1_213_67523011', 'Not Applicable', 'H&E', 'https://www.protocols.io/view/htapp-multi-assay-sectioning-of-oct-embedded-sampl-bk95kz86, https://www.protocols.io/view/htapp-hematoxylin-and-eosin-h-e-staining-protocol-8pphvmn', 'Aperio ScanScope XT Controller', 'Aperio ScanScope XT', NULL, '20x', NULL, NULL, NULL, NULL, 'No', 'No', 'No', 'Yes', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Not Applicable', 'XYCZT', '0.2762', 'µm', '0.2762', 'µm', 'Not applicable', 'µm', 'False', '1', '1', '1', '17464', '21617', '1', 'uint8', NULL, NULL, 'syn25882277', 'HTAN HTAPP', 'Release 3.0', 1, 'd1cd59ff-4583-44c1-9728-2bceb2a10b49', 260280217, '718c18d7184735c002bd35ef5863522f', NULL), ('ImagingLevel2', 'h_and_e_multi_assay_breast/BPC-20-ZC-1879-4.svs', 'svs', 'HTA1_213', 'HTA1_213_6752306', 'HTA1_213_67523061', 'Not Applicable', 'H&E', 'https://www.protocols.io/view/htapp-multi-assay-sectioning-of-oct-embedded-sampl-bk95kz86, https://www.protocols.io/view/htapp-hematoxylin-and-eosin-h-e-staining-protocol-8pphvmn', 'Aperio ScanScope XT Controller', 'Aperio ScanScope XT', NULL, '20x', NULL, NULL, NULL, NULL, 'No', 'No', 'No', 'Yes', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Not Applicable', 'XYCZT', '0.2762', 'µm', '0.2762', 'µm', 'Not applicable', 'µm', 'False', '1', '1', '1', '21440', '19911', '1', 'uint8', NULL, NULL, 'syn25882273', 'HTAN HTAPP', 'Release 3.0', 1, '0a641b18-3bdc-4226-8cbf-897d6239b570', 285750625, '46632245064a521bae8c04fd40649146', NULL), ('ImagingLevel2', 'h_and_e_multi_assay_breast/BPC-20-ZC-1879-1.svs', 'svs', 'HTA1_514', 'HTA1_514_6760306', 'HTA1_514_67603061', 'Not Applicable', 'H&E', 'https://www.protocols.io/view/htapp-multi-assay-sectioning-of-oct-embedded-sampl-bk95kz86, https://www.protocols.io/view/htapp-hematoxylin-and-eosin-h-e-staining-protocol-8pphvmn', 'Aperio ScanScope XT Controller', 'Aperio ScanScope XT', NULL, '20x', NULL, NULL, NULL, NULL, 'No', 'No', 'No', 'Yes', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Not Applicable', 'XYCZT', '0.2762', 'µm', '0.2762', 'µm', 'Not applicable', 'µm', 'False', '1', '1', '1', '23854', '22186', '1', 'uint8', NULL, NULL, 'syn25882276', 'HTAN HTAPP', 'Release 3.0', 1, 'ccbddbb7-b6c3-4724-85d4-a44b7e5850c4', 398560551, '388865d6346d14bb38081d988ed5d3a6', NULL), ('ImagingLevel2', 'h_and_e_multi_assay_breast/BPC-20-ZC-1879-2.svs', 'svs', 'HTA1_514', 'HTA1_514_6760301', 'HTA1_514_67603011', 'Not Applicable', 'H&E', 'https://www.protocols.io/view/htapp-multi-assay-sectioning-of-oct-embedded-sampl-bk95kz86, https://www.protocols.io/view/htapp-hematoxylin-and-eosin-h-e-staining-protocol-8pphvmn', 'Aperio ScanScope XT Controller', 'Aperio ScanScope XT', NULL, '20x', NULL, NULL, NULL, NULL, 'No', 'No', 'No', 'Yes', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Not Applicable', 'XYCZT', '0.2762', 'µm', '0.2762', 'µm', 'Not applicable', 'µm', 'False', '1', '1', '1', '23570', '22044', '1', 'uint8', NULL, NULL, 'syn25882275', 'HTAN HTAPP', 'Release 3.0', 1, 'eba88b84-43d4-4997-9612-10c235ac9579', 384287035, 'd740b1ff3b038012008f5ab2f844f18d', NULL), ('ImagingLevel2', 'h_and_e_multi_assay_breast/BPC-20-ZC-1879-5.svs', 'svs', 'HTA1_812', 'HTA1_812_8239306', 'HTA1_812_82393061', 'Not Applicable', 'H&E', 'https://www.protocols.io/view/htapp-multi-assay-sectioning-of-oct-embedded-sampl-bk95kz86, https://www.protocols.io/view/htapp-hematoxylin-and-eosin-h-e-staining-protocol-8pphvmn', 'Aperio ScanScope XT Controller', 'Aperio ScanScope XT', NULL, '20x', NULL, NULL, NULL, NULL, 'No', 'No', 'No', 'Yes', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Not Applicable', 'XYCZT', '0.2762', 'µm', '0.2762', 'µm', 'Not applicable', 'µm', 'False', '1', '1', '1', '9513', '42808', '1', 'uint8', NULL, NULL, 'syn25882282', 'HTAN HTAPP', 'Release 3.0', 1, '82f9347c-637f-450d-8873-b7417ace7e72', 284707487, '5c3db5910d72fea053f8baee8545c0fb', NULL);