-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.10xvisium_spatialtranscriptomics_auxiliaryfiles_metadata_r5`
(
  Workflow_Link STRING OPTIONS(description="Link to workflow or command. DockStore.org recommended. URL"),
  Run_ID STRING OPTIONS(description="A unique identifier for this individual run (typically associated with a single slide) of the spatial transcriptomic processing workflow."),
  Capture_Area STRING OPTIONS(description="Area (or Capture Area) - One of the either four or two active regions where tissue can be placed on a Visium slide. Each area is intended to contain only one tissue sample. Slide areas are named consecutively from top to bottom: A1, B1, C1, D1 for Visium slides with 6.5 mm Capture Area and A, B for CytAssist slides with 11 mm Capture Area. Both CytAssist slides with 6.5 mm Capture Area and Gateway Slides contain only two slide areas, A1 and D1."),
  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"),
  Filename STRING OPTIONS(description="Name of a file"),
  Visium_File_Type STRING OPTIONS(description="The file type generated for the visium experiment."),
  HTAN_Parent_Data_File_ID STRING OPTIONS(description="HTAN Data File Identifier indicating the file(s) from which these files were derived"),
  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."),
  Slide_ID STRING OPTIONS(description="For Visium, it is the unique identifier printed on the label of each Visium slide. The serial number starts with V followed by a number which can range between one through five and ends with a dash and a three digit number, such as 123. For CosMx, this refers to the loaded Flow Cell ID. For Xenium, this ID indicates the slide orientation, as it matches the relative location of the ID on the physical Xenium slide."),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  Workflow_Version STRING OPTIONS(description="Major version of the workflow (e.g. Cell Ranger v3.1)"),
  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 VISIUM AUXILIARY METADATA R5 VERSIONED",
  description="This table contains the file metadata for auxiliary files associated with 10x Genomics Visium sequencing. Data was extracted from Synapse projects in April 2024 and corresponds to HTAN Data Release 5.1. More details: see https://data.humantumoratlas.org/standard/spatial_transcriptomics",
  labels=[("access", "open"), ("data_type", "file_metadata"), ("program", "htan"), ("source", "htan"), ("category", "metadata"), ("status", "current")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.10xvisium_spatialtranscriptomics_auxiliaryfiles_metadata_r5` (Workflow_Link, Run_ID, Capture_Area, HTAN_Parent_Biospecimen_ID, Filename, Visium_File_Type, HTAN_Parent_Data_File_ID, entityId, Id, HTAN_Data_File_ID, Component, Slide_ID, File_Format, Workflow_Version, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('https://support.10xgenomics.com/spatial-gene-expression/software/pipelines/latest/using/mkfastq', 'HTA1_336_5221307_V10U24-037_D', 'D', 'HTA1_336_5221307', 'visium_lung_auxiliary/V10U24-037_D_aligned_fiducials.jpg', 'fiducial image jpg', 'Not Applicable', 'syn51283742', '97f56ff0-ad33-4fe4-8f19-11d2a84051b2', 'HTA1_336_522130710', '10xVisiumSpatialTranscriptomics-AuxiliaryFiles', '10U24-037', 'jpg', 'SpaceRanger v1.2.0', 'HTAN HTAPP', 'syn51300313', 12, 996838, 'd9908d4b4a89bba42f1d263ab850337b', 'Release 5.1', NULL), ('https://support.10xgenomics.com/spatial-gene-expression/software/pipelines/latest/using/mkfastq', 'HTA1_322_5071604_V10U24-039_C', 'C', 'HTA1_322_5071604', 'visium_lung_auxiliary/V10U24-039_C_aligned_fiducials.jpg', 'fiducial image jpg', 'HTA1_322_507160409', 'syn51283796', '6b34782d-56f5-45e1-8364-e51a5f778a84', 'HTA1_322_507160410', '10xVisiumSpatialTranscriptomics-AuxiliaryFiles', '10U24-039', 'jpg', 'SpaceRanger v1.2.0', 'HTAN HTAPP', 'syn51300313', 12, 841207, 'c2337a1f2cc689b9553a913ac031ab91', 'Release 5.1', NULL), ('https://support.10xgenomics.com/spatial-gene-expression/software/pipelines/latest/using/mkfastq', 'HTA1_322_5071604_V10U24-039_C', 'C', 'HTA1_322_5071604', 'visium_lung_auxiliary/V10U24-039_C_detected_tissue_image.jpg', 'detected jpg', 'HTA1_322_507160409', 'syn51283794', '0abe6430-34bf-4d36-b91a-4cb35e7d24f6', 'HTA1_322_507160411', '10xVisiumSpatialTranscriptomics-AuxiliaryFiles', '10U24-039', 'jpg', 'SpaceRanger v1.2.0', 'HTAN HTAPP', 'syn51300313', 12, 1265656, '19e0d3f7e0db05f4edc6c816927154e6', 'Release 5.1', NULL), ('https://support.10xgenomics.com/spatial-gene-expression/software/pipelines/latest/using/mkfastq', 'HTA1_322_5071604_V10U24-039_C', 'C', 'HTA1_322_5071604', 'visium_lung_auxiliary/V10U24-039_C_scalefactors_json.json', 'json scale factors', 'HTA1_322_507160409', 'syn51283797', 'e3803814-0f2f-4e57-a8bf-31b5e33daca8', 'HTA1_322_507160412', '10xVisiumSpatialTranscriptomics-AuxiliaryFiles', '10U24-039', 'json', 'SpaceRanger v1.2.0', 'HTAN HTAPP', 'syn51300313', 12, 147, '698fd60e84bbb0e61df5601550c9a74e', 'Release 5.1', NULL), ('https://support.10xgenomics.com/spatial-gene-expression/software/pipelines/latest/using/mkfastq', 'HTA1_322_5071604_V10U24-039_C', 'C', 'HTA1_322_5071604', 'visium_lung_auxiliary/V10U24-039_C_tissue_lowres_image.png', 'low res image', 'HTA1_322_507160409', 'syn51283799', '15b99723-e554-448f-bfc6-a07b46571bfe', 'HTA1_322_507160414', '10xVisiumSpatialTranscriptomics-AuxiliaryFiles', '10U24-039', 'png', 'SpaceRanger v1.2.0', 'HTAN HTAPP', 'syn51300313', 12, 261021, '0503646b16391e49efd2c5b0e0db7bf9', 'Release 5.1', NULL);