-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.other_assay_metadata_r5`
(
  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"),
  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)"),
  Assay_Type STRING OPTIONS(description="The type and level of assay this metadata applies to (e.g. RPPA, NanoString DSP, etc.)"),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  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 OTHER ASSAY METADATA R5 VERSIONED",
  description="This table contains metadata for files annotated under the minimal assay template. 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.other_assay_metadata_r5` (HTAN_Parent_Biospecimen_ID, Filename, entityId, Id, HTAN_Data_File_ID, Assay_Type, Component, File_Format, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('HTA10_01_002', 'scatacseq_level_3/A001-C-002-D_20200702_fragments.tsv.gz.tbi', 'syn26530677', '36c96776-e11a-4cc1-b547-9a6b88cbbc20', 'HTA10_01_24813251029914057924496372243350', 'scatacseq', 'OtherAssay', 'tsv', 'HTAN Stanford', 'syn39285323', 1, 1333782, 'ce81d2f1a2991eaf79c4e9637224ddfa', 'Release 2.0', NULL), ('HTA10_01_007', 'scatacseq_level_3/A001-C-007-D_20200817_fragments.tsv.gz', 'syn26530717', 'be8e6629-0f98-4a30-8236-65f6278b7069', 'HTA10_01_22754207565743126839200012069191', 'scatacseq', 'OtherAssay', 'tsv', 'HTAN Stanford', 'syn39285323', 1, 1398192322, '227fe20756f743b268d9200a12069b9b', 'Release 2.0', NULL), ('HTA10_01_007', 'scatacseq_level_3/A001-C-007-D_20200817_fragments.tsv.gz.tbi', 'syn26530676', '42687e08-c505-475e-b9ad-cb7f9a9ca71b', 'HTA10_01_45330450212893152387278930364074', 'scatacseq', 'OtherAssay', 'tsv', 'HTAN Stanford', 'syn39285323', 1, 897342, '4f3da450cbc893bf23872789d0d6407e', 'Release 2.0', NULL), ('HTA10_01_014', 'scatacseq_level_3/A001-C-014-D_20200715_fragments.tsv.gz', 'syn26530702', 'd3b79fbd-b425-4efb-b8f7-f3a6f9958e66', 'HTA10_01_23019330125021588616373057625058', 'scatacseq', 'OtherAssay', 'tsv', 'HTAN Stanford', 'syn39285323', 1, 824879887, 'cda19d3a1cf02b588616d730576c5058', 'Release 2.0', NULL), ('HTA10_01_014', 'scatacseq_level_3/A001-C-014-D_20200715_fragments.tsv.gz.tbi', 'syn26530716', 'c1b64da0-4b8b-4838-ab07-4116d7b1cdde', 'HTA10_01_31123318309845371028292660256250', 'scatacseq', 'OtherAssay', 'tsv', 'HTAN Stanford', 'syn39285323', 1, 724493, 'db1c331830984f3710c829266a256cf0', 'Release 2.0', NULL);