-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.scATACseq_level1_metadata_r2_v3`
(
  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"),
  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"),
  File_Size INT64 OPTIONS(description="Size of file (bucket object) in bytes"),
  md5 STRING OPTIONS(description="md5 hash of file")
)
OPTIONS(
  friendly_name="HTAN SCATACSEQ LEVEL 1 METADATA R2 VERSIONED",
  description="Data was extracted from HTAN Synapse projects in April 2022. 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_r2_v3` (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, entityId, HTAN_Center, Data_Release, File_Size, md5) VALUES ('ScATAC-seqLevel1', 'scATAC/A001-C-218_200214/A001-C-218_S3_L001_I1_001.fastq.gz', 'fastq', 'HTA10_01_218', 'HTA10_01_30742335405331783811415522225773', 'Single Nucleus', 'Dounce', '10x', '10x', 'Tn5', 'scATACseq Paired End', 'Nuclei Barcode', 'DNA Insert', '10xV1.1', 'Illumina NovaSeq 6000', '1500', '12275', 'Not Reported', 'Not Reported', 'Not Reported', 'Not Reported', NULL, NULL, '10.17504/protocols.io.bfsnjnde', 'MACS2', 'syn24191517', 'HTAN Stanford', 'Release 1.0', 551202715, '3074cdd54af3db783811ebf52cc2f77d'), ('ScATAC-seqLevel1', 'scATAC/A001-C-218_200214/A001-C-218_S3_L001_R1_001.fastq.gz', 'fastq', 'HTA10_01_218', 'HTA10_01_50348449191431235839338222649133', 'Single Nucleus', 'Dounce', '10x', '10x', 'Tn5', 'scATACseq Paired End', 'Nuclei Barcode', 'DNA Insert', '10xV1.1', 'Illumina NovaSeq 6000', '1500', '12275', 'Not Reported', 'Not Reported', 'Not Reported', 'Not Reported', NULL, NULL, '10.17504/protocols.io.bfsnjnde', 'MACS2', 'syn24191522', 'HTAN Stanford', 'Release 1.0', 2660865841, '503484e919bedbc3f8d9dd82c26e913d'), ('ScATAC-seqLevel1', 'scATAC/A001-C-218_200214/A001-C-218_S3_L001_R2_001.fastq.gz', 'fastq', 'HTA10_01_218', 'HTA10_01_63255225460620236922914047017102', 'Single Nucleus', 'Dounce', '10x', '10x', 'Tn5', 'scATACseq Paired End', 'Nuclei Barcode', 'DNA Insert', '10xV1.1', 'Illumina NovaSeq 6000', '1500', '12275', 'Not Reported', 'Not Reported', 'Not Reported', 'Not Reported', NULL, NULL, '10.17504/protocols.io.bfsnjnde', 'MACS2', 'syn24191518', 'HTAN Stanford', 'Release 1.0', 1417155061, '6dcf5ccfe6a6ca2d692c9bea47ab7ba2'), ('ScATAC-seqLevel1', 'scATAC/A001-C-218_200214/A001-C-218_S3_L001_R3_001.fastq.gz', 'fastq', 'HTA10_01_218', 'HTA10_01_00022196431061220084293394375423', 'Single Nucleus', 'Dounce', '10x', '10x', 'Tn5', 'scATACseq Paired End', 'Nuclei Barcode', 'DNA Insert', '10xV1.1', 'Illumina NovaSeq 6000', '1500', '12275', 'Not Reported', 'Not Reported', 'Not Reported', 'Not Reported', NULL, NULL, '10.17504/protocols.io.bfsnjnde', 'MACS2', 'syn24191525', 'HTAN Stanford', 'Release 1.0', 2597817043, '0a0c2b96ed106122a08e293d9ed75423'), ('ScATAC-seqLevel1', 'scATAC/A001-C-218_200214/A001-C-218_S3_L002_I1_001.fastq.gz', 'fastq', 'HTA10_01_218', 'HTA10_01_15405106515010400956210187795083', 'Single Nucleus', 'Dounce', '10x', '10x', 'Tn5', 'scATACseq Paired End', 'Nuclei Barcode', 'DNA Insert', '10xV1.1', 'Illumina NovaSeq 6000', '1500', '12275', 'Not Reported', 'Not Reported', 'Not Reported', 'Not Reported', NULL, NULL, '10.17504/protocols.io.bfsnjnde', 'MACS2', 'syn24191519', 'HTAN Stanford', 'Release 1.0', 550039060, '1f4af1a6f15a1a4009f62bab8779508d');