-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.bulkMethylationseq_level2_metadata_r5`
(
  Total_Unmapped_reads STRING OPTIONS(description="Number of reads that did not map to genome. Integer"),
  Bulk_Methylation_Genomic_Reference STRING OPTIONS(description="The human genome reference used in the alignment of reads"),
  Proportion_of_Minimum_CpG_Coverage_10X STRING OPTIONS(description="Proportion of all reference bases for whole genome sequencing, or targeted sequencing, that achieves 10X or greater coverage per CpG."),
  Library_Layout STRING OPTIONS(description="Sequencing read type"),
  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"),
  Duplicate_Removal_Software STRING OPTIONS(description="Software used for remove duplicate reads"),
  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"),
  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)"),
  Trimmer STRING OPTIONS(description="Software used for trimming"),
  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"),
  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."),
  Contamination_Error STRING OPTIONS(description="Estimation error of cross-sample contamination collected from GATK4. Number"),
  Proportion_Targets_No_Coverage STRING OPTIONS(description="Proportion of targets that did not reach 1X coverage over any base from Picard Tools. 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 BULKMETHYLATION SEQ LEVEL 2 METADATA R5 VERSIONED",
  description="This table contains the file metadata for the second level of Bulk Methyl 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.bulkMethylationseq_level2_metadata_r5` (Total_Unmapped_reads, Bulk_Methylation_Genomic_Reference, Proportion_of_Minimum_CpG_Coverage_10X, Library_Layout, Proportion_Base_Mismatch, Custom_Alignment_Workflow, HTAN_Data_File_ID, Average_Read_Length, Contamination, Component, Proportion_Reads_Duplicated, Total_Reads, Pairs_On_Diff_CHR, Duplicate_Removal_Software, Total_Uniquely_Mapped, Short_Reads, HTAN_Parent_Data_File_ID, Proportion_Reads_Mapped, Genomic_Reference_URL, Trimmer, Alignment_Workflow_Type, Alignment_Workflow_Url, Average_Insert_Size, Filename, entityId, Average_Base_Quality, Index_File_Name, Proportion_Coverage_30X, Contamination_Error, Proportion_Targets_No_Coverage, Id, Mean_Coverage, File_Format, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES (NULL, 'HG38', NULL, 'Single Read', NULL, NULL, 'HTA10_01_19555600007912121574695667162305', NULL, NULL, 'BulkMethylation-seqLevel2', NULL, NULL, NULL, 'picard MarkDuplicates', NULL, NULL, 'HTA10_01_43208332606526216901477335450321, HTA10_01_31241678407000619453059401802613', NULL, 'https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.fa.gz', 'Trim Galore!', 'BWA-meth', 'https://lucid.app/lucidchart/3921698e-01ad-4e02-805c-dfae9f70b9c4/view', NULL, 'bulk_methyl_seq_level_2/A001_C004.sorted.rmdup.bam.mergeContext_CpG.bedGraph', 'syn45173225', NULL, NULL, NULL, NULL, NULL, 'cfd91283-099f-4478-b5bd-84a0ddb7937a', NULL, 'bedgraph', 'HTAN Stanford', 'syn51934273', 2, 882463091, '19f5f6aa0a79bcb2bf7e695667162d0f', 'Release 4.0', 'v23.10.1.seq'), (NULL, 'HG38', NULL, 'Single Read', NULL, NULL, 'HTA10_01_11376335427842530213430155414309', NULL, NULL, 'BulkMethylation-seqLevel2', NULL, NULL, NULL, 'picard MarkDuplicates', NULL, NULL, 'HTA10_01_46294077943108131591650144554192, HTA10_01_54114060048152634471554202053055', NULL, 'https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.fa.gz', 'Trim Galore!', 'BWA-meth', 'https://lucid.app/lucidchart/3921698e-01ad-4e02-805c-dfae9f70b9c4/view', NULL, 'bulk_methyl_seq_level_2/A001_C005.sorted.rmdup.bam.mergeContext_CpG.bedGraph', 'syn45173228', NULL, NULL, NULL, NULL, NULL, '4df1924e-c4a4-4b2b-be35-a98f67cd6c37', NULL, 'bedgraph', 'HTAN Stanford', 'syn51934273', 2, 878495769, 'b1d76d3fec784c5d02bded015feb43a9', 'Release 4.0', 'v23.10.1.seq'), (NULL, 'HG38', NULL, 'Single Read', NULL, NULL, 'HTA10_01_15010826040070101551037109010253', NULL, NULL, 'BulkMethylation-seqLevel2', NULL, NULL, NULL, 'picard MarkDuplicates', NULL, NULL, 'HTA10_01_87763024572233951479832245018290, HTA10_01_51915141758210853130171453519884', NULL, 'https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.fa.gz', 'Trim Galore!', 'BWA-meth', 'https://lucid.app/lucidchart/3921698e-01ad-4e02-805c-dfae9f70b9c4/view', NULL, 'bulk_methyl_seq_level_2/A001_C007.sorted.rmdup.bam.mergeContext_CpG.bedGraph', 'syn45173230', NULL, NULL, NULL, NULL, NULL, '480f0d3a-92da-4884-a3ab-6f8aa28da953', NULL, 'bedgraph', 'HTAN Stanford', 'syn51934273', 2, 880730862, 'bfaba8c604aa70babf510d7109ab0c5d', 'Release 4.0', 'v23.10.1.seq'), (NULL, 'HG38', NULL, 'Single Read', NULL, NULL, 'HTA10_01_52404152580394452345435135340338', NULL, NULL, 'BulkMethylation-seqLevel2', NULL, NULL, NULL, 'picard MarkDuplicates', NULL, NULL, 'HTA10_01_27635503330084247504154163037742, HTA10_01_73818340324167313356268513414053', NULL, 'https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.fa.gz', 'Trim Galore!', 'BWA-meth', 'https://lucid.app/lucidchart/3921698e-01ad-4e02-805c-dfae9f70b9c4/view', NULL, 'bulk_methyl_seq_level_2/A001_C021.sorted.rmdup.bam.mergeContext_CpG.bedGraph', 'syn45173232', NULL, NULL, NULL, NULL, NULL, '8224ba1a-d89d-43f4-9e1b-214ebeb2fb3c', NULL, 'bedgraph', 'HTAN Stanford', 'syn51934273', 2, 880088496, '5c4041fc58039445c3e5ed513f34a3d8', 'Release 4.0', 'v23.10.1.seq'), (NULL, 'HG38', NULL, 'Single Read', NULL, NULL, 'HTA10_01_07537966443615794524016665154003', NULL, NULL, 'BulkMethylation-seqLevel2', NULL, NULL, NULL, 'picard MarkDuplicates', NULL, NULL, 'HTA10_01_95349379651062231555333416816070, HTA10_01_70070300363480687242100850711554', NULL, 'https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.fa.gz', 'Trim Galore!', 'BWA-meth', 'https://lucid.app/lucidchart/3921698e-01ad-4e02-805c-dfae9f70b9c4/view', NULL, 'bulk_methyl_seq_level_2/A001_C113.sorted.rmdup.bam.mergeContext_CpG.bedGraph', 'syn45173234', NULL, NULL, NULL, NULL, NULL, 'ebba311d-e0c6-4a3a-8cd6-cb23c58009e9', NULL, 'bedgraph', 'HTAN Stanford', 'syn51934273', 2, 884790769, '07fd796644d6b579e52eab666f1f4a0d', 'Release 4.0', 'v23.10.1.seq');