-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.scRNAseq_level3_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)"),
  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"),
  Cell_Median_Number_Reads STRING OPTIONS(description="Median number of reads per cell. Number"),
  Cell_Median_Number_Genes STRING OPTIONS(description="Median number of genes detected per cell. Number"),
  Cell_Total STRING OPTIONS(description="Number of sequenced  cells. Applies to raw counts matrix only."),
  scRNAseq_Workflow_Type STRING OPTIONS(description="Generic name for the workflow used to analyze a data set."),
  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"),
  Workflow_Version STRING OPTIONS(description="Major version of the workflow (e.g. Cell Ranger v3.1)"),
  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 3 METADATA R3 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 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_level3_metadata_r3` (Component, Filename, File_Format, HTAN_Parent_Data_File_ID, HTAN_Data_File_ID, Data_Category, Matrix_Type, Linked_Matrices, Cell_Median_Number_Reads, Cell_Median_Number_Genes, Cell_Total, scRNAseq_Workflow_Type, scRNAseq_Workflow_Parameters_Description, Workflow_Link, Workflow_Version, entityId, HTAN_Center, Data_Release, Manifest_Version, Uuid, File_Size, md5, CDS_Release) VALUES ('ScRNA-seqLevel3', 'sc_rna_seq_level_3/Linh_UCLA/Case1_GGO_rawCount.csv', 'csv', 'HTA3_8001_4364721293', 'HTA3_8001_8036695618', 'Gene Expression', 'Raw Counts', 'HTA3_8001_2715996222,HTA3_8001_6402630869,HTA3_8001_8036695618', '3675', '1455', '7905', 'CellRanger', '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', 'Cellranger v3.1.0', 'syn24827006', 'HTAN BU', 'Release 1.0', 2, 'b3b20601-68d8-47a5-80b0-61422e5e4ed8', 326944073, '459372f01b304be62d120ed4d52e7242', NULL), ('ScRNA-seqLevel3', 'sc_rna_seq_level_3/Linh_UCLA/Case1_Normal_rawCount.csv', 'csv', 'HTA3_8001_6680165667', 'HTA3_8001_4152544161', 'Gene Expression', 'Raw Counts', 'HTA3_8001_8707583701,HTA3_8001_0344122741,HTA3_8001_4152544161', '2931', '1165', '10117', 'CellRanger', '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', 'Cellranger v3.1.0', 'syn24827008', 'HTAN BU', 'Release 1.0', 2, '62deb270-2406-4f76-904f-1c89365064f2', 417958320, 'c1fac7ebfb8bb2251b6ae76d2a378fa1', NULL), ('ScRNA-seqLevel3', 'sc_rna_seq_level_3/Linh_UCLA/Case2_GGO_rawCount.csv', 'csv', 'HTA3_8002_4299655015', 'HTA3_8002_1070928348', 'Gene Expression', 'Raw Counts', 'HTA3_8002_1868767731,HTA3_8002_5549497360,HTA3_8002_1070928348', '2045', '916', '7063', 'CellRanger', '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', 'Cellranger v3.1.0', 'syn24827003', 'HTAN BU', 'Release 1.0', 2, '28e4745a-778c-4aed-8070-c9f861e449f3', 291850133, 'd3caf4ad16469c96615bf902f9eb39dc', NULL), ('ScRNA-seqLevel3', 'sc_rna_seq_level_3/Linh_UCLA/Case2_Normal_rawCount.csv', 'csv', 'HTA3_8002_2468479416', 'HTA3_8002_6233987092', 'Gene Expression', 'Raw Counts', 'HTA3_8002_0358706820,HTA3_8002_3888427351,HTA3_8002_6233987092', '2973', '1088', '9003', 'CellRanger', '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', 'Cellranger v3.1.0', 'syn24827007', 'HTAN BU', 'Release 1.0', 2, '685bb7a4-79fe-47ea-bb5e-e6f5d11c0699', 372114997, '66eeb4044e1791dfd2e093a3d0cba414', NULL), ('ScRNA-seqLevel3', 'sc_rna_seq_level_3/Linh_UCLA/Case2_Tumor_rawCount.csv', 'csv', 'HTA3_8002_3312066038', 'HTA3_8002_1208194106', 'Gene Expression', 'Raw Counts', 'HTA3_8002_4636267728,HTA3_8002_4260764993,HTA3_8002_1208194106', '3633', '1071', '8833', 'CellRanger', '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', 'Cellranger v3.1.0', 'syn24827012', 'HTAN BU', 'Release 1.0', 2, '5a1dcd24-a1ef-4b24-91d4-6494c4d1e276', 365287636, '4b85cc2dc3b89371f09db5620b94703a', NULL);