-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.imaging_level4_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_Parent_Channel_Metadata_ID STRING OPTIONS(description="Description unavailable. Contact HTAN DCC for more information"),
  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)"),
  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]"),
  Number_of_Objects STRING OPTIONS(description="The number of objects (eg cells) described"),
  Number_of_Features STRING OPTIONS(description="The number of features (eg channels) described"),
  Imaging_Object_Class STRING OPTIONS(description="Defines the structure that the mask delineates"),
  Imaging_Summary_Statistic STRING OPTIONS(description="Function used to summarize object/feature intensity"),
  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 4 METADATA R3 VERSIONED",
  description="This table contains the file metadata for fourth level imaging data which includes an object-by-feature table generated from the segmentation mask and image. 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_level4_metadata_r3` (Component, Filename, File_Format, HTAN_Parent_Data_File_ID, HTAN_Parent_Channel_Metadata_ID, HTAN_Data_File_ID, Parameter_file, Software_and_Version, Commit_SHA, Number_of_Objects, Number_of_Features, Imaging_Object_Class, Imaging_Summary_Statistic, entityId, HTAN_Center, Data_Release, Manifest_Version, Uuid, File_Size, md5, CDS_Release) VALUES ('ImagingLevel4', 'imaging_level_4/CRC202208/165-TNP_CRCTMA-2020AUG/unmicst-crc04.csv', 'csv', 'HTA7_934_1009', NULL, 'HTA7_934_1012', NULL, 'labsyspharm/quantification 1.3.1', NULL, '1138959', '119', 'Imaging Object Class Other', 'Mean', 'syn36017742', 'HTAN HMS', 'Release 3.0', 2, '845768c5-7e5a-45d7-a29b-55e7103c02c2', 2306258863, '6bb9e5f6d7a27b3b1207cbd053ca709f', NULL), ('ImagingLevel4', 'imaging_level_4/CRC202208/165-TNP_CRCTMA-2020AUG/unmicst-crc05.csv', 'csv', 'HTA7_966_1006', NULL, 'HTA7_966_1009', NULL, 'labsyspharm/quantification 1.3.1', NULL, '441316', '119', 'Imaging Object Class Other', 'Mean', 'syn36017834', 'HTAN HMS', 'Release 3.0', 2, 'bf5dd062-8114-40d8-b008-0c8489e107e2', 903235590, '966674ca5ecf428f86a990d31b79a7a1', NULL), ('ImagingLevel4', 'imaging_level_4/CRC202208/165-TNP_CRCTMA-2020AUG/unmicst-crc06.csv', 'csv', 'HTA7_947_1009', NULL, 'HTA7_947_1012', NULL, 'labsyspharm/quantification 1.3.1', NULL, '807714', '119', 'Imaging Object Class Other', 'Mean', 'syn36017996', 'HTAN HMS', 'Release 3.0', 2, '485490c8-864c-40be-ad67-c0920c50dc2b', 1636454983, '4ba0af9d24eecf746743f3f580138a6d', NULL), ('ImagingLevel4', 'imaging_level_4/CRC202208/165-TNP_CRCTMA-2020AUG/unmicst-crc09.csv', 'csv', 'HTA7_920_1009', NULL, 'HTA7_920_1012', NULL, 'labsyspharm/quantification 1.3.1', NULL, '664138', '119', 'Imaging Object Class Other', 'Mean', 'syn36018316', 'HTAN HMS', 'Release 3.0', 2, 'b0435c55-7c25-46bd-9453-bfbee7bac9e2', 1338191421, 'f3a4dba054f308aa4ec658c9f2c4ad14', NULL), ('ImagingLevel4', 'imaging_level_4/CRC202208/165-TNP_CRCTMA-2020AUG/unmicst-crc10.csv', 'csv', 'HTA7_922_1009', NULL, 'HTA7_922_1012', NULL, 'labsyspharm/quantification 1.3.1', NULL, '589618', '119', 'Imaging Object Class Other', 'Mean', 'syn36018673', 'HTAN HMS', 'Release 3.0', 2, '77712ef0-d17a-4341-a512-7c92b6caa830', 1188042282, '86a74ab61ccdd45e2b8767074a61687a', NULL);