-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.imaging_level2_metadata_r4`
(
  PhysicalSizeY STRING OPTIONS(description="Physical size (Y-dimension) of a pixel. Units are set by PhysicalSizeYUnit. Floating point value > 0."),
  FOVX STRING OPTIONS(description="Field of view X dimension. Floating point"),
  PhysicalSizeZ STRING OPTIONS(description="Physical size (Z-dimension) of a pixel. Units are set by PhysicalSizeZUnit. Floating point value > 0."),
  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)"),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  Software_and_Version STRING OPTIONS(description="Name of software used to generate expression values. String"),
  FOVY STRING OPTIONS(description="Field  of view Y dimension. Floating point value"),
  SizeX STRING OPTIONS(description="Size of image: X dimension (in pixels). Integer >= 1"),
  PlaneCount STRING OPTIONS(description="Number of Z-planes (not to be confused with downsampled \"pyramid\"). Integer >=1"),
  Objective STRING OPTIONS(description="Objective"),
  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."),
  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)"),
  SizeC STRING OPTIONS(description="Number of channels. Integer >= 1"),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  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)"),
  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)"),
  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."),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  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)"),
  FOVXUnit STRING OPTIONS(description="Field of view X dimension units. See OME enumeration of allowed values for the UnitsLength attribute -- default: microns (um)"),
  SizeT STRING OPTIONS(description="Number of time points. Integer >= 1"),
  MERFISH_Positions_File STRING OPTIONS(description="The positions file is an auxiliary MERFISH file that describes the location of bead positions in the assay."),
  Pyramid STRING OPTIONS(description="Does data file contain pyramid of images"),
  HTAN_Participant_ID STRING OPTIONS(description="HTAN ID associated with a patient based on HTAN ID SOP (eg HTANx_yyy )"),
  PixelType STRING OPTIONS(description="Data type for each pixel value. E.g. \"uint16\""),
  FOV_number STRING OPTIONS(description="Index of FOV (as it pertains to its sequence order). Integer >= 1"),
  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)"),
  Microscope STRING OPTIONS(description="Microscope type (manufacturer, model, etc) used for this experiment"),
  LensNA STRING OPTIONS(description="The numerical aperture of the lens. Floating point value > 0."),
  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"),
  Pixels_BigEndian STRING OPTIONS(description="Boolean (True/False)"),
  Immersion STRING OPTIONS(description="Immersion medium"),
  Frame_Averaging STRING OPTIONS(description="Number of frames averaged together (if no averaging, set to 1). Integer >= 1"),
  PhysicalSizeX STRING OPTIONS(description="Physical size (X-dimension) of a pixel. Units are set by PhysicalSizeXUnit. Floating point value > 0."),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  DimensionOrder STRING OPTIONS(description="The order in which the individual planes of data are interleaved."),
  Filename STRING OPTIONS(description="Name of a file"),
  HTAN_Parent_Data_File_ID STRING OPTIONS(description="HTAN Data File Identifier indicating the file(s) from which these files were derived"),
  Imaging_Assay_Type STRING OPTIONS(description="Type of imaging assay"),
  Comment STRING OPTIONS(description="Free text field (generally for QC comment)"),
  Tseries STRING OPTIONS(description="Does data file contain a time-series of images"),
  Channel_Metadata_Filename STRING OPTIONS(description="Full path within Synapse project of uploaded companion CSV file containing channel-level metadata details"),
  Zstack STRING OPTIONS(description="Does data file contain a Z-stack of images"),
  FOVYUnit STRING OPTIONS(description="Field of view Y dimension units. See OME enumeration of allowed values for the UnitsLength attribute -- default: microns (um)"),
  SizeY STRING OPTIONS(description="Size of image: Y dimension (in pixels). Integer >= 1"),
  WorkingDistance STRING OPTIONS(description="The working distance of the lens, expressed as a floating point number. Floating point > 0."),
  Passed_QC STRING OPTIONS(description="Did all channels pass QC (if not add free text Comment)"),
  SizeZ STRING OPTIONS(description="Size of image: Z dimension (in pixels). Integer >= 1"),
  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 R4 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 October 2023. 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_r4` (PhysicalSizeY, FOVX, PhysicalSizeZ, HTAN_Data_File_ID, Id, Software_and_Version, FOVY, SizeX, PlaneCount, Objective, Protocol_Link, NominalMagnification, SizeC, entityId, PhysicalSizeXUnit, WorkingDistanceUnit, Image_ID, MERFISH_Codebook_File, Component, PhysicalSizeYUnit, FOVXUnit, SizeT, MERFISH_Positions_File, Pyramid, HTAN_Participant_ID, PixelType, FOV_number, PhysicalSizeZUnit, Microscope, LensNA, HTAN_Parent_Biospecimen_ID, Pixels_BigEndian, Immersion, Frame_Averaging, PhysicalSizeX, File_Format, DimensionOrder, Filename, HTAN_Parent_Data_File_ID, Imaging_Assay_Type, Comment, Tseries, Channel_Metadata_Filename, Zstack, FOVYUnit, SizeY, WorkingDistance, Passed_QC, SizeZ, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('0.48828125', '500', NULL, 'HTA1_853_438140130001', '61f8019a-bd54-448c-a8d1-acdd1e6d2562', 'combine_tiffs-darwin-v0.2-5-g2ec3737', '500', '1024', '1', NULL, 'dx.doi.org/10.17504/protocols.io.2fbgbin', 'Not Applicable', '49', 'syn25871142', 'µm', 'µm', 'MIBITIFF_NB_Point8_combined.tiff SIMS', NULL, 'ImagingLevel2', 'µm', 'µm', '1', NULL, 'No', 'HTA1_853', 'uint16', '3', NULL, 'MIBI (Nolan)', NULL, 'HTA1_853_43814013', 'False', NULL, '1', '0.48828125', 'OME-TIFF', 'XYCZT', 'mibi_level_2/MBC/MIBITIFF_MBC_Point8_combined.ome.tiff', NULL, 'MIBI', NULL, 'No', 'mibi_auxiliary_files/MBC/Channel-level_Metadata_HTAPP_MBC_level2_panel18.csv', 'No', 'µm', '1024', 'Not Applicable', 'Yes', '1', 'HTAN HTAPP', 'syn41761654', 4, 103222679, 'ffc9b1f2e8153df655d4e7c163ef8cdf', 'Release 3.0', NULL), ('0.48828125', '500', NULL, 'HTA1_853_438140140001', '12af8ed8-e1ff-480e-a661-77a55c2b1a5f', 'combine_tiffs-darwin-v0.2-5-g2ec3737', '500', '1024', '1', NULL, 'dx.doi.org/10.17504/protocols.io.2fbgbin', 'Not Applicable', '49', 'syn25871148', 'µm', 'µm', 'MIBITIFF_NB_Point9_combined.tiff SIMS', NULL, 'ImagingLevel2', 'µm', 'µm', '1', NULL, 'No', 'HTA1_853', 'uint16', '4', NULL, 'MIBI (Nolan)', NULL, 'HTA1_853_43814014', 'False', NULL, '1', '0.48828125', 'OME-TIFF', 'XYCZT', 'mibi_level_2/MBC/MIBITIFF_MBC_Point9_combined.ome.tiff', NULL, 'MIBI', NULL, 'No', 'mibi_auxiliary_files/MBC/Channel-level_Metadata_HTAPP_MBC_level2_panel18.csv', 'No', 'µm', '1024', 'Not Applicable', 'Yes', '1', 'HTAN HTAPP', 'syn41761654', 4, 103222679, '3fa0e5d0cf2a3a5cdbe6e38732651ef7', 'Release 3.0', NULL), ('0.48828125', '500', NULL, 'HTA1_225_456040110001', '1860eb9f-fde1-4668-83ca-811ef169221e', 'combine_tiffs-darwin-v0.2-5-g2ec3737', '500', '1024', '1', NULL, 'dx.doi.org/10.17504/protocols.io.2fbgbin', 'Not Applicable', '49', 'syn25871060', 'µm', 'µm', 'MIBITIFF_NB_Point16_combined.tiff SIMS', NULL, 'ImagingLevel2', 'µm', 'µm', '1', NULL, 'No', 'HTA1_225', 'uint16', '1', NULL, 'MIBI (Nolan)', NULL, 'HTA1_225_45604011', 'False', NULL, '1', '0.48828125', 'OME-TIFF', 'XYCZT', 'mibi_level_2/MBC/MIBITIFF_MBC_Point16_combined.ome.tiff', NULL, 'MIBI', NULL, 'No', 'mibi_auxiliary_files/MBC/Channel-level_Metadata_HTAPP_MBC_level2_panel18.csv', 'No', 'µm', '1024', 'Not Applicable', 'Yes', '1', 'HTAN HTAPP', 'syn41761654', 4, 103222756, '1f9166c35738988299d2f7f13c609025', 'Release 3.0', NULL), ('0.48828125', '500', NULL, 'HTA1_225_456040120001', '1ce29fc9-338c-4b66-89cb-a88fbfd1cec0', 'combine_tiffs-darwin-v0.2-5-g2ec3737', '500', '1024', '1', NULL, 'dx.doi.org/10.17504/protocols.io.2fbgbin', 'Not Applicable', '49', 'syn25871061', 'µm', 'µm', 'MIBITIFF_NB_Point17_combined.tiff SIMS', NULL, 'ImagingLevel2', 'µm', 'µm', '1', NULL, 'No', 'HTA1_225', 'uint16', '2', NULL, 'MIBI (Nolan)', NULL, 'HTA1_225_45604012', 'False', NULL, '1', '0.48828125', 'OME-TIFF', 'XYCZT', 'mibi_level_2/MBC/MIBITIFF_MBC_Point17_combined.ome.tiff', NULL, 'MIBI', NULL, 'No', 'mibi_auxiliary_files/MBC/Channel-level_Metadata_HTAPP_MBC_level2_panel18.csv', 'No', 'µm', '1024', 'Not Applicable', 'Yes', '1', 'HTAN HTAPP', 'syn41761654', 4, 103222756, 'fe99505cdb64c064953523d05a48948b', 'Release 3.0', NULL), ('0.48828125', '500', NULL, 'HTA1_225_456040130001', '7a92045a-b44c-42d3-8a75-36703a8600f0', 'combine_tiffs-darwin-v0.2-5-g2ec3737', '500', '1024', '1', NULL, 'dx.doi.org/10.17504/protocols.io.2fbgbin', 'Not Applicable', '49', 'syn25871062', 'µm', 'µm', 'MIBITIFF_NB_Point18_combined.tiff SIMS', NULL, 'ImagingLevel2', 'µm', 'µm', '1', NULL, 'No', 'HTA1_225', 'uint16', '3', NULL, 'MIBI (Nolan)', NULL, 'HTA1_225_45604013', 'False', NULL, '1', '0.48828125', 'OME-TIFF', 'XYCZT', 'mibi_level_2/MBC/MIBITIFF_MBC_Point18_combined.ome.tiff', NULL, 'MIBI', NULL, 'No', 'mibi_auxiliary_files/MBC/Channel-level_Metadata_HTAPP_MBC_level2_panel18.csv', 'No', 'µm', '1024', 'Not Applicable', 'Yes', '1', 'HTAN HTAPP', 'syn41761654', 4, 103222756, 'cb41efbc3a0fe5a74c166ec10c68112a', 'Release 3.0', NULL);