-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.10xvisium_spatialtranscriptomics_scRNAseq_level2_metadata_r5`
(
  Workflow_Link STRING OPTIONS(description="Link to workflow or command. DockStore.org recommended. URL"),
  Whitelist_Spatial_Barcode_File_Link STRING OPTIONS(description="Link to file listing all possible spatial barcodes. URL"),
  UMI_Tag STRING OPTIONS(description="SAM tag for the UMI field; please provide a valid UB, UMI (e.g. UB:Z or UR:Z)"),
  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."),
  Run_ID STRING OPTIONS(description="A unique identifier for this individual run (typically associated with a single slide) of the spatial transcriptomic processing workflow."),
  Aligned_Read_Length STRING OPTIONS(description="Read length used for alignment if hard trimming was applied"),
  HTAN_Parent_Data_File_ID STRING OPTIONS(description="HTAN Data File Identifier indicating the file(s) from which these files were derived"),
  Genomic_Reference_URL STRING OPTIONS(description="Link to human genome sequence (e.g. ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_34/GRCh38.primary_assembly.genome.fa.gz)"),
  Checksum STRING OPTIONS(description="MD5 checksum of the BAM file"),
  Genomic_Reference STRING OPTIONS(description="Exact version of the human genome reference used in the alignment of reads (e.g. GCF_000001405.39)"),
  Workflow_Version STRING OPTIONS(description="Major version of the workflow (e.g. Cell Ranger v3.1)"),
  Genome_Annotation_URL STRING OPTIONS(description="Link to the human genome annotation (GTF) file (e.g. ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_34/gencode.v34.annotation.gtf.gz)"),
  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"),
  Applied_Hard_Trimming STRING OPTIONS(description="Was Hard Trimming applied"),
  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."),
  Spatial_Barcode_Tag STRING OPTIONS(description="SAM tag for spot barcode field; please provide a valid spot barcode tag (e.g. CB:Z)"),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  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 VISIUM RNA-SEQ LEVEL 2 METADATA R5 VERSIONED",
  description="This table contains the file metadata for second level (i.e. BAM files) 10x Genomics Visium sequencing. 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/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_scRNAseq_level2_metadata_r5` (Workflow_Link, Whitelist_Spatial_Barcode_File_Link, UMI_Tag, HTAN_Data_File_ID, Component, Run_ID, Aligned_Read_Length, HTAN_Parent_Data_File_ID, Genomic_Reference_URL, Checksum, Genomic_Reference, Workflow_Version, Genome_Annotation_URL, HTAN_Parent_Biospecimen_ID, Filename, entityId, Applied_Hard_Trimming, Capture_Area, Spatial_Barcode_Tag, Id, File_Format, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('https://github.com/reykajayasinghe/HTAN/blob/main/Single_cell_preprocessing/run_spaceranger_1.2.2.sh', 'https://kb.10xgenomics.com/hc/en-us/articles/115004506263-What-is-a-barcode-whitelist-', 'CGGTGAAGAATA', 'HTA12_129_2000', '10xVisiumSpatialTranscriptomics-RNA-seqLevel2', 'V10U24-099', NULL, 'HTA12_129_1002;HTA12_129_1003', 'https://support.10xgenomics.com/spatial-gene-expression/software/downloads/latest', '3937f426e0cfe6adf6519f0200c1749f', 'refdata-gex-GRCh38-2020-A', 'spaceranger-1.1.0', 'https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-GRCh38-2020-A.tar.gz', 'HTA12_129_7', 'V10X_level_2_BRCA23/HT206B1-S1Fc1U2Z1B1-possorted_genome_bam.bam', 'syn53215155', 'no', NULL, 'TTCTACCTCAATCGGT-1', '39eec2f6-881f-4b46-85f1-366afd37d729', 'bam', 'HTAN WUSTL', 'syn53334358', 4, 18362107936, '3937f426e0cfe6adf6519f0200c1749f', 'Release 5.0', NULL), ('https://github.com/reykajayasinghe/HTAN/blob/main/Single_cell_preprocessing/run_spaceranger_1.2.2.sh', 'https://kb.10xgenomics.com/hc/en-us/articles/115004506263-What-is-a-barcode-whitelist-', 'GTCCCCATCTTT', 'HTA12_129_2001', '10xVisiumSpatialTranscriptomics-RNA-seqLevel2', 'V10U24-099', NULL, 'HTA12_129_1004;HTA12_129_1005', 'https://support.10xgenomics.com/spatial-gene-expression/software/downloads/latest', '96f197119ed77bb54810af3513683b55', 'refdata-gex-GRCh38-2020-A', 'spaceranger-1.1.0', 'https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-GRCh38-2020-A.tar.gz', 'HTA12_129_8', 'V10X_level_2_BRCA23/HT206B1-S1Fc1U3Z1B1-possorted_genome_bam.bam', 'syn53215571', 'no', NULL, 'AATGTGCCCGAGGTGT-1', '07e53f9b-236f-45fa-acc7-9eaead5e9e01', 'bam', 'HTAN WUSTL', 'syn53334358', 4, 22083840956, '96f197119ed77bb54810af3513683b55', 'Release 5.0', NULL), ('https://github.com/reykajayasinghe/HTAN/blob/main/Single_cell_preprocessing/run_spaceranger_1.2.2.sh', 'https://kb.10xgenomics.com/hc/en-us/articles/115004506263-What-is-a-barcode-whitelist-', 'GCTAAAAATGAG', 'HTA12_129_2002', '10xVisiumSpatialTranscriptomics-RNA-seqLevel2', 'V10U24-099', NULL, 'HTA12_129_1006;HTA12_129_1007', 'https://support.10xgenomics.com/spatial-gene-expression/software/downloads/latest', 'f4813ed1c49e036a774437a7c13180f3', 'refdata-gex-GRCh38-2020-A', 'spaceranger-1.1.0', 'https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-GRCh38-2020-A.tar.gz', 'HTA12_129_9', 'V10X_level_2_BRCA23/HT206B1-S1Fc1U4Z1B1-possorted_genome_bam.bam', 'syn53215748', 'no', NULL, 'TGCATATGTCTGTCAC-1', '13eb7340-a010-4c3a-ae63-057bbc5725c1', 'bam', 'HTAN WUSTL', 'syn53334358', 4, 26043345855, 'f4813ed1c49e036a774437a7c13180f3', 'Release 5.0', NULL), ('https://github.com/reykajayasinghe/HTAN/blob/main/Single_cell_preprocessing/run_spaceranger_1.2.2.sh', 'https://kb.10xgenomics.com/hc/en-us/articles/115004506263-What-is-a-barcode-whitelist-', 'GCTGAGTCAGGT', 'HTA12_134_2000', '10xVisiumSpatialTranscriptomics-RNA-seqLevel2', 'V10M12-008', NULL, 'HTA12_134_1002;HTA12_134_1003', 'https://support.10xgenomics.com/spatial-gene-expression/software/downloads/latest', 'e64ff689860e3d70e32a9dd8bfbefd7f', 'refdata-gex-GRCh38-2020-A', 'spaceranger-1.1.0', 'https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-GRCh38-2020-A.tar.gz', 'HTA12_134_3', 'V10X_level_2_BRCA23/HT235B1-S1Fc1U1Z1Bn2-possorted_genome_bam.bam', 'syn53215498', 'no', NULL, 'ACAACAGCATGAGCTA-1', 'a62b7b42-38f7-402d-b50c-3cb3fef6ca50', 'bam', 'HTAN WUSTL', 'syn53334358', 4, 21288583770, 'e64ff689860e3d70e32a9dd8bfbefd7f', 'Release 5.0', NULL), ('https://github.com/reykajayasinghe/HTAN/blob/main/Single_cell_preprocessing/run_spaceranger_1.2.2.sh', 'https://kb.10xgenomics.com/hc/en-us/articles/115004506263-What-is-a-barcode-whitelist-', 'ACACTCACTAGG', 'HTA12_134_2001', '10xVisiumSpatialTranscriptomics-RNA-seqLevel2', 'V10M12-008', NULL, 'HTA12_134_1004;HTA12_134_1005', 'https://support.10xgenomics.com/spatial-gene-expression/software/downloads/latest', 'e8685e4d09c3d6f2a9116f6d4be659bf', 'refdata-gex-GRCh38-2020-A', 'spaceranger-1.1.0', 'https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-GRCh38-2020-A.tar.gz', 'HTA12_134_4', 'V10X_level_2_BRCA23/HT235B1-S1Fc1U2Z1Bn2-possorted_genome_bam.bam', 'syn53215561', 'no', NULL, 'CAGGCCGTTTGGGTGT-1', '5f2d5771-d631-4fbe-9b3c-eac86d0564f4', 'bam', 'HTAN WUSTL', 'syn53334358', 4, 21971297326, 'e8685e4d09c3d6f2a9116f6d4be659bf', 'Release 5.0', NULL);