-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.scRNAseq_level2_metadata_r4`
(
  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)"),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  Aligned_Read_Length STRING OPTIONS(description="Read length used for alignment if hard trimming was applied"),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  Genomic_Reference STRING OPTIONS(description="Exact version of the human genome reference used in the alignment of reads (e.g. GCF_000001405.39)"),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Applied_Hard_Trimming STRING OPTIONS(description="Was Hard Trimming applied"),
  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"),
  Checksum STRING OPTIONS(description="MD5 checksum of the BAM file"),
  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)"),
  Workflow_Link STRING OPTIONS(description="Link to workflow or command. DockStore.org recommended. URL"),
  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"),
  Workflow_Version STRING OPTIONS(description="Major version of the workflow (e.g. Cell Ranger v3.1)"),
  Whitelist_Cell_Barcode_File_Link STRING OPTIONS(description="Link to file listing all possible cell barcodes. URL"),
  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)"),
  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)"),
  scRNAseq_Workflow_Type STRING OPTIONS(description="Generic name for the workflow used to analyze a data set."),
  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 2 METADATA R4 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 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_level2_metadata_r4` (HTAN_Data_File_ID, Id, Aligned_Read_Length, entityId, Genomic_Reference, Component, Applied_Hard_Trimming, scRNAseq_Workflow_Parameters_Description, Checksum, Cell_Barcode_Tag, UMI_Tag, Workflow_Link, File_Format, Filename, HTAN_Parent_Data_File_ID, Workflow_Version, Whitelist_Cell_Barcode_File_Link, Genome_Annotation_URL, Genomic_Reference_URL, scRNAseq_Workflow_Type, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('HTA8_1012_210001', '6174b958-5ede-4107-b716-c237ea321269', NULL, 'syn24988994', 'hg38_long_polya', 'ScRNA-seqLevel2', 'No', 'Default parameters for SEQC', 'a03b84316c5a01ffb624b7e21af593fb', 'First field in read name (column 1)', 'Second field in read name (column 1)', 'https://github.com/dpeerlab/seqc', 'bam', 'single_cell_RNAseq_level_2/bam.ENSEMBL/HTA8_1012_1/RU255B_BRAINMET_Aligned.out.bam', 'HTA8_1012_110001,HTA8_1012_110002,HTA8_1012_110003,HTA8_1012_110004,HTA8_1012_110005,HTA8_1012_110006,HTA8_1012_110007,HTA8_1012_110008,HTA8_1012_110009,HTA8_1012_110010,HTA8_1012_110011,HTA8_1012_110012,HTA8_1012_110013,HTA8_1012_110014,HTA8_1012_110015,HTA8_1012_110016', '0.2.8', 's3://dplab-data/barcodes/ten_x_v2/flat/', 's3://seqc-public/genomes/hg38_long_polya/annotations.gtf', 's3://seqc-public/genomes/hg38_long_polya/', 'SEQC', 'HTAN MSK', 'syn39253429', 1, 15710113775, 'a03b84316c5a01ffb624b7e21af593fb', 'Release 1.0', 'v22.12.1.seq'), ('HTA8_1013_210001', '8eaa69a4-0501-4f2f-aa48-0d162f17ab0d', NULL, 'syn24988993', 'hg38_long_polya', 'ScRNA-seqLevel2', 'No', 'Default parameters for SEQC', '63569ba4840ff5ee9ae204c6bafe39ae', 'First field in read name (column 1)', 'Second field in read name (column 1)', 'https://github.com/dpeerlab/seqc', 'bam', 'single_cell_RNAseq_level_2/bam.ENSEMBL/HTA8_1013_1/RU653_TUMOR_Aligned.out.bam', 'HTA8_1013_110001,HTA8_1013_110002,HTA8_1013_110003,HTA8_1013_110004,HTA8_1013_110005,HTA8_1013_110006,HTA8_1013_110007,HTA8_1013_110008,HTA8_1013_110009,HTA8_1013_110010,HTA8_1013_110011,HTA8_1013_110012,HTA8_1013_110013,HTA8_1013_110014,HTA8_1013_110015,HTA8_1013_110016', '0.2.8', 's3://dplab-data/barcodes/ten_x_v2/flat/', 's3://seqc-public/genomes/hg38_long_polya/annotations.gtf', 's3://seqc-public/genomes/hg38_long_polya/', 'SEQC', 'HTAN MSK', 'syn39253429', 1, 13153177477, '63569ba4840ff5ee9ae204c6bafe39ae', 'Release 1.0', 'v22.12.1.seq'), ('HTA8_1014_210001', '0b21958d-f45a-4640-987e-85937a14377f', NULL, 'syn24989017', 'hg38_long_polya', 'ScRNA-seqLevel2', 'No', 'Default parameters for SEQC', '2f4ab18432c5e0c56d971132634c8b9c', 'First field in read name (column 1)', 'Second field in read name (column 1)', 'https://github.com/dpeerlab/seqc', 'bam', 'single_cell_RNAseq_level_2/bam.ENSEMBL/HTA8_1014_1/RU661_TUMOR_Aligned.out.bam', 'HTA8_1014_110001,HTA8_1014_110002,HTA8_1014_110003,HTA8_1014_110004,HTA8_1014_110005,HTA8_1014_110006,HTA8_1014_110007,HTA8_1014_110008,HTA8_1014_110009,HTA8_1014_110010,HTA8_1014_110011,HTA8_1014_110012,HTA8_1014_110013,HTA8_1014_110014,HTA8_1014_110015,HTA8_1014_110016', '0.2.8', 's3://dplab-data/barcodes/ten_x_v2/flat/', 's3://seqc-public/genomes/hg38_long_polya/annotations.gtf', 's3://seqc-public/genomes/hg38_long_polya/', 'SEQC', 'HTAN MSK', 'syn39253429', 1, 19500866497, '2f4ab18432c5e0c56d971132634c8b9c', 'Release 1.0', 'v22.12.1.seq'), ('HTA8_1015_210001', 'f6d4b357-48cc-4870-8cb0-c0fcf2921d56', NULL, 'syn24989018', 'hg38_long_polya', 'ScRNA-seqLevel2', 'No', 'Default parameters for SEQC', '2a3fe345462973a818d394a09bc214a1', 'First field in read name (column 1)', 'Second field in read name (column 1)', 'https://github.com/dpeerlab/seqc', 'bam', 'single_cell_RNAseq_level_2/bam.ENSEMBL/HTA8_1015_1/RU666_SPINEMET_Aligned.out.bam', 'HTA8_1015_110001,HTA8_1015_110002,HTA8_1015_110003,HTA8_1015_110004,HTA8_1015_110005,HTA8_1015_110006,HTA8_1015_110007,HTA8_1015_110008,HTA8_1015_110009,HTA8_1015_110010,HTA8_1015_110011,HTA8_1015_110012,HTA8_1015_110013,HTA8_1015_110014,HTA8_1015_110015,HTA8_1015_110016', '0.2.8', 's3://dplab-data/barcodes/ten_x_v2/flat/', 's3://seqc-public/genomes/hg38_long_polya/annotations.gtf', 's3://seqc-public/genomes/hg38_long_polya/', 'SEQC', 'HTAN MSK', 'syn39253429', 1, 16036328192, '2a3fe345462973a818d394a09bc214a1', 'Release 1.0', 'v22.12.1.seq'), ('HTA8_1016_210001', '4807a3f1-5651-4128-b723-62e8d757baa9', NULL, 'syn24989026', 'hg38_long_polya', 'ScRNA-seqLevel2', 'No', 'Default parameters for SEQC', '99c6123175d980b85bc6899183b84293', 'First field in read name (column 1)', 'Second field in read name (column 1)', 'https://github.com/dpeerlab/seqc', 'bam', 'single_cell_RNAseq_level_2/bam.ENSEMBL/HTA8_1016_1/RU675_TUMOR_Aligned.out.bam', 'HTA8_1016_110001,HTA8_1016_110002,HTA8_1016_110003,HTA8_1016_110004,HTA8_1016_110005,HTA8_1016_110006,HTA8_1016_110007,HTA8_1016_110008,HTA8_1016_110009,HTA8_1016_110010,HTA8_1016_110011,HTA8_1016_110012,HTA8_1016_110013,HTA8_1016_110014,HTA8_1016_110015,HTA8_1016_110016', '0.2.8', 's3://dplab-data/barcodes/ten_x_v2/flat/', 's3://seqc-public/genomes/hg38_long_polya/annotations.gtf', 's3://seqc-public/genomes/hg38_long_polya/', 'SEQC', 'HTAN MSK', 'syn39253429', 1, 14843572911, '99c6123175d980b85bc6899183b84293', 'Release 1.0', 'v22.12.1.seq');