-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.scRNAseq_level3_metadata_r5`
(
  Workflow_Link STRING OPTIONS(description="Link to workflow or command. DockStore.org recommended. URL"),
  Data_Category STRING OPTIONS(description="Specific content type of the data file."),
  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"),
  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"),
  Cell_Total STRING OPTIONS(description="Number of sequenced  cells. Applies to raw counts matrix only."),
  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)"),
  Cell_Median_Number_Reads STRING OPTIONS(description="Median number of reads per cell. Number"),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Cell_Median_Number_Genes STRING OPTIONS(description="Median number of genes detected per cell. Number"),
  scRNAseq_Workflow_Type STRING OPTIONS(description="Generic name for the workflow used to analyze a data set."),
  Linked_Matrices STRING OPTIONS(description="All matrices associated with every part of a SingleCellExperiment object. Comma-delimited list of filenames"),
  Matrix_Type STRING OPTIONS(description="Type of data stored in matrix."),
  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 SCRNASEQ LEVEL 3 METADATA R5 VERSIONED",
  description="This table contains the file metadata for third level (i.e. expression quantification files) single cell RNA 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/sequencing",
  labels=[("access", "open"), ("data_type", "file_metadata"), ("program", "htan"), ("source", "htan"), ("category", "metadata"), ("status", "current")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.scRNAseq_level3_metadata_r5` (Workflow_Link, Data_Category, Filename, HTAN_Parent_Data_File_ID, scRNAseq_Workflow_Parameters_Description, Cell_Total, entityId, Id, HTAN_Data_File_ID, Cell_Median_Number_Reads, Component, Cell_Median_Number_Genes, scRNAseq_Workflow_Type, Linked_Matrices, Matrix_Type, File_Format, Workflow_Version, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ct', 'Gene Expression', 'sc_rna_seq_level_3/Linh_UCLA/Case1_GGO_rawCount.csv', 'HTA3_8001_4364721293', 'run cellranger count with --expect-cells=5000 and GRCh38.p13 as reference', '7905', 'syn24827006', 'b3b20601-68d8-47a5-80b0-61422e5e4ed8', 'HTA3_8001_8036695618', '3675', 'ScRNA-seqLevel3', '1455', 'CellRanger', 'HTA3_8001_2715996222,HTA3_8001_6402630869,HTA3_8001_8036695618', 'Raw Counts', 'csv', 'Cellranger v3.1.0', 'HTAN BU', 'syn39148008', 2, 326944073, '459372f01b304be62d120ed4d52e7242', 'Release 1.0', NULL), ('https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ct', 'Gene Expression', 'sc_rna_seq_level_3/Linh_UCLA/Case1_Normal_rawCount.csv', 'HTA3_8001_6680165667', 'run cellranger count with --expect-cells=5000 and GRCh38.p13 as reference', '10117', 'syn24827008', '62deb270-2406-4f76-904f-1c89365064f2', 'HTA3_8001_4152544161', '2931', 'ScRNA-seqLevel3', '1165', 'CellRanger', 'HTA3_8001_8707583701,HTA3_8001_0344122741,HTA3_8001_4152544161', 'Raw Counts', 'csv', 'Cellranger v3.1.0', 'HTAN BU', 'syn39148008', 2, 417958320, 'c1fac7ebfb8bb2251b6ae76d2a378fa1', 'Release 1.0', NULL), ('https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ct', 'Gene Expression', 'sc_rna_seq_level_3/Linh_UCLA/Case2_GGO_rawCount.csv', 'HTA3_8002_4299655015', 'run cellranger count with --expect-cells=5000 and GRCh38.p13 as reference', '7063', 'syn24827003', '28e4745a-778c-4aed-8070-c9f861e449f3', 'HTA3_8002_1070928348', '2045', 'ScRNA-seqLevel3', '916', 'CellRanger', 'HTA3_8002_1868767731,HTA3_8002_5549497360,HTA3_8002_1070928348', 'Raw Counts', 'csv', 'Cellranger v3.1.0', 'HTAN BU', 'syn39148008', 2, 291850133, 'd3caf4ad16469c96615bf902f9eb39dc', 'Release 1.0', NULL), ('https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ct', 'Gene Expression', 'sc_rna_seq_level_3/Linh_UCLA/Case2_Normal_rawCount.csv', 'HTA3_8002_2468479416', 'run cellranger count with --expect-cells=5000 and GRCh38.p13 as reference', '9003', 'syn24827007', '685bb7a4-79fe-47ea-bb5e-e6f5d11c0699', 'HTA3_8002_6233987092', '2973', 'ScRNA-seqLevel3', '1088', 'CellRanger', 'HTA3_8002_0358706820,HTA3_8002_3888427351,HTA3_8002_6233987092', 'Raw Counts', 'csv', 'Cellranger v3.1.0', 'HTAN BU', 'syn39148008', 2, 372114997, '66eeb4044e1791dfd2e093a3d0cba414', 'Release 1.0', NULL), ('https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ct', 'Gene Expression', 'sc_rna_seq_level_3/Linh_UCLA/Case2_Tumor_rawCount.csv', 'HTA3_8002_3312066038', 'run cellranger count with --expect-cells=5000 and GRCh38.p13 as reference', '8833', 'syn24827012', '5a1dcd24-a1ef-4b24-91d4-6494c4d1e276', 'HTA3_8002_1208194106', '3633', 'ScRNA-seqLevel3', '1071', 'CellRanger', 'HTA3_8002_4636267728,HTA3_8002_4260764993,HTA3_8002_1208194106', 'Raw Counts', 'csv', 'Cellranger v3.1.0', 'HTAN BU', 'syn39148008', 2, 365287636, '4b85cc2dc3b89371f09db5620b94703a', 'Release 1.0', NULL);