-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.imaging_level2_metadata_r5`
(
  Pyramid STRING OPTIONS(description="Does data file contain pyramid of images"),
  Channel_Metadata_Filename STRING OPTIONS(description="Full path within Synapse project of uploaded companion CSV file containing channel-level metadata details"),
  Frame_Averaging STRING OPTIONS(description="Number of frames averaged together (if no averaging, set to 1). Integer >= 1"),
  PlaneCount STRING OPTIONS(description="Number of Z-planes (not to be confused with downsampled \"pyramid\"). Integer >=1"),
  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)"),
  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."),
  Objective STRING OPTIONS(description="Objective"),
  DimensionOrder STRING OPTIONS(description="The order in which the individual planes of data are interleaved."),
  WorkingDistanceUnit STRING OPTIONS(description="The units of the working distance. See OME enumeration of allowed values for the UnitsLength attribute -- default: microns (um)"),
  Image_ID STRING OPTIONS(description="Unique internal image identifier. eg \"Image:0\". (To be extracted from OME-XML)"),
  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)"),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  FOVX STRING OPTIONS(description="Field of view X dimension. Floating point"),
  Imaging_Assay_Type STRING OPTIONS(description="Type of imaging assay"),
  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"),
  FOVY STRING OPTIONS(description="Field  of view Y dimension. Floating point value"),
  Zstack STRING OPTIONS(description="Does data file contain a Z-stack of images"),
  SizeC STRING OPTIONS(description="Number of channels. Integer >= 1"),
  PhysicalSizeY STRING OPTIONS(description="Physical size (Y-dimension) of a pixel. Units are set by PhysicalSizeYUnit. Floating point value > 0."),
  SizeX STRING OPTIONS(description="Size of image: X dimension (in pixels). Integer >= 1"),
  HTAN_Parent_Data_File_ID STRING OPTIONS(description="HTAN Data File Identifier indicating the file(s) from which these files were derived"),
  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"),
  Passed_QC STRING OPTIONS(description="Did all channels pass QC (if not add free text Comment)"),
  Filename STRING OPTIONS(description="Name of a file"),
  PhysicalSizeX STRING OPTIONS(description="Physical size (X-dimension) of a pixel. Units are set by PhysicalSizeXUnit. Floating point value > 0."),
  Microscope STRING OPTIONS(description="Microscope type (manufacturer, model, etc) used for this experiment"),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  SizeT STRING OPTIONS(description="Number of time points. Integer >= 1"),
  PixelType STRING OPTIONS(description="Data type for each pixel value. E.g. \"uint16\""),
  PhysicalSizeZ STRING OPTIONS(description="Physical size (Z-dimension) of a pixel. Units are set by PhysicalSizeZUnit. Floating point value > 0."),
  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."),
  SizeY STRING OPTIONS(description="Size of image: Y dimension (in pixels). Integer >= 1"),
  Pixels_BigEndian STRING OPTIONS(description="Boolean (True/False)"),
  HTAN_Participant_ID STRING OPTIONS(description="HTAN ID associated with a patient based on HTAN ID SOP (eg HTANx_yyy )"),
  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)"),
  FOVYUnit STRING OPTIONS(description="Field of view Y dimension units. See OME enumeration of allowed values for the UnitsLength attribute -- default: microns (um)"),
  LensNA STRING OPTIONS(description="The numerical aperture of the lens. Floating point value > 0."),
  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)"),
  SizeZ STRING OPTIONS(description="Size of image: Z dimension (in pixels). Integer >= 1"),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  Immersion STRING OPTIONS(description="Immersion medium"),
  FOVXUnit STRING OPTIONS(description="Field of view X dimension units. See OME enumeration of allowed values for the UnitsLength attribute -- default: microns (um)"),
  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)"),
  MERFISH_Positions_File STRING OPTIONS(description="The positions file is an auxiliary MERFISH file that describes the location of bead positions in the assay."),
  WorkingDistance STRING OPTIONS(description="The working distance of the lens, expressed as a floating point number. Floating point > 0."),
  Tseries STRING OPTIONS(description="Does data file contain a time-series of images"),
  Software_and_Version STRING OPTIONS(description="Name of software used to generate expression values. String"),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  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"),
  File_Size INT64 OPTIONS(description="Size of file (bucket object) in bytes"),
  md5 STRING OPTIONS(description="md5 hash of file"),
  Data_Release STRING OPTIONS(description="Inclusion in HTAN Data Release e.g. Release 1.0"),
  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 R5 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 2024 and corresponds to HTAN Data Release 5.1. More details: see https://data.humantumoratlas.org/standard/imaging",
  labels=[("access", "open"), ("data_type", "file_metadata"), ("program", "htan"), ("source", "htan"), ("category", "metadata"), ("status", "current")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.imaging_level2_metadata_r5` (Pyramid, Channel_Metadata_Filename, Frame_Averaging, PlaneCount, PhysicalSizeXUnit, MERFISH_Codebook_File, Objective, DimensionOrder, WorkingDistanceUnit, Image_ID, HTAN_Data_File_ID, Component, FOVX, Imaging_Assay_Type, Comment, FOV_number, FOVY, Zstack, SizeC, PhysicalSizeY, SizeX, HTAN_Parent_Data_File_ID, HTAN_Parent_Biospecimen_ID, Passed_QC, Filename, PhysicalSizeX, Microscope, entityId, SizeT, PixelType, PhysicalSizeZ, Protocol_Link, SizeY, Pixels_BigEndian, HTAN_Participant_ID, PhysicalSizeYUnit, FOVYUnit, LensNA, NominalMagnification, SizeZ, Id, Immersion, FOVXUnit, PhysicalSizeZUnit, MERFISH_Positions_File, WorkingDistance, Tseries, Software_and_Version, File_Format, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('yes', 'syn54240599', NULL, '1', '<U+00B5>m', NULL, NULL, 'ZYX', NULL, 'Image:0', 'HTA4_2008_116684', 'ImagingLevel2', NULL, 'CODEX', NULL, NULL, NULL, 'no', '57', '0.5065', '35520', NULL, 'HTA4_2008_7102', 'yes', 'CODEX_level_2_ped_glioma/C1060383_7316-5928/C1060383_7316-5928_Scan2.ome.ome.tif', '0.5065', 'Phenocyler Fusion', 'syn54213220', '1', 'uint8', '0', 'https://www.akoyabio.com/phenocycler/instrument/phenocycler-fusion/', '48960', 'False', 'HTA4_2008', '<U+00B5>m', NULL, NULL, '20', '1', '910cf661-bb44-48c4-b5cc-ccd2a4f51047', NULL, NULL, '<U+00B5>m', NULL, NULL, 'no', 'Phenocycler Fusion v.1.0.8', 'OME-TIFF', 'HTAN CHOP', 'syn53210837', 9, 46750535997, '5dc78f84130da5fdde4fee0774913e7e', 'Release 5.1', NULL), ('yes', 'syn54240599', NULL, '1', '<U+00B5>m', NULL, NULL, 'ZYX', NULL, 'Image:0', 'HTA4_2013_116685', 'ImagingLevel2', NULL, 'CODEX', NULL, NULL, NULL, 'no', '57', '0.5065', '35520', NULL, 'HTA4_2013_7158', 'yes', 'CODEX_level_2_ped_glioma/C1061121_7316-4337/C1061121_7316-4337_Scan1.ome.ome.tif', '0.5065', 'Phenocyler Fusion', 'syn54214347', '1', 'uint8', '0', 'https://www.akoyabio.com/phenocycler/instrument/phenocycler-fusion/', '41040', 'False', 'HTA4_2013', '<U+00B5>m', NULL, NULL, '20', '1', 'bd155700-5774-4d1e-a4d9-ac07f4486e3d', NULL, NULL, '<U+00B5>m', NULL, NULL, 'no', 'Phenocycler Fusion v.1.0.8', 'OME-TIFF', 'HTAN CHOP', 'syn53210837', 9, 25857622663, '71db797504d98285a96c897efc505ded', 'Release 5.1', NULL), ('yes', 'syn54240599', NULL, '1', '<U+00B5>m', NULL, NULL, 'ZYX', NULL, 'Image:0', 'HTA4_2013_116686', 'ImagingLevel2', NULL, 'CODEX', NULL, NULL, NULL, 'no', '57', '0.5065', '31680', NULL, 'HTA4_2013_7165', 'yes', 'CODEX_level_2_ped_glioma/C1061121_7316-4740/C1061121_7316-4740_Scan1.ome.ome.tif', '0.5065', 'Phenocyler Fusion', 'syn54219660', '1', 'uint8', '0', 'https://www.akoyabio.com/phenocycler/instrument/phenocycler-fusion/', '30240', 'False', 'HTA4_2013', '<U+00B5>m', NULL, NULL, '20', '1', '3bca1e64-1ac0-4e08-9da1-623577b74cfe', NULL, NULL, '<U+00B5>m', NULL, NULL, 'no', 'Phenocycler Fusion v.1.0.8', 'OME-TIFF', 'HTAN CHOP', 'syn53210837', 9, 12506580668, '1743d4d5d58130ff3c8cb6a2c022b310', 'Release 5.1', NULL), ('yes', 'syn54240599', NULL, '1', '<U+00B5>m', NULL, NULL, 'ZYX', NULL, 'Image:0', 'HTA4_2007_116687', 'ImagingLevel2', NULL, 'CODEX', NULL, NULL, NULL, 'no', '57', '0.5065', '35520', NULL, 'HTA4_2007_7088', 'yes', 'CODEX_level_2_ped_glioma/C15498_7316-371/C15498_7316-371_restart_Scan1.ome.ome.tif', '0.5065', 'Phenocyler Fusion', 'syn54213311', '1', 'uint8', '0', 'https://www.akoyabio.com/phenocycler/instrument/phenocycler-fusion/', '56880', 'False', 'HTA4_2007', '<U+00B5>m', NULL, NULL, '20', '1', '082bfc7a-f42f-4101-a45e-730ce5db86bb', NULL, NULL, '<U+00B5>m', NULL, NULL, 'no', 'Phenocycler Fusion v.1.0.8', 'OME-TIFF', 'HTAN CHOP', 'syn53210837', 9, 53213732167, '020e80daca374b469af43b5e898cf230', 'Release 5.1', NULL), ('yes', 'syn54240599', NULL, '1', '<U+00B5>m', NULL, NULL, 'ZYX', NULL, 'Image:0', 'HTA4_2011_116688', 'ImagingLevel2', NULL, 'CODEX', NULL, NULL, NULL, 'no', '57', '0.5065', '35520', NULL, 'HTA4_2011_7140', 'yes', 'CODEX_level_2_ped_glioma/C2751264_7316-7622/C2751264_7316-7622_Scan1.ome.ome.tif', '0.5065', 'Phenocyler Fusion', 'syn54215343', '1', 'uint8', '0', 'https://www.akoyabio.com/phenocycler/instrument/phenocycler-fusion/', '50400', 'False', 'HTA4_2011', '<U+00B5>m', NULL, NULL, '20', '1', '755d8f7c-2432-4649-9b55-cb471d0287de', NULL, NULL, '<U+00B5>m', NULL, NULL, 'no', 'Phenocycler Fusion v.1.0.8', 'OME-TIFF', 'HTAN CHOP', 'syn53210837', 9, 48818649736, '06e04a2854cb625dfe19674ef01acda3', 'Release 5.1', NULL);