-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.imaging_level1_metadata_r5`
(
  Pre_processing_Completed STRING OPTIONS(description="Pre-processing steps completed to convert level 1 raw data to a single level 2 image"),
  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"),
  Commit_SHA STRING OPTIONS(description="Short SHA for software version [8 hexadecimal characters (for github), comma separated if multiple]"),
  Pre_processing_Required STRING OPTIONS(description="Pre-processing steps required to convert level 1 raw data to a single level 2 image"),
  Filename STRING OPTIONS(description="Name of a file"),
  Comment STRING OPTIONS(description="Free text field (generally for QC comment)"),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  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."),
  Imaging_Assay_Type STRING OPTIONS(description="Type of imaging assay"),
  Software_and_Version STRING OPTIONS(description="Name of software used to generate expression values. String"),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  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."),
  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 1 METADATA R5 VERSIONED",
  description="This table contains the file metadata for imaging information in a raw format such as tiling, stitching, illumination correction, registration or other pre-processing. 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.imaging_level1_metadata_r5` (Pre_processing_Completed, HTAN_Parent_Biospecimen_ID, Commit_SHA, Pre_processing_Required, Filename, Comment, entityId, Id, HTAN_Data_File_ID, Component, Imaging_Assay_Type, Software_and_Version, File_Format, Protocol_Link, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES (NULL, 'HTA10_07_301', NULL, 'Tile Stitching', 'codex_level_1/B001-A-301.zip', NULL, 'syn53254455', '1221c711-b63a-4c0c-b021-e1168691181f', 'HTA10_07_301011001', 'ImagingLevel1', 'CODEX', 'Akoya CIM 1.7.0.6', 'zip', 'https://dx.doi.org/10.17504/protocols.io.4jngume', 'HTAN Stanford', 'syn53335738', 2, 51002436108, '0171acf0ccd49341fa3d62722098dfee', 'Release 5.0', NULL), (NULL, 'HTA10_07_401', NULL, 'Tile Stitching', 'codex_level_1/B001-A-401.zip', NULL, 'syn53254448', '9d912d86-4a02-4503-820a-65d5e4dac17d', 'HTA10_07_401011001', 'ImagingLevel1', 'CODEX', 'Akoya CIM 1.7.0.6', 'zip', 'https://dx.doi.org/10.17504/protocols.io.4jngume', 'HTAN Stanford', 'syn53335738', 2, 50328266509, 'f66aa90f1ea079940e2ee0c7d153030b', 'Release 5.0', NULL), (NULL, 'HTA10_01_119', NULL, 'Tile Stitching', 'codex_level_1/A001-C-119.zip', NULL, 'syn53254467', '718d887b-1ddf-40a8-a82e-8944125285b7', 'HTA10_01_119011001', 'ImagingLevel1', 'CODEX', 'Akoya CIM 1.7.0.6', 'zip', 'https://dx.doi.org/10.17504/protocols.io.4jngume', 'HTAN Stanford', 'syn53335738', 2, 172118743323, '6cc4c7906dae40e5ad9987657e77894f', 'Release 5.0', NULL), (NULL, 'HTA10_01_124', NULL, 'Tile Stitching', 'codex_level_1/A001-C-124.zip', NULL, 'syn53254417', '59591a6e-541f-40e2-9690-410e42c2a224', 'HTA10_01_124011001', 'ImagingLevel1', 'CODEX', 'Akoya CIM 1.7.0.6', 'zip', 'https://dx.doi.org/10.17504/protocols.io.4jngume', 'HTAN Stanford', 'syn53335738', 2, 180618434363, 'b6e01d0c3447c9cbe093c67ea4d3af52', 'Release 5.0', NULL), (NULL, 'HTA10_02_024', NULL, 'Tile Stitching', 'codex_level_1/A002-C-024.zip', NULL, 'syn53254443', '8e0379cd-3429-4326-959e-a1a64f2f0576', 'HTA10_02_024011001', 'ImagingLevel1', 'CODEX', 'Akoya CIM 1.7.0.6', 'zip', 'https://dx.doi.org/10.17504/protocols.io.4jngume', 'HTAN Stanford', 'syn53335738', 2, 180618434363, '253f9fdb0256e62487e67d8e78efaba1', 'Release 5.0', NULL);