-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.imaging_level3_segmentation_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_Parent_Data_File_ID STRING OPTIONS(description="HTAN Data File Identifier indicating the file(s) from which these files were derived"),
  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)"),
  Imaging_Segmentation_Data_Type STRING OPTIONS(description="Specifies how the segmentation is stored"),
  Parameter_file STRING OPTIONS(description="Path in Syanpse to a text file listing algorithm version numbers and relevant parameters needed to reproduce the analysis"),
  Software_and_Version STRING OPTIONS(description="Name of software used to generate expression values. String"),
  Commit_SHA STRING OPTIONS(description="Short SHA for software version [8 hexadecimal characters (for github), comma separated if multiple]"),
  Imaging_Object_Class STRING OPTIONS(description="Defines the structure that the mask delineates"),
  Number_of_Objects STRING OPTIONS(description="The number of objects (eg cells) described"),
  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 3 SEGMENTATION METADATA R3 VERSIONED",
  description="This table contains the file metadata for third level imaging data which includes segmentation masks, validated channel metadata, and QC checked images. 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_level3_segmentation_metadata_r3` (Component, Filename, File_Format, HTAN_Parent_Data_File_ID, HTAN_Data_File_ID, Imaging_Segmentation_Data_Type, Parameter_file, Software_and_Version, Commit_SHA, Imaging_Object_Class, Number_of_Objects, entityId, HTAN_Center, Data_Release, Manifest_Version, Uuid, File_Size, md5, CDS_Release) VALUES ('ImagingLevel3Segmentation', 'imaging_level_3_segmentation/CRC202211/165-TNP_CRCTMA-2020AUG/CRC02-cell-mask.ome.tif', 'OME-TIFF', 'HTA7_926_1000', 'HTA7_926_1008', 'Mask', NULL, 's3segmenter 1.2.0', NULL, 'whole cell', '1148404', 'syn44293986', 'HTAN HMS', 'Release 3.0', 1, 'e513df3b-f772-43c1-b58e-4349f437ef7a', 215810829, '3e1264555d57bfc9168668d4d88b2bde', NULL), ('ImagingLevel3Segmentation', 'imaging_level_3_segmentation/CRC202211/165-TNP_CRCTMA-2020AUG/CRC03-cell-mask.ome.tif', 'OME-TIFF', 'HTA7_927_1000', 'HTA7_927_1009', 'Mask', NULL, 's3segmenter 1.2.0', NULL, 'whole cell', '824758', 'syn44294003', 'HTAN HMS', 'Release 3.0', 1, '238a196f-99a3-4323-93d7-3a379320178b', 172791291, '20b6b667cbdda72ac0bfcd9a776c5f6a', NULL), ('ImagingLevel3Segmentation', 'imaging_level_3_segmentation/CRC202211/165-TNP_CRCTMA-2020AUG/CRC04-cell-mask.ome.tif', 'OME-TIFF', 'HTA7_932_1000', 'HTA7_932_1009', 'Mask', NULL, 's3segmenter 1.2.0', NULL, 'whole cell', '1640430', 'syn44294038', 'HTAN HMS', 'Release 3.0', 1, '6188c9ff-5b7a-480c-9910-06999606b0cb', 306648573, '23c59a370ee71376f4e9dd46353f3067', NULL), ('ImagingLevel3Segmentation', 'imaging_level_3_segmentation/CRC202211/165-TNP_CRCTMA-2020AUG/CRC05-cell-mask.ome.tif', 'OME-TIFF', 'HTA7_934_1000', 'HTA7_934_1009', 'Mask', NULL, 's3segmenter 1.2.0', NULL, 'whole cell', '1138959', 'syn44294069', 'HTAN HMS', 'Release 3.0', 1, 'ca2ffeac-86c0-4492-8f4f-1610f28a3e56', 224071279, '289be92c8c2fdc8e1d4e66c18779ac6c', NULL), ('ImagingLevel3Segmentation', 'imaging_level_3_segmentation/CRC202211/165-TNP_CRCTMA-2020AUG/CRC06-cell-mask.ome.tif', 'OME-TIFF', 'HTA7_966_1000', 'HTA7_966_1006', 'Mask', NULL, 's3segmenter 1.2.0', NULL, 'whole cell', '441316', 'syn44294086', 'HTAN HMS', 'Release 3.0', 1, '9f41c3a7-edf5-452e-9356-12b81ae8ef08', 106457619, '73b79501933b860e35363d37b5ab9c35', NULL);