-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.srrs_imaging_level2_metadata_r2`
(
  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 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)"),
  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)"),
  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)"),
  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\""),
  Imaging_Level_2_Channels STRING OPTIONS(description="Channel-level Metadata Attributes"),
  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"),
  File_Size INT64 OPTIONS(description="Size of file (bucket object) in bytes"),
  Base_Filename STRING OPTIONS(description="Base name of file"),
  md5 STRING OPTIONS(description="md5 hash of file")
)
OPTIONS(
  friendly_name="HTAN SRRS IMAGING LEVEL 2 METADATA R2 VERSIONED",
  description="Data was extracted from HTAN Synapse projects in April 2022.",
  labels=[("access", "open"), ("data_type", "file_metadata"), ("program", "htan"), ("source", "htan"), ("status", "current"), ("category", "metadata")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.srrs_imaging_level2_metadata_r2` (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, Pyramid, Zstack, Tseries, Passed_QC, Frame_Averaging, Image_ID, DimensionOrder, PhysicalSizeX, PhysicalSizeXUnit, PhysicalSizeY, PhysicalSizeYUnit, Pixels_BigEndian, PlaneCount, SizeC, SizeT, SizeX, SizeY, SizeZ, PixelType, Imaging_Level_2_Channels, entityId, HTAN_Center, Data_Release, File_Size, Base_Filename, md5) VALUES ('SRRSImagingLevel2', 'imaging_level_2/BU/TUCD007823_HA1.svs', 'svs', 'HTA3_11009', 'HTA3_11009_15000002', 'HTA3_11009_1500000201', 'Not Applicable', 'H&E', 'dx.doi.org/10.17504/protocols.io.bzuvp6w6', 'Aperio Image Library v12.0.15', 'Leica-Aperio AT2', 'None', '40', 'Yes', 'No', 'No', 'Yes', 'None', '398032', 'XYZCT', '0.25', 'µm', '0.25', 'µm', 'True', '1', '3', '1', '51584', '48734', '1', 'uint8', 'None', 'syn26452527', 'HTAN SRRS', 'Release 2.0', 755510737, 'TUCD007823_HA1.svs', 'c68871b7576f4e86669124dd0639f7b1'), ('SRRSImagingLevel2', 'imaging_level_2/BU/TUCD007823_HA1_HE_OCT_5.svs', 'svs', 'HTA3_11009', 'HTA3_11009_14000004', 'HTA3_11009_1400000401', 'Not Applicable', 'H&E', 'dx.doi.org/10.17504/protocols.io.bzuvp6w6', 'Aperio Image Library v12.0.15', 'Leica-Aperio AT2', 'None', '40', 'Yes', 'No', 'No', 'Yes', 'None', '409443', 'XYZCT', '0.25', 'µm', '0.25', 'µm', 'True', '1', '3', '1', '47616', '26353', '1', 'uint8', 'None', 'syn26452510', 'HTAN SRRS', 'Release 2.0', 207771777, 'TUCD007823_HA1_HE_OCT_5.svs', '8a659551407b1d5bce501e8d37eb508c'), ('SRRSImagingLevel2', 'imaging_level_2/BU/TUCD007823_HABX1.svs', 'svs', 'HTA3_11009', 'HTA3_11009_11000001', 'HTA3_11009_1100000101', 'Not Applicable', 'H&E', 'dx.doi.org/10.17504/protocols.io.bzuvp6w6', 'Aperio Image Library v12.0.15', 'Leica-Aperio AT2', 'None', '40', 'Yes', 'No', 'No', 'Yes', 'None', '398033', 'XYZCT', '0.25', 'µm', '0.25', 'µm', 'True', '1', '3', '1', '21824', '28218', '1', 'uint8', 'None', 'syn26445552', 'HTAN SRRS', 'Release 2.0', 104831877, 'TUCD007823_HABX1.svs', '5b3abc996a0fbbbb31adfa406b4d0e52'), ('SRRSImagingLevel2', 'imaging_level_2/BU/TUCD007823_HABX2.svs', 'svs', 'HTA3_11009', 'HTA3_11009_11000002', 'HTA3_11009_1100000201', 'Not Applicable', 'H&E', 'dx.doi.org/10.17504/protocols.io.bzuvp6w6', 'Aperio Image Library v12.0.15', 'Leica-Aperio AT2', 'None', '40', 'Yes', 'No', 'No', 'Yes', 'None', '398034', 'XYZCT', '0.25', 'µm', '0.25', 'µm', 'True', '1', '3', '1', '29760', '24376', '1', 'uint8', 'None', 'syn26445553', 'HTAN SRRS', 'Release 2.0', 121117499, 'TUCD007823_HABX2.svs', '93bcc4d0f7ac518a47c03d13dc153d93'), ('SRRSImagingLevel2', 'imaging_level_2/BU/TUCD007823_HABX3.svs', 'svs', 'HTA3_11009', 'HTA3_11009_11000003', 'HTA3_11009_1100000301', 'Not Applicable', 'H&E', 'dx.doi.org/10.17504/protocols.io.bzuvp6w6', 'Aperio Image Library v12.0.15', 'Leica-Aperio AT2', 'None', '40', 'Yes', 'No', 'No', 'Yes', 'None', '398035', 'XYZCT', '0.25', 'µm', '0.25', 'µm', 'True', '1', '3', '1', '12896', '17092', '1', 'uint8', 'None', 'syn26445554', 'HTAN SRRS', 'Release 2.0', 62904425, 'TUCD007823_HABX3.svs', '86d8c08897af38841185c5cdc51eda1e');