-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.srrs_imaging_level2_metadata_r5`
(
  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)"),
  Objective STRING OPTIONS(description="Objective"),
  DimensionOrder STRING OPTIONS(description="The order in which the individual planes of data are interleaved."),
  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."),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  Imaging_Assay_Type STRING OPTIONS(description="Type of imaging assay"),
  Comment STRING OPTIONS(description="Free text field (generally for QC comment)"),
  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_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\""),
  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)"),
  SizeZ STRING OPTIONS(description="Size of image: Z dimension (in pixels). Integer >= 1"),
  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)"),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  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"),
  Pyramid STRING OPTIONS(description="Does data file contain pyramid of images"),
  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 SRRS IMAGING LEVEL 2 METADATA R5 VERSIONED",
  description="This table contains second-level imaging data specific to SRRS (Standardized Repository of Reference Specimens). 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.srrs_imaging_level2_metadata_r5` (Channel_Metadata_Filename, Frame_Averaging, PlaneCount, PhysicalSizeXUnit, Objective, DimensionOrder, Image_ID, HTAN_Data_File_ID, Component, File_Format, Imaging_Assay_Type, Comment, Zstack, SizeC, PhysicalSizeY, SizeX, HTAN_Parent_Biospecimen_ID, Passed_QC, Filename, PhysicalSizeX, Microscope, entityId, SizeT, PixelType, Protocol_Link, SizeY, Pixels_BigEndian, HTAN_Participant_ID, PhysicalSizeYUnit, SizeZ, NominalMagnification, Id, Tseries, Software_and_Version, Pyramid, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('Not Applicable', NULL, '1', '<U+00B5>m', NULL, 'XYZCT', '423950', 'HTA15_30001_700003001', 'SRRSImagingLevel2', 'svs', 'H&E', NULL, 'No', '3', '0.25', '54560', 'HTA15_30001_7000030', 'Yes', 'BU_imaging_level_2_clean/UCD0017374_HTA15-30001_FFPE_HE_HA1-1_cleaned.svs', '0.25', 'Leica-Aperio AT2', 'syn52431239', '1', 'uint8', 'dx.doi.org/10.17504/protocols.io.bzuvp6w6', '46809', 'True', 'HTA15_30001', '<U+00B5>m', '1', '40', '8dbeb6e6-485e-4af4-9d25-d2867fbcb356', 'No', 'Aperio Image Library v12.0.15', 'Yes', 'HTAN SRRS', 'syn52702413', 2, 690324478, 'e5f15ab30c3f77723b3ed4d9b6db80a2', 'Release 4.1', NULL), ('Not Applicable', NULL, '1', '<U+00B5>m', NULL, 'XYZCT', '423951', 'HTA15_30001_700003101', 'SRRSImagingLevel2', 'svs', 'H&E', NULL, 'No', '3', '0.25', '21824', 'HTA15_30001_7000031', 'Yes', 'BU_imaging_level_2_clean/UCD0017374_HTA15-30001_FFPE_HE_HABx1-1_cleaned.svs', '0.25', 'Leica-Aperio AT2', 'syn52431241', '1', 'uint8', 'dx.doi.org/10.17504/protocols.io.bzuvp6w6', '28218', 'True', 'HTA15_30001', '<U+00B5>m', '1', '40', '761f6496-ef7c-42bf-8f4f-bc5ec2d7dd96', 'No', 'Aperio Image Library v12.0.15', 'Yes', 'HTAN SRRS', 'syn52702413', 2, 102313612, 'd7114c7ed8005c93565e0e11969c0bb1', 'Release 4.1', NULL), ('Not Applicable', NULL, '1', '<U+00B5>m', NULL, 'XYZCT', '423952', 'HTA15_30001_700003201', 'SRRSImagingLevel2', 'svs', 'H&E', NULL, 'No', '3', '0.25', '29760', 'HTA15_30001_7000032', 'Yes', 'BU_imaging_level_2_clean/UCD0017374_HTA15-30001_FFPE_HE_HABx2-1_cleaned.svs', '0.25', 'Leica-Aperio AT2', 'syn52431240', '1', 'uint8', 'dx.doi.org/10.17504/protocols.io.bzuvp6w6', '24858', 'True', 'HTA15_30001', '<U+00B5>m', '1', '40', 'e6d6c051-acdf-4dca-989c-27fb18bbb5c1', 'No', 'Aperio Image Library v12.0.15', 'Yes', 'HTAN SRRS', 'syn52702413', 2, 60818080, '721acb0ec3c8853cd1622687c25a39de', 'Release 4.1', NULL), ('Not Applicable', NULL, '1', '<U+00B5>m', NULL, 'XYZCT', '423953', 'HTA15_30001_700003301', 'SRRSImagingLevel2', 'svs', 'H&E', NULL, 'No', '3', '0.25', '15872', 'HTA15_30001_7000033', 'Yes', 'BU_imaging_level_2_clean/UCD0017374_HTA15-30001_FFPE_HE_HABx3-1_cleaned.svs', '0.25', 'Leica-Aperio AT2', 'syn52431242', '1', 'uint8', 'dx.doi.org/10.17504/protocols.io.bzuvp6w6', '18707', 'True', 'HTA15_30001', '<U+00B5>m', '1', '40', 'b3d82494-c03a-4c4a-a8ed-011906bf3d02', 'No', 'Aperio Image Library v12.0.15', 'Yes', 'HTAN SRRS', 'syn52702413', 2, 78866562, '8665126d29b1c6b37f97257ce8900443', 'Release 4.1', NULL), ('Not Applicable', NULL, '1', '<U+00B5>m', NULL, 'XYZCT', '423954', 'HTA15_30001_700003401', 'SRRSImagingLevel2', 'svs', 'H&E', NULL, 'No', '3', '0.25', '25792', 'HTA15_30001_7000034', 'Yes', 'BU_imaging_level_2_clean/UCD0017374_HTA15-30001_FFPE_HE_HABx4-1_cleaned.svs', '0.25', 'Leica-Aperio AT2', 'syn52431243', '1', 'uint8', 'dx.doi.org/10.17504/protocols.io.bzuvp6w6', '23563', 'True', 'HTA15_30001', '<U+00B5>m', '1', '40', 'e0b9f7af-0ca2-42d8-b8af-a42220cebef2', 'No', 'Aperio Image Library v12.0.15', 'Yes', 'HTAN SRRS', 'syn52702413', 2, 124112992, '1508c9a79acd30f7f4dcab8be765f6a9', 'Release 4.1', NULL);