-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.scATACseq_level1_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_Biospecimen_ID STRING OPTIONS(description="HTAN Biospecimen Identifier (eg HTANx_yyy_zzz) indicating the biospecimen(s) from which these files were derived; multiple parent biospecimen should be comma-separated"),
  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)"),
  Nucleic_Acid_Source STRING OPTIONS(description="The source of the input nucleic molecule"),
  Dissociation_Method STRING OPTIONS(description="The tissue dissociation method used for scRNASeq or scATAC-seq assays"),
  Single_Nucleus_Buffer STRING OPTIONS(description="Nuclei isolation buffer"),
  Single_Cell_Isolation_Method STRING OPTIONS(description="The method by which cells are isolated into individual reaction containers at a single cell resolution (e.g. wells, micro-droplets)"),
  Transposition_Reaction STRING OPTIONS(description="Name of the transposase, transposon sequences"),
  scATACseq_Library_Layout STRING OPTIONS(description="Sequencing read type"),
  Nucleus_Identifier STRING OPTIONS(description="Unique nuclei barcode; added at transposition step. Determines which nucleus the reads originated from"),
  scATACseq_Read3 STRING OPTIONS(description="Read 3 content description"),
  Library_Construction_Method STRING OPTIONS(description="Process which results in the creation of a library from fragments of DNA using cloning vectors or oligonucleotides with the role of adaptors [OBI_0000711]"),
  Sequencing_Platform STRING OPTIONS(description="A platform is an object aggregate that is the set of instruments and software needed to perform a process [OBI_0000050]. Specific model of the sequencing instrument."),
  Threshold_for_Minimum_Passing_Reads STRING OPTIONS(description="Threshold for calling cells"),
  Total_Number_of_Passing_Nuclei STRING OPTIONS(description="Number of nuclei sequenced"),
  Median_Fraction_of_Reads_in_Peaks STRING OPTIONS(description="Median fraction of reads in peaks (FRIP)"),
  Median_Fraction_of_Reads_in_Annotated_cis_DNA_Elements STRING OPTIONS(description="Median fraction of reads in annotated cis-DNA elements (FRIADE)"),
  Median_Passing_Read_Percentage STRING OPTIONS(description="Non-PCR duplicate nuclear genomic sequence reads not aligning to unanchored contigs out of total reads assigned to the nucleus barcode"),
  Median_Percentage_of_Mitochondrial_Reads_per_Nucleus STRING OPTIONS(description="Contamination from mitochondrial sequences"),
  Technical_Replicate_Group STRING OPTIONS(description="A common term for all files belonging to the same cell or library. Provide a numbering of each library prep batch (can differ from encapsulation and sequencing batch)"),
  Total_Reads STRING OPTIONS(description="Total number of reads per sample. Integer"),
  Protocol_Link STRING OPTIONS(description="Protocols.io ID or DOI link to a free/open protocol resource describing in detail the assay protocol (e.g. surface markers used in Smart-seq, dissociation duration,  lot/batch numbers for key reagents such as primers, sequencing reagent kits, etc.) or the protocol by which the sample was obtained or generated."),
  Peaks_Calling_Software STRING OPTIONS(description="Generic name of peaks calling tool"),
  MapQ30 STRING OPTIONS(description="Number of reads with Quality >= 30."),
  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 SCATACSEQ LEVEL 1 METADATA R3 VERSIONED",
  description="This table contains the file metadata for first level (i.e. fastq) single cell ATAC 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.scATACseq_level1_metadata_r3` (Component, Filename, File_Format, HTAN_Parent_Biospecimen_ID, HTAN_Data_File_ID, Nucleic_Acid_Source, Dissociation_Method, Single_Nucleus_Buffer, Single_Cell_Isolation_Method, Transposition_Reaction, scATACseq_Library_Layout, Nucleus_Identifier, scATACseq_Read3, Library_Construction_Method, Sequencing_Platform, Threshold_for_Minimum_Passing_Reads, Total_Number_of_Passing_Nuclei, Median_Fraction_of_Reads_in_Peaks, Median_Fraction_of_Reads_in_Annotated_cis_DNA_Elements, Median_Passing_Read_Percentage, Median_Percentage_of_Mitochondrial_Reads_per_Nucleus, Technical_Replicate_Group, Total_Reads, Protocol_Link, Peaks_Calling_Software, MapQ30, entityId, HTAN_Center, Data_Release, Manifest_Version, Uuid, File_Size, md5, CDS_Release) VALUES ('ScATAC-seqLevel1', 'single_cell_ATACseq_level_1_CLEAN/HD_2153_Live_scATAC/HD_2153_Live_scATAC_S1_L001_R1_001.fastq.gz', 'fastq', 'HTA4_28_1006', 'HTA4_28_50031', 'Single Nucleus', 'Not Applicable', '10x', 'FACS', 'Tn5', 'scATACseq Paired End', 'Nuclei Barcode', 'DNA Insert', '10xV1.0', 'Illumina NovaSeq 6000', '3000', '5055', '0.568', '0.608', '70', '0.1', NULL, '215446016', 'https://support.10xgenomics.com/single-cell-atac/library-prep/doc/user-guide-chromium-single-cell-atac-reagent-kits-user-guide-v1-chemistry', 'MACS2', NULL, 'syn51180099', 'HTAN CHOP', 'Release 3.0', 6, '8189eea9-365f-40a4-a121-1ef08ed5ed75', 3343143630, 'a4f969abc48c274bad3f9f43d28d1979', NULL), ('ScATAC-seqLevel1', 'single_cell_ATACseq_level_1_CLEAN/HD_2153_Live_scATAC/HD_2153_Live_scATAC_S1_L001_R2_001.fastq.gz', 'fastq', 'HTA4_28_1006', 'HTA4_28_50032', 'Single Nucleus', 'Not Applicable', '10x', 'FACS', 'Tn5', 'scATACseq Paired End', 'Nuclei Barcode', 'DNA Insert', '10xV1.0', 'Illumina NovaSeq 6000', '3000', '5055', '0.568', '0.608', '70', '0.1', NULL, '215446016', 'https://support.10xgenomics.com/single-cell-atac/library-prep/doc/user-guide-chromium-single-cell-atac-reagent-kits-user-guide-v1-chemistry', 'MACS2', NULL, 'syn51180098', 'HTAN CHOP', 'Release 3.0', 6, 'fab0dba2-7554-4400-aabe-c610b07ed158', 1820188232, '2ca35d22895ccc8ba5dec3838e5c6274', NULL), ('ScATAC-seqLevel1', 'single_cell_ATACseq_level_1_CLEAN/HD_2153_Live_scATAC/HD_2153_Live_scATAC_S1_L001_R3_001.fastq.gz', 'fastq', 'HTA4_28_1006', 'HTA4_28_50033', 'Single Nucleus', 'Not Applicable', '10x', 'FACS', 'Tn5', 'scATACseq Paired End', 'Nuclei Barcode', 'DNA Insert', '10xV1.0', 'Illumina NovaSeq 6000', '3000', '5055', '0.568', '0.608', '70', '0.1', NULL, '215446016', 'https://support.10xgenomics.com/single-cell-atac/library-prep/doc/user-guide-chromium-single-cell-atac-reagent-kits-user-guide-v1-chemistry', 'MACS2', NULL, 'syn51180101', 'HTAN CHOP', 'Release 3.0', 6, 'd7b268ab-818f-4875-85b2-38ae97e2c897', 3404289599, '1eed59af5a9612b8688cbaba54acb485', NULL), ('ScATAC-seqLevel1', 'single_cell_ATACseq_level_1_CLEAN/HD_2153_Live_scATAC/HD_2153_Live_scATAC_S1_L002_R1_001.fastq.gz', 'fastq', 'HTA4_28_1006', 'HTA4_28_50034', 'Single Nucleus', 'Not Applicable', '10x', 'FACS', 'Tn5', 'scATACseq Paired End', 'Nuclei Barcode', 'DNA Insert', '10xV1.0', 'Illumina NovaSeq 6000', '3000', '5055', '0.568', '0.608', '70', '0.1', NULL, '215446016', 'https://support.10xgenomics.com/single-cell-atac/library-prep/doc/user-guide-chromium-single-cell-atac-reagent-kits-user-guide-v1-chemistry', 'MACS2', NULL, 'syn51180102', 'HTAN CHOP', 'Release 3.0', 6, 'c9be16b1-5821-4dbe-9670-9fbd032fd03d', 3331517235, '474c2b61ce3a4a3849c8d8db5e684b1e', NULL), ('ScATAC-seqLevel1', 'single_cell_ATACseq_level_1_CLEAN/HD_2153_Live_scATAC/HD_2153_Live_scATAC_S1_L002_R2_001.fastq.gz', 'fastq', 'HTA4_28_1006', 'HTA4_28_50035', 'Single Nucleus', 'Not Applicable', '10x', 'FACS', 'Tn5', 'scATACseq Paired End', 'Nuclei Barcode', 'DNA Insert', '10xV1.0', 'Illumina NovaSeq 6000', '3000', '5055', '0.568', '0.608', '70', '0.1', NULL, '215446016', 'https://support.10xgenomics.com/single-cell-atac/library-prep/doc/user-guide-chromium-single-cell-atac-reagent-kits-user-guide-v1-chemistry', 'MACS2', NULL, 'syn51180100', 'HTAN CHOP', 'Release 3.0', 6, '1c3c79c4-994f-45ef-a66d-ba397949ae9d', 1811159157, '703f4ad49342e7ec65ab8fbcdd70c0c4', NULL);