-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.scRNAseq_level3_metadata_r4`
(
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  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_Version STRING OPTIONS(description="Major version of the workflow (e.g. Cell Ranger v3.1)"),
  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_Genes STRING OPTIONS(description="Median number of genes detected per cell. Number"),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  Data_Category STRING OPTIONS(description="Specific content type of the data file."),
  Matrix_Type STRING OPTIONS(description="Type of data stored in matrix."),
  Linked_Matrices STRING OPTIONS(description="All matrices associated with every part of a SingleCellExperiment object. Comma-delimited list of filenames"),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Workflow_Link STRING OPTIONS(description="Link to workflow or command. DockStore.org recommended. URL"),
  Cell_Total STRING OPTIONS(description="Number of sequenced  cells. Applies to raw counts matrix only."),
  Cell_Median_Number_Reads STRING OPTIONS(description="Median number of reads per cell. Number"),
  scRNAseq_Workflow_Type STRING OPTIONS(description="Generic name for the workflow used to analyze a data set."),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  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"),
  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 R4 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 October 2023. 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_r4` (entityId, scRNAseq_Workflow_Parameters_Description, Workflow_Version, HTAN_Data_File_ID, Cell_Median_Number_Genes, Id, Data_Category, Matrix_Type, Linked_Matrices, Component, Workflow_Link, Cell_Total, Cell_Median_Number_Reads, scRNAseq_Workflow_Type, File_Format, Filename, HTAN_Parent_Data_File_ID, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('syn24827006', 'run cellranger count with --expect-cells=5000 and GRCh38.p13 as reference', 'Cellranger v3.1.0', 'HTA3_8001_8036695618', '1455', 'b3b20601-68d8-47a5-80b0-61422e5e4ed8', 'Gene Expression', 'Raw Counts', 'HTA3_8001_2715996222,HTA3_8001_6402630869,HTA3_8001_8036695618', 'ScRNA-seqLevel3', 'https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ct', '7905', '3675', 'CellRanger', 'csv', 'sc_rna_seq_level_3/Linh_UCLA/Case1_GGO_rawCount.csv', 'HTA3_8001_4364721293', 'HTAN BU', 'syn39148008', 2, 326944073, '459372f01b304be62d120ed4d52e7242', 'Release 1.0', NULL), ('syn24827008', 'run cellranger count with --expect-cells=5000 and GRCh38.p13 as reference', 'Cellranger v3.1.0', 'HTA3_8001_4152544161', '1165', '62deb270-2406-4f76-904f-1c89365064f2', 'Gene Expression', 'Raw Counts', 'HTA3_8001_8707583701,HTA3_8001_0344122741,HTA3_8001_4152544161', 'ScRNA-seqLevel3', 'https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ct', '10117', '2931', 'CellRanger', 'csv', 'sc_rna_seq_level_3/Linh_UCLA/Case1_Normal_rawCount.csv', 'HTA3_8001_6680165667', 'HTAN BU', 'syn39148008', 2, 417958320, 'c1fac7ebfb8bb2251b6ae76d2a378fa1', 'Release 1.0', NULL), ('syn24827003', 'run cellranger count with --expect-cells=5000 and GRCh38.p13 as reference', 'Cellranger v3.1.0', 'HTA3_8002_1070928348', '916', '28e4745a-778c-4aed-8070-c9f861e449f3', 'Gene Expression', 'Raw Counts', 'HTA3_8002_1868767731,HTA3_8002_5549497360,HTA3_8002_1070928348', 'ScRNA-seqLevel3', 'https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ct', '7063', '2045', 'CellRanger', 'csv', 'sc_rna_seq_level_3/Linh_UCLA/Case2_GGO_rawCount.csv', 'HTA3_8002_4299655015', 'HTAN BU', 'syn39148008', 2, 291850133, 'd3caf4ad16469c96615bf902f9eb39dc', 'Release 1.0', NULL), ('syn24827007', 'run cellranger count with --expect-cells=5000 and GRCh38.p13 as reference', 'Cellranger v3.1.0', 'HTA3_8002_6233987092', '1088', '685bb7a4-79fe-47ea-bb5e-e6f5d11c0699', 'Gene Expression', 'Raw Counts', 'HTA3_8002_0358706820,HTA3_8002_3888427351,HTA3_8002_6233987092', 'ScRNA-seqLevel3', 'https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ct', '9003', '2973', 'CellRanger', 'csv', 'sc_rna_seq_level_3/Linh_UCLA/Case2_Normal_rawCount.csv', 'HTA3_8002_2468479416', 'HTAN BU', 'syn39148008', 2, 372114997, '66eeb4044e1791dfd2e093a3d0cba414', 'Release 1.0', NULL), ('syn24827012', 'run cellranger count with --expect-cells=5000 and GRCh38.p13 as reference', 'Cellranger v3.1.0', 'HTA3_8002_1208194106', '1071', '5a1dcd24-a1ef-4b24-91d4-6494c4d1e276', 'Gene Expression', 'Raw Counts', 'HTA3_8002_4636267728,HTA3_8002_4260764993,HTA3_8002_1208194106', 'ScRNA-seqLevel3', 'https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ct', '8833', '3633', 'CellRanger', 'csv', 'sc_rna_seq_level_3/Linh_UCLA/Case2_Tumor_rawCount.csv', 'HTA3_8002_3312066038', 'HTAN BU', 'syn39148008', 2, 365287636, '4b85cc2dc3b89371f09db5620b94703a', 'Release 1.0', NULL);