-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.scATACseq_level1_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"),
  scATACseq_Library_Layout STRING OPTIONS(description="Sequencing read type"),
  Total_Number_of_Passing_Nuclei STRING OPTIONS(description="Number of nuclei sequenced"),
  Empty_Well_Barcode STRING OPTIONS(description="Unique cell barcode assigned to empty cells used as controls in CEL-seq2 assays."),
  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)"),
  scATACseq_Read2 STRING OPTIONS(description="Read 2 content description"),
  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)"),
  Nuclei_Barcode_Read STRING OPTIONS(description="Nuclei Barcode Read"),
  Dissociation_Method STRING OPTIONS(description="The tissue dissociation method used for scRNASeq or scATAC-seq assays"),
  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."),
  Well_Index STRING OPTIONS(description="Indicate if protein expression (EPCAM/CD45) positive/negative data  is available for each cell in CEL-seq2 assays"),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  scATACseq_Read3 STRING OPTIONS(description="Read 3 content description"),
  Single_Nucleus_Buffer STRING OPTIONS(description="Nuclei isolation buffer"),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Transposition_Reaction STRING OPTIONS(description="Name of the transposase, transposon sequences"),
  Threshold_for_Minimum_Passing_Reads STRING OPTIONS(description="Threshold for calling cells"),
  scATACseq_Read1 STRING OPTIONS(description="Read 1 content description"),
  Median_Fraction_of_Reads_in_Annotated_cis_DNA_Elements STRING OPTIONS(description="Median fraction of reads in annotated cis-DNA elements (FRIADE)"),
  Nucleic_Acid_Source STRING OPTIONS(description="The source of the input nucleic molecule"),
  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"),
  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]"),
  Median_Fraction_of_Reads_in_Peaks STRING OPTIONS(description="Median fraction of reads in peaks (FRIP)"),
  Median_Percentage_of_Mitochondrial_Reads_per_Nucleus STRING OPTIONS(description="Contamination from mitochondrial sequences"),
  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"),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  Nuclei_Barcode_Length STRING OPTIONS(description="Nuclei Barcode Length"),
  Filename STRING OPTIONS(description="Name of a file"),
  Nucleus_Identifier STRING OPTIONS(description="Unique nuclei barcode; added at transposition step. Determines which nucleus the reads originated from"),
  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."),
  Total_Reads STRING OPTIONS(description="Total number of reads per sample. Integer"),
  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 SCATACSEQ LEVEL 1 METADATA R4 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 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.scATACseq_level1_metadata_r4` (HTAN_Data_File_ID, Id, scATACseq_Library_Layout, Total_Number_of_Passing_Nuclei, Empty_Well_Barcode, Single_Cell_Isolation_Method, scATACseq_Read2, Technical_Replicate_Group, Nuclei_Barcode_Read, Dissociation_Method, Protocol_Link, Well_Index, entityId, scATACseq_Read3, Single_Nucleus_Buffer, Component, Transposition_Reaction, Threshold_for_Minimum_Passing_Reads, scATACseq_Read1, Median_Fraction_of_Reads_in_Annotated_cis_DNA_Elements, Nucleic_Acid_Source, HTAN_Parent_Biospecimen_ID, Library_Construction_Method, Median_Fraction_of_Reads_in_Peaks, Median_Percentage_of_Mitochondrial_Reads_per_Nucleus, Median_Passing_Read_Percentage, File_Format, Nuclei_Barcode_Length, Filename, Nucleus_Identifier, Sequencing_Platform, Total_Reads, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('HTA9_3_1020', '78ba2069-f288-4701-9eb0-f1b1808a79f8', 'scATACseq Paired End', '427', 'Not Available', 'Plates', 'DNA Insert', '9-2,3', 'Index 1, Index 2', 'Dounce', 'dx.doi.org/10.17504/protocols.io.33cgqiw', NULL, 'syn26535593', NULL, 'NIB', 'ScATAC-seqLevel1', 'In-House', '1000', 'DNA Insert', 'Not Available', 'Single Nucleus', 'HTA9_3_40', 'sci-ATAC-seq', '0.134', '<5%', '86.03', 'fastq', '36', 'sc_atacseq_level_1/Case3.HTAN3_272844.1.fq.gz', 'Nuclei Barcode', 'Illumina Next Seq 500', 'Not Available', 'HTAN OHSU', 'syn39142047', 5, 1776212934, 'af0581d72f35ff367541157ed186a84b', 'Release 3.0', 'v22.12.1.seq'), ('HTA9_3_1023', 'f01a3c12-a75d-4c90-b6a7-6b2005be13c2', 'scATACseq Paired End', '427', 'Not Available', 'Plates', 'DNA Insert', '9-2,3', 'Index 1, Index 2', 'Dounce', 'dx.doi.org/10.17504/protocols.io.33cgqiw', NULL, 'syn26535594', NULL, 'NIB', 'ScATAC-seqLevel1', 'In-House', '1000', 'DNA Insert', 'Not Available', 'Single Nucleus', 'HTA9_3_40', 'sci-ATAC-seq', '0.134', '<5%', '86.03', 'fastq', '36', 'sc_atacseq_level_1/Case3.HTAN3_272844.2.fq.gz', 'Nuclei Barcode', 'Illumina Next Seq 500', 'Not Available', 'HTAN OHSU', 'syn39142047', 5, 1868320479, '3d0e39244e1296511ca0d6810a7dc328', 'Release 3.0', 'v22.12.1.seq'), ('HTA9_3_1021', '2baa3b5c-b7e1-431d-a1d6-88b6e0c61d33', 'scATACseq Paired End', '3562', 'Not Available', 'Plates', 'DNA Insert', '9-2,3', 'Index 1, Index 2', 'Dounce', 'dx.doi.org/10.17504/protocols.io.33cgqiw', NULL, 'syn26535600', NULL, 'NIB', 'ScATAC-seqLevel1', 'In-House', '1000', 'DNA Insert', 'Not Available', 'Single Nucleus', 'HTA9_3_59', 'sci-ATAC-seq', '0.134', '<5%', '86.03', 'fastq', '36', 'sc_atacseq_level_1/Case3.HTAN3_321924.1.fq.gz', 'Nuclei Barcode', 'Illumina Next Seq 500', 'Not Available', 'HTAN OHSU', 'syn39142047', 5, 1898152755, '9d41a5747de418d68145c33b34b67ba0', 'Release 3.0', 'v22.12.1.seq'), ('HTA9_3_1022', '7a569a3c-e544-442f-beae-00574d38e709', 'scATACseq Paired End', '3562', 'Not Available', 'Plates', 'DNA Insert', '9-2,3', 'Index 1, Index 2', 'Dounce', 'dx.doi.org/10.17504/protocols.io.33cgqiw', NULL, 'syn26535602', NULL, 'NIB', 'ScATAC-seqLevel1', 'In-House', '1000', 'DNA Insert', 'Not Available', 'Single Nucleus', 'HTA9_3_59', 'sci-ATAC-seq', '0.134', '<5%', '86.03', 'fastq', '36', 'sc_atacseq_level_1/Case3.HTAN3_321924.2.fq.gz', 'Nuclei Barcode', 'Illumina Next Seq 500', 'Not Available', 'HTAN OHSU', 'syn39142047', 5, 2019257498, '54d1cee52899e241a7da1a20f91a7751', 'Release 3.0', 'v22.12.1.seq'), ('HTA9_2_1035', '6959770b-8778-496a-8404-9cd4ca7041c7', 'scATACseq Paired End', '713', 'Not Available', 'Plates', 'DNA Insert', '9-2,3', 'Index 1, Index 2', 'Dounce', 'dx.doi.org/10.17504/protocols.io.33cgqiw', NULL, 'syn26535590', NULL, 'NIB', 'ScATAC-seqLevel1', 'In-House', '1000', 'DNA Insert', 'Not Available', 'Single Nucleus', 'HTA9_2_40', 'sci-ATAC-seq', 'Not Available', '<5%', '83.33', 'fastq', '36', 'sc_atacseq_level_1/HTAN_OMS.HTAN_272835.1.fq.gz', 'Nuclei Barcode', 'Illumina Next Seq 500', 'Not Available', 'HTAN OHSU', 'syn39142047', 5, 1653362442, '4e0f68e4bd5dbf6cd335b6acc2b3d660', 'Release 3.0', 'v22.12.1.seq');