-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.scATACseq_level2_metadata_r5`
(
  Total_Unmapped_reads STRING OPTIONS(description="Number of reads that did not map to genome. Integer"),
  Proportion_Base_Mismatch STRING OPTIONS(description="Proportion of mismatched bases collected from samtools. Number"),
  Custom_Alignment_Workflow STRING OPTIONS(description="Specify the name of a custom alignment workflow"),
  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)"),
  Average_Read_Length STRING OPTIONS(description="Average read length collected from samtools. Integer"),
  Contamination STRING OPTIONS(description="Fraction of reads coming from cross-sample contamination collected from GATK4. Number"),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Proportion_Reads_Duplicated STRING OPTIONS(description="Proportion of duplicated reads collected from samtools. Number"),
  Total_Reads STRING OPTIONS(description="Total number of reads per sample. Integer"),
  Pairs_On_Diff_CHR STRING OPTIONS(description="Pairs on different chromosomes collected from samtools. Integer"),
  MapQ30 STRING OPTIONS(description="Number of reads with Quality >= 30."),
  Total_Uniquely_Mapped STRING OPTIONS(description="Number of reads that map to genome. Integer"),
  Short_Reads STRING OPTIONS(description="Number of reads that were too short. Integer"),
  Proportion_Coverage_10x STRING OPTIONS(description="Proportion of all reference bases for whole genome sequencing, or targeted bases for whole exome and targeted sequencing, that achieves 10X or greater coverage from Picard Tools."),
  HTAN_Parent_Data_File_ID STRING OPTIONS(description="HTAN Data File Identifier indicating the file(s) from which these files were derived"),
  Proportion_Reads_Mapped STRING OPTIONS(description="Proportion of mapped reads collected from samtools. Number"),
  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)"),
  Genomic_Reference STRING OPTIONS(description="Exact version of the human genome reference used in the alignment of reads (e.g. GCF_000001405.39)"),
  Alignment_Workflow_Type STRING OPTIONS(description="Generic name for the workflow used to analyze a data set."),
  Alignment_Workflow_Url STRING OPTIONS(description="Link to workflow used for read alignment. DockStore.org recommended. String"),
  Average_Insert_Size STRING OPTIONS(description="Average insert size collected from samtools. Integer"),
  Filename STRING OPTIONS(description="Name of a file"),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  Average_Base_Quality STRING OPTIONS(description="Average base quality collected from samtools. Number"),
  Median_Percentage_of_Mitochondrial_Reads_per_Nucleus STRING OPTIONS(description="Contamination from mitochondrial sequences"),
  Index_File_Name STRING OPTIONS(description="The name (or part of a name) of a file (of any type). String"),
  Proportion_Coverage_30X STRING OPTIONS(description="Proportion of all reference bases for whole genome sequencing, or targeted bases for whole exome and targeted sequencing, that achieves 30X or greater coverage from Picard Tools."),
  Proportion_Targets_No_Coverage STRING OPTIONS(description="Proportion of targets that did not reach 1X coverage over any base from Picard Tools. Number"),
  Contamination_Error STRING OPTIONS(description="Estimation error of cross-sample contamination collected from GATK4. Number"),
  Id STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  Mean_Coverage STRING OPTIONS(description="Mean coverage for whole genome sequencing, or mean target coverage for whole exome and targeted sequencing, collected from Picard. Number"),
  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 2 METADATA R5 VERSIONED",
  description="This table contains the file metadata for second level (i.e. BAM) 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_level2_metadata_r5` (Total_Unmapped_reads, Proportion_Base_Mismatch, Custom_Alignment_Workflow, HTAN_Data_File_ID, Average_Read_Length, Contamination, Component, Proportion_Reads_Duplicated, Total_Reads, Pairs_On_Diff_CHR, MapQ30, Total_Uniquely_Mapped, Short_Reads, Proportion_Coverage_10x, HTAN_Parent_Data_File_ID, Proportion_Reads_Mapped, Genomic_Reference_URL, Genomic_Reference, Alignment_Workflow_Type, Alignment_Workflow_Url, Average_Insert_Size, Filename, entityId, Average_Base_Quality, Median_Percentage_of_Mitochondrial_Reads_per_Nucleus, Index_File_Name, Proportion_Coverage_30X, Proportion_Targets_No_Coverage, Contamination_Error, Id, Mean_Coverage, File_Format, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES (NULL, NULL, NULL, 'HTA10_01_90243443196521389339723491376359', NULL, NULL, 'ScATAC-seqLevel2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'HTA10_01_33253333750574440076452810821390,HTA10_01_20057521453251487004544271164445,HTA10_01_83545322541359818128525069997962,HTA10_01_43412224032523872813732542860092,HTA10_01_90359517408641145156954015701828,HTA10_01_31155711423673949363592025453792,HTA10_01_40204520365205293425355682553504,HTA10_01_31537928431461348241305756948145', NULL, 'https://www.ncbi.nlm.nih.gov/datasets/genome/GCF_000001405.26/', 'GRCh38', 'BWA-mem', 'Not reported', NULL, 'scatacseq_level_2/A001-C-014-D_20200715_possorted_bam.bam', 'syn26530850', NULL, 'Not reported', 'scatacseq_level_2/A001-C-014-D_20200715_possorted_bam.bam.bai', NULL, NULL, NULL, 'b7013a6c-79a7-4c50-92be-8fed7394a52d', NULL, 'bam', 'HTAN Stanford', 'syn52177151', 4, 15965134099, '9ac43e4d196fcb38933972d491d763f9', 'Release 2.0', 'v23.10.1.seq'), (NULL, NULL, NULL, 'HTA10_01_39764031532103604433024454006407', NULL, NULL, 'ScATAC-seqLevel2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'HTA10_01_06734183029551602085190304211442,HTA10_01_58008844131655552053142070155939,HTA10_01_01003063708087541492932022453368,HTA10_01_03712053403613734307532941871015,HTA10_01_02828217036874535029842523441786,HTA10_01_57500381040024899150585632430415,HTA10_01_09624435121352374749732941938951,HTA10_01_51040357035712031557992412294173', NULL, 'https://www.ncbi.nlm.nih.gov/datasets/genome/GCF_000001405.26/', 'GRCh38', 'BWA-mem', 'Not reported', NULL, 'scatacseq_level_2/A001-C-108-D_20200811_possorted_bam.bam', 'syn26531211', NULL, 'Not reported', 'scatacseq_level_2/A001-C-108-D_20200811_possorted_bam.bam.bai', NULL, NULL, NULL, 'e4c6eeb5-fb03-437d-adb0-124481cd4bd1', NULL, 'bam', 'HTAN Stanford', 'syn52177151', 4, 24586637679, '3976403bfdcbad6a44dda2ee5e0a6407', 'Release 2.0', 'v23.10.1.seq'), (NULL, NULL, NULL, 'HTA10_01_50804062430232390005309493285051', NULL, NULL, 'ScATAC-seqLevel2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'HTA10_01_24608010716414185850842942356482,HTA10_01_74749604575502843273404111215212,HTA10_01_62535428780027128003792724511654,HTA10_01_26120217045965070591342234155923,HTA10_01_41378016954252014144004348770457,HTA10_01_38734829452232492504055561033453,HTA10_01_22584523854392092624502402320400,HTA10_01_47123423370254204214303245143071', NULL, 'https://www.ncbi.nlm.nih.gov/datasets/genome/GCF_000001405.26/', 'GRCh38', 'BWA-mem', 'Not reported', NULL, 'scatacseq_level_2/A001-C-123-D_20200214_possorted_bam.bam', 'syn26530901', NULL, 'Not reported', 'scatacseq_level_2/A001-C-123-D_20200214_possorted_bam.bam.bai', NULL, NULL, NULL, 'd7464030-ebb3-497f-b7b0-58df95d8183f', NULL, 'bam', 'HTAN Stanford', 'syn52177151', 4, 17981082340, 'fa8a4a6c4d02dcd90a0530949328fa5b', 'Release 2.0', 'v23.10.1.seq'), (NULL, NULL, NULL, 'HTA10_02_08632528445263190500914034437621', NULL, NULL, 'ScATAC-seqLevel2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'HTA10_02_67226088775023544666405005303961,HTA10_02_44231122557426443431852183995464,HTA10_02_46413072230123180759025133445338,HTA10_02_96313885316021249026559431123503,HTA10_02_24254771419094302544834532262321,HTA10_02_32637566091343112829039835125223,HTA10_02_30639591721236204946612352323751,HTA10_02_94311728373568402708158225101249', NULL, 'https://www.ncbi.nlm.nih.gov/datasets/genome/GCF_000001405.26/', 'GRCh38', 'BWA-mem', 'Not reported', NULL, 'scatacseq_level_2/A002-C-010_S2_20200310_possorted_bam.bam', 'syn26530862', NULL, 'Not reported', 'scatacseq_level_2/A002-C-010_S2_20200310_possorted_bam.bam.bai', NULL, NULL, NULL, 'f98d9d34-1dcc-4e3c-936e-794d73acff56', NULL, 'bam', 'HTAN Stanford', 'syn52177151', 4, 16446321157, '08632fc8eefc6319a50a9bead4e376c1', 'Release 2.0', 'v23.10.1.seq'), (NULL, NULL, NULL, 'HTA10_02_70197441898758264146140376150026', NULL, NULL, 'ScATAC-seqLevel2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'HTA10_02_88141902911123425528793011174834,HTA10_02_25242081214823852210853034760285,HTA10_02_56952835540532661548214753528092,HTA10_02_02458312502041392201714435004605,HTA10_02_51124031326732064425455130384109,HTA10_02_29032446131854519333550571003428,HTA10_02_10241735081504020191951214714244,HTA10_02_13106222073145508052375324229002', NULL, 'https://www.ncbi.nlm.nih.gov/datasets/genome/GCF_000001405.26/', 'GRCh38', 'BWA-mem', 'Not reported', NULL, 'scatacseq_level_2/A002-C-024-D_20200715_possorted_bam.bam', 'syn26530910', NULL, 'Not reported', 'scatacseq_level_2/A002-C-024-D_20200715_possorted_bam.bam.bai', NULL, NULL, NULL, '0d760937-2d2b-4c29-abe9-e5427de1f590', NULL, 'bam', 'HTAN Stanford', 'syn52177151', 4, 18403181886, '701974e1898758c6e1461e0d76b50a26', 'Release 2.0', 'v23.10.1.seq');