-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.scRNAseq_level2_metadata_r3`
(
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Filename STRING OPTIONS(description="Name of a file"),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  HTAN_Parent_Data_File_ID STRING OPTIONS(description="HTAN Data File Identifier indicating the file(s) from which these files were derived"),
  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)"),
  scRNAseq_Workflow_Type STRING OPTIONS(description="Generic name for the workflow used to analyze a data set."),
  Workflow_Version STRING OPTIONS(description="Major version of the workflow (e.g. Cell Ranger v3.1)"),
  scRNAseq_Workflow_Parameters_Description STRING OPTIONS(description="Parameters used to run the workflow. scRNA-seq level 3: e.g. Normalization and log transformation, ran empty drops or doublet detection, used filter on # genes/cell, etc. scRNA-seq Level 4: dimensionality reduction with PCA and 50 components, nearest-neighbor graph with k = 20 and Leiden clustering with resolution = 1, UMAP visualization using 50 PCA components, marker genes used to annotate cell types, information about droplet matrix (all barcodes) to cell matrix (only informative barcodes representing real cells) conversion"),
  Workflow_Link STRING OPTIONS(description="Link to workflow or command. DockStore.org recommended. URL"),
  Genomic_Reference STRING OPTIONS(description="Exact version of the human genome reference used in the alignment of reads (e.g. GCF_000001405.39)"),
  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)"),
  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)"),
  Checksum STRING OPTIONS(description="MD5 checksum of the BAM file"),
  Whitelist_Cell_Barcode_File_Link STRING OPTIONS(description="Link to file listing all possible cell barcodes. URL"),
  Cell_Barcode_Tag STRING OPTIONS(description="SAM tag for cell barcode field; please provide a valid cell barcode tag (e.g. CB:Z)"),
  UMI_Tag STRING OPTIONS(description="SAM tag for the UMI field; please provide a valid UB, UMI (e.g. UB:Z or UR:Z)"),
  Applied_Hard_Trimming STRING OPTIONS(description="Was Hard Trimming applied"),
  Is_lowest_level STRING OPTIONS(description="Denotes that the manifest represents the lowest data level submitted. Use when L1 data is missing"),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  HTAN_Center STRING OPTIONS(description="Name of HTAN Center e.g. HTAN HTAPP"),
  Data_Release STRING OPTIONS(description="Inclusion in HTAN Data Release e.g. Release 1.0"),
  Manifest_Version INT64 OPTIONS(description="Latest version of metadata manifest"),
  Uuid STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  File_Size INT64 OPTIONS(description="Size of file (bucket object) in bytes"),
  md5 STRING OPTIONS(description="md5 hash of file"),
  CDS_Release STRING OPTIONS(description="CDS transfer package in which file was included e.g. v22.6.1.seq")
)
OPTIONS(
  friendly_name="HTAN SCRNASEQ LEVEL 2 METADATA R3 VERSIONED",
  description="This table contains the file metadata for second level (i.e. BAM files) single cell RNA sequencing. Data was extracted from HTAN Synapse projects in April 2023. More details: see https://data.humantumoratlas.org/standard/sequencing",
  labels=[("access", "open"), ("data_type", "file_metadata"), ("program", "htan"), ("source", "htan"), ("status", "current"), ("category", "metadata")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.scRNAseq_level2_metadata_r3` (Component, Filename, File_Format, HTAN_Parent_Data_File_ID, HTAN_Data_File_ID, scRNAseq_Workflow_Type, Workflow_Version, scRNAseq_Workflow_Parameters_Description, Workflow_Link, Genomic_Reference, Genomic_Reference_URL, Genome_Annotation_URL, Checksum, Whitelist_Cell_Barcode_File_Link, Cell_Barcode_Tag, UMI_Tag, Applied_Hard_Trimming, Is_lowest_level, entityId, HTAN_Center, Data_Release, Manifest_Version, Uuid, File_Size, md5, CDS_Release) VALUES ('ScRNA-seqLevel2', 'sc_rna_seq_level_2/Linh_UCLA/Case1_GGO/possorted_genome_bam.bam', 'bam', 'HTA3_8001_7837535366,HTA3_8001_5222399563', 'HTA3_8001_4364721293', 'CellRanger', '3.1.0', 'run cellranger count with --expect-cells=5000 and GRCh38.p13 as reference', 'https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ct', 'GRCh38.p13', 'ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_34/GRCh38.p13.genome.fa.gz', 'https://www.synapse.org/#!Synapse:syn22156721', 'edee5408303f6c1c6bae1c76ffd23671', 'https://github.com/10XGenomics/cellranger/raw/master/lib/python/cellranger/barcodes/3M-february-2018.txt.gz', 'CB', 'UB', 'No', NULL, 'syn24056878', 'HTAN BU', 'Release 1.0', 2, '89e1bf18-14bc-4cb7-b2de-ad1592737e03', 82063421293, 'cbe8678d2d6549441bc9ecf077984c8d', 'v22.12.1.seq'), ('ScRNA-seqLevel2', 'sc_rna_seq_level_2/Linh_UCLA/Case1_Normal/possorted_genome_bam.bam', 'bam', 'HTA3_8001_5548545798,HTA3_8001_6154142702', 'HTA3_8001_6680165667', 'CellRanger', '3.1.0', 'run cellranger count with --expect-cells=5000 and GRCh38.p13 as reference', 'https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ct', 'GRCh38.p13', 'ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_34/GRCh38.p13.genome.fa.gz', 'https://www.synapse.org/#!Synapse:syn22156721', 'edee5408303f6c1c6bae1c76ffd23671', 'https://github.com/10XGenomics/cellranger/raw/master/lib/python/cellranger/barcodes/3M-february-2018.txt.gz', 'CB', 'UB', 'No', NULL, 'syn24054937', 'HTAN BU', 'Release 1.0', 2, 'd2a5fe0f-b0f8-4385-a232-58b11b35f544', 69536477113, '1f8ee4f07dcf596b0d7ba618d9bf3123', 'v22.12.1.seq'), ('ScRNA-seqLevel2', 'sc_rna_seq_level_2/Linh_UCLA/Case2_GGO/possorted_genome_bam.bam', 'bam', 'HTA3_8002_3029856712,HTA3_8002_0107230297', 'HTA3_8002_4299655015', 'CellRanger', '3.1.0', 'run cellranger count with --expect-cells=5000 and GRCh38.p13 as reference', 'https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ct', 'GRCh38.p13', 'ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_34/GRCh38.p13.genome.fa.gz', 'https://www.synapse.org/#!Synapse:syn22156721', 'edee5408303f6c1c6bae1c76ffd23671', 'https://github.com/10XGenomics/cellranger/raw/master/lib/python/cellranger/barcodes/3M-february-2018.txt.gz', 'CB', 'UB', 'No', NULL, 'syn24046147', 'HTAN BU', 'Release 1.0', 2, '8ba3d9a1-874c-4757-80a4-c5f9709d9200', 41410519604, '3982b24f33ab221227a340538cdaa767', 'v22.12.1.seq'), ('ScRNA-seqLevel2', 'sc_rna_seq_level_2/Linh_UCLA/Case2_Normal/possorted_genome_bam.bam', 'bam', 'HTA3_8002_1747883314,HTA3_8002_1394371638', 'HTA3_8002_2468479416', 'CellRanger', '3.1.0', 'run cellranger count with --expect-cells=5000 and GRCh38.p13 as reference', 'https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ct', 'GRCh38.p13', 'ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_34/GRCh38.p13.genome.fa.gz', 'https://www.synapse.org/#!Synapse:syn22156721', 'edee5408303f6c1c6bae1c76ffd23671', 'https://github.com/10XGenomics/cellranger/raw/master/lib/python/cellranger/barcodes/3M-february-2018.txt.gz', 'CB', 'UB', 'No', NULL, 'syn24049904', 'HTAN BU', 'Release 1.0', 2, '747b75b7-8949-4182-bae2-25c00ffc734f', 47148032252, '7d4e5e067a022550cf5438614d2339b8', 'v22.12.1.seq'), ('ScRNA-seqLevel2', 'sc_rna_seq_level_2/Linh_UCLA/Case2_Tumor/possorted_genome_bam.bam', 'bam', 'HTA3_8002_3338382307,HTA3_8002_1745718508', 'HTA3_8002_3312066038', 'CellRanger', '3.1.0', 'run cellranger count with --expect-cells=5000 and GRCh38.p13 as reference', 'https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ct', 'GRCh38.p13', 'ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_34/GRCh38.p13.genome.fa.gz', 'https://www.synapse.org/#!Synapse:syn22156721', 'edee5408303f6c1c6bae1c76ffd23671', 'https://github.com/10XGenomics/cellranger/raw/master/lib/python/cellranger/barcodes/3M-february-2018.txt.gz', 'CB', 'UB', 'No', NULL, 'syn24048808', 'HTAN BU', 'Release 1.0', 2, 'f830ce66-71c5-4316-9af5-8629ec6e0806', 44192711755, '8ff00c7708a02fc3ac2210a67fbee9f6', 'v22.12.1.seq');