-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.electron_microscopy_level2_metadata_r5`
(
  Filename STRING OPTIONS(description="Name of a file"),
  HTAN_Parent_Data_File_ID STRING OPTIONS(description="HTAN Data File Identifier indicating the file(s) from which these files were derived"),
  Tile_overlap_Y STRING OPTIONS(description="Percentage of image overlap to allow tile stitching in x direction"),
  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."),
  EM_contrast_type STRING OPTIONS(description="Does the image use standard SEM contrast or TEM contrast"),
  Tile_overlap_X STRING OPTIONS(description="Percentage of image overlap to allow tile stitching in x direction"),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  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 ELECTRON MICROSCOPY LEVEL 2 METADATA R5 VERSIONED",
  description="This table contains the file metadata for second level electron microscopy data. 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/standards",
  labels=[("access", "open"), ("data_type", "file_metadata"), ("program", "htan"), ("source", "htan"), ("category", "metadata"), ("status", "current")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.electron_microscopy_level2_metadata_r5` (Filename, HTAN_Parent_Data_File_ID, Tile_overlap_Y, entityId, Id, HTAN_Data_File_ID, Component, EM_contrast_type, Tile_overlap_X, File_Format, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('001/HTA9_1_8_3DEM-0331.ome.tif', 'HTA9_1_20451', '0.0', 'syn31774401', 'fdd5a7f2-44bc-42b1-8f24-bd4b9b0b9d4b', 'HTA9_1_14417', 'ElectronMicroscopyLevel2', NULL, '0.0', 'OME-TIFF', 'HTAN OHSU', 'syn53251539', 2, 25200456, '740e1753ac89eb3bb57e8b90d16f3535', 'Release 5.1', NULL), ('001/HTA9_1_8_3DEM-0335.ome.tif', 'HTA9_1_22100', '0.0', 'syn31774410', '5225b443-3bb3-4c07-bbc3-19e0b6a580f4', 'HTA9_1_17102', 'ElectronMicroscopyLevel2', NULL, '0.0', 'OME-TIFF', 'HTAN OHSU', 'syn53251539', 2, 25200456, 'f43fff3384ab0d6861e30cb8a8ff5026', 'Release 5.1', NULL), ('001/HTA9_1_8_3DEM-0336.ome.tif', 'HTA9_1_22644', '0.0', 'syn31774414', 'ed87312b-fa17-4978-aa25-f439cd7dc6b7', 'HTA9_1_15560', 'ElectronMicroscopyLevel2', NULL, '0.0', 'OME-TIFF', 'HTAN OHSU', 'syn53251539', 2, 25200456, '84bff2010b4808380640020015d4f4e5', 'Release 5.1', NULL), ('001/HTA9_1_8_3DEM-0481.ome.tif', 'HTA9_1_20918', '0.0', 'syn31774569', 'd73408d5-ec23-488b-8a32-a6ce536e6579', 'HTA9_1_18918', 'ElectronMicroscopyLevel2', NULL, '0.0', 'OME-TIFF', 'HTAN OHSU', 'syn53251539', 2, 25200456, 'c7c4bf426287615d6392ea1591601c2c', 'Release 5.1', NULL), ('001/HTA9_1_8_3DEM-0591.ome.tif', 'HTA9_1_21619', '0.0', 'syn31774682', 'cbd3fb46-f727-47f5-82a3-417e24f73142', 'HTA9_1_15013', 'ElectronMicroscopyLevel2', NULL, '0.0', 'OME-TIFF', 'HTAN OHSU', 'syn53251539', 2, 25200456, '1af5dc3d9bdb37804fbf9eb7a43f342b', 'Release 5.1', NULL);