-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.scATACseq_level1_metadata_r5`
(
  Nucleus_Identifier STRING OPTIONS(description="Unique nuclei barcode; added at transposition step. Determines which nucleus the reads originated from"),
  Nucleic_Acid_Source STRING OPTIONS(description="The source of the input nucleic molecule"),
  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)"),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Total_Reads STRING OPTIONS(description="Total number of reads per sample. Integer"),
  Well_Index STRING OPTIONS(description="Indicate if protein expression (EPCAM/CD45) positive/negative data  is available for each cell in CEL-seq2 assays"),
  Nuclei_Barcode_Length STRING OPTIONS(description="Nuclei Barcode Length"),
  scATACseq_Read3 STRING OPTIONS(description="Read 3 content description"),
  Single_Nucleus_Buffer STRING OPTIONS(description="Nuclei isolation buffer"),
  Median_Fraction_of_Reads_in_Peaks STRING OPTIONS(description="Median fraction of reads in peaks (FRIP)"),
  Threshold_for_Minimum_Passing_Reads STRING OPTIONS(description="Threshold for calling cells"),
  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"),
  Transposition_Reaction STRING OPTIONS(description="Name of the transposase, transposon sequences"),
  scATACseq_Library_Layout STRING OPTIONS(description="Sequencing read type"),
  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)"),
  scATACseq_Read1 STRING OPTIONS(description="Read 1 content description"),
  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."),
  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"),
  Nuclei_Barcode_Read STRING OPTIONS(description="Nuclei Barcode Read"),
  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]"),
  Filename STRING OPTIONS(description="Name of a file"),
  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)"),
  Dissociation_Method STRING OPTIONS(description="The tissue dissociation method used for scRNASeq or scATAC-seq assays"),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  Median_Percentage_of_Mitochondrial_Reads_per_Nucleus STRING OPTIONS(description="Contamination from mitochondrial sequences"),
  scATACseq_Read2 STRING OPTIONS(description="Read 2 content description"),
  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."),
  Empty_Well_Barcode STRING OPTIONS(description="Unique cell barcode assigned to empty cells used as controls in CEL-seq2 assays."),
  Total_Number_of_Passing_Nuclei STRING OPTIONS(description="Number of nuclei sequenced"),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  Median_Fraction_of_Reads_in_Annotated_cis_DNA_Elements STRING OPTIONS(description="Median fraction of reads in annotated cis-DNA elements (FRIADE)"),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  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 R5 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 2024 and corresponds to HTAN Data Release 5.1. 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_r5` (Nucleus_Identifier, Nucleic_Acid_Source, HTAN_Data_File_ID, Component, Total_Reads, Well_Index, Nuclei_Barcode_Length, scATACseq_Read3, Single_Nucleus_Buffer, Median_Fraction_of_Reads_in_Peaks, Threshold_for_Minimum_Passing_Reads, Median_Passing_Read_Percentage, Transposition_Reaction, scATACseq_Library_Layout, Technical_Replicate_Group, scATACseq_Read1, Sequencing_Platform, HTAN_Parent_Biospecimen_ID, Nuclei_Barcode_Read, Library_Construction_Method, Filename, Single_Cell_Isolation_Method, Dissociation_Method, entityId, Median_Percentage_of_Mitochondrial_Reads_per_Nucleus, scATACseq_Read2, Protocol_Link, Empty_Well_Barcode, Total_Number_of_Passing_Nuclei, Id, Median_Fraction_of_Reads_in_Annotated_cis_DNA_Elements, File_Format, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('Nuclei Barcode', 'Single Nucleus', 'HTA12_85_1020', 'ScATAC-seqLevel1', NULL, NULL, '16', 'DNA Insert', '10x', 'Not Reported', '1000', 'Not Reported', 'Tn5', 'scATACseq Paired End', NULL, 'DNA Insert', 'Illumina NovaSeq 6000', 'HTA12_85_1', 'Read2', '10xV1.0', 'snATAC-Seq_level_1_atac_tumor/CE336E1-S1-TWCE-CE336E1-S1K1Nd1_2Bma1_1_S7_L001_R1_001.fastq.gz', 'FACS', 'Dounce', 'syn52216243', 'Not Reported', 'Cell Barcode', 'dx.doi.org/10.17504/protocols.io.261gednx7v47/v1', NULL, '3088', '542bf9c4-7d99-4220-b0c5-cd59481f5f29', 'Not Reported', 'gzip', 'HTAN WUSTL', 'syn52257214', 14, 11924564033, '1ede670f3ca4d841ac082ded93926397', 'Release 4.0', 'v23.10.1.seq'), ('Nuclei Barcode', 'Single Nucleus', 'HTA12_85_1021', 'ScATAC-seqLevel1', NULL, NULL, '16', 'DNA Insert', '10x', 'Not Reported', '1000', 'Not Reported', 'Tn5', 'scATACseq Paired End', NULL, 'DNA Insert', 'Illumina NovaSeq 6000', 'HTA12_85_1', 'Read2', '10xV1.0', 'snATAC-Seq_level_1_atac_tumor/CE336E1-S1-TWCE-CE336E1-S1K1Nd1_2Bma1_1_S7_L001_R2_001.fastq.gz', 'FACS', 'Dounce', 'syn52211682', 'Not Reported', 'Cell Barcode', 'dx.doi.org/10.17504/protocols.io.261gednx7v47/v1', NULL, '3088', 'df82d6be-0398-4ebb-9f11-c3c0ee3934b1', 'Not Reported', 'gzip', 'HTAN WUSTL', 'syn52257214', 14, 6263116450, '7c1f0565a9dc38105a7535cd6bd40236', 'Release 4.0', 'v23.10.1.seq'), ('Nuclei Barcode', 'Single Nucleus', 'HTA12_85_1022', 'ScATAC-seqLevel1', NULL, NULL, '16', 'DNA Insert', '10x', 'Not Reported', '1000', 'Not Reported', 'Tn5', 'scATACseq Paired End', NULL, 'DNA Insert', 'Illumina NovaSeq 6000', 'HTA12_85_1', 'Read2', '10xV1.0', 'snATAC-Seq_level_1_atac_tumor/CE336E1-S1-TWCE-CE336E1-S1K1Nd1_2Bma1_1_S7_L001_R3_001.fastq.gz', 'FACS', 'Dounce', 'syn52216504', 'Not Reported', 'Cell Barcode', 'dx.doi.org/10.17504/protocols.io.261gednx7v47/v1', NULL, '3088', '54c15c0c-7e6a-4d31-9fe5-ce965c3f473a', 'Not Reported', 'gzip', 'HTAN WUSTL', 'syn52257214', 14, 12006487701, '1c6e82ba2d6f4d3a1424db78e8ee9ebf', 'Release 4.0', 'v23.10.1.seq'), ('Nuclei Barcode', 'Single Nucleus', 'HTA12_86_1020', 'ScATAC-seqLevel1', NULL, NULL, '16', 'DNA Insert', '10x', 'Not Reported', '1000', 'Not Reported', 'Tn5', 'scATACseq Paired End', NULL, 'DNA Insert', 'Illumina NovaSeq 6000', 'HTA12_86_1', 'Read2', '10xV1.0', 'snATAC-Seq_level_1_atac_tumor/CE337E1-S1-TWCE-CE337E1-S1N1_1Bma1_1_S3_L001_R1_001.fastq.gz', 'FACS', 'Dounce', 'syn52220657', 'Not Reported', 'Cell Barcode', 'dx.doi.org/10.17504/protocols.io.261gednx7v47/v1', NULL, '14064', '0fcf9cf3-b778-4a7f-a8c6-81374898216c', 'Not Reported', 'gzip', 'HTAN WUSTL', 'syn52257214', 14, 15265428267, 'afd82956416935d8f96aa01b8cb6419a', 'Release 4.0', 'v23.10.1.seq'), ('Nuclei Barcode', 'Single Nucleus', 'HTA12_86_1021', 'ScATAC-seqLevel1', NULL, NULL, '16', 'DNA Insert', '10x', 'Not Reported', '1000', 'Not Reported', 'Tn5', 'scATACseq Paired End', NULL, 'DNA Insert', 'Illumina NovaSeq 6000', 'HTA12_86_1', 'Read2', '10xV1.0', 'snATAC-Seq_level_1_atac_tumor/CE337E1-S1-TWCE-CE337E1-S1N1_1Bma1_1_S3_L001_R2_001.fastq.gz', 'FACS', 'Dounce', 'syn52212912', 'Not Reported', 'Cell Barcode', 'dx.doi.org/10.17504/protocols.io.261gednx7v47/v1', NULL, '14064', 'b376988d-008a-4333-8a49-41ca25a5498a', 'Not Reported', 'gzip', 'HTAN WUSTL', 'syn52257214', 14, 7849918744, '2ab9e2369187e5dc59d60e8f641e10ce', 'Release 4.0', 'v23.10.1.seq');