-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.bulkWES_level3_metadata_r4`
(
  Somatic_Variants_Workflow_URL STRING OPTIONS(description="Generic name for the workflow used to analyze a data set."),
  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"),
  Germline_Variants_Workflow_Type STRING OPTIONS(description="Generic name for the workflow used to analyze a data set"),
  Somatic_Variants_Sample_Type STRING OPTIONS(description="Is the sample case or control in somatic variant analysis"),
  Custom_Germline_Variants_Workflow_Type STRING OPTIONS(description="Specify the name of a custom alignment workflow"),
  Structural_Variant_Workflow_Type STRING OPTIONS(description="Generic name for the workflow used to analyze a data set."),
  entityId STRING OPTIONS(description="Synapse ID of entity"),
  Genomic_Reference STRING OPTIONS(description="Exact version of the human genome reference used in the alignment of reads (e.g. GCF_000001405.39)"),
  Custom_Somatic_Variants_Workflow_Type STRING OPTIONS(description="Specify the name of a custom workflow name"),
  Component STRING OPTIONS(description="Category of metadata (e.g. Diagnosis, Biospecimen, scRNA-seq Level 1, etc.); provide the same one for all items/rows."),
  Structural_Variant_Workflow_URL STRING OPTIONS(description="Link to workflow document. DockStore.org recommended. URL"),
  Custom_Structural_Variant_Workflow_Type STRING OPTIONS(description="Specify the name of a custom workflow name"),
  File_Format STRING OPTIONS(description="Format of a file (e.g. txt, csv, fastq, bam, etc.)"),
  Filename STRING OPTIONS(description="Name of a file"),
  HTAN_Parent_Data_File_ID STRING OPTIONS(description="HTAN Data File Identifier indicating the file(s) from which these files were derived"),
  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)"),
  Germline_Variants_Workflow_URL STRING OPTIONS(description="Link to workflow document, e.g. Github, DockStore.org recommended"),
  Somatic_Variants_Workflow_Type STRING OPTIONS(description="Generic name for the workflow used to analyze a data set."),
  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 BULKWES LEVEL 3 METADATA R4 VERSIONED",
  description="This table contains the file metadata for third level (i.e. expression quantification, variant call files) bulk whole exome sequencing data 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.bulkWES_level3_metadata_r4` (Somatic_Variants_Workflow_URL, HTAN_Data_File_ID, Id, Germline_Variants_Workflow_Type, Somatic_Variants_Sample_Type, Custom_Germline_Variants_Workflow_Type, Structural_Variant_Workflow_Type, entityId, Genomic_Reference, Custom_Somatic_Variants_Workflow_Type, Component, Structural_Variant_Workflow_URL, Custom_Structural_Variant_Workflow_Type, File_Format, Filename, HTAN_Parent_Data_File_ID, Genomic_Reference_URL, Germline_Variants_Workflow_URL, Somatic_Variants_Workflow_Type, HTAN_Center, Manifest_Id, Manifest_Version, File_Size, md5, Data_Release, CDS_Release) VALUES ('https://github.com/broadinstitute/gatk/tree/master/scripts/mutect2_wdl', 'HTA11_347_200000101123111', 'c5f10412-45ec-4ea1-8571-5797af2c8e35', NULL, 'Case Sample', NULL, NULL, 'syn27056693', 'Hg19', NULL, 'BulkWESLevel3', 'Not Applicable', NULL, 'vcf', 'whole_exome_seq_level_3/VCF/MAP.00347_polyp.rmdup.indel.recal-filtered.vcf', 'HTA11_347_200000101122111', 'https://console.cloud.google.com/storage/browser/_details/broad-references/hg19/v0/Homo_sapiens_assembly19.fasta', 'Not Applicable', 'MuTect2', 'HTAN Vanderbilt', 'syn39059825', 6, 50125642, '9719648412d98fb4d5340ddeff43d029', 'Release 2.0', NULL), ('https://github.com/broadinstitute/gatk/tree/master/scripts/mutect2_wdl', 'HTA11_696_200000101123111', '671f83aa-fcde-46d3-b6c5-2fc4c1954d2a', NULL, 'Case Sample', NULL, NULL, 'syn27056695', 'Hg19', NULL, 'BulkWESLevel3', 'Not Applicable', NULL, 'vcf', 'whole_exome_seq_level_3/VCF/MAP.00696_polyp.rmdup.indel.recal-filtered.vcf', 'HTA11_696_200000101122111', 'https://console.cloud.google.com/storage/browser/_details/broad-references/hg19/v0/Homo_sapiens_assembly19.fasta', 'Not Applicable', 'MuTect2', 'HTAN Vanderbilt', 'syn39059825', 6, 24029010, 'd93b15fb2c67e86c7cc49295e107c829', 'Release 2.0', NULL), ('https://github.com/broadinstitute/gatk/tree/master/scripts/mutect2_wdl', 'HTA11_866_200000101123111', '7f3dacdd-7127-4eee-aa18-af4930055b51', NULL, 'Case Sample', NULL, NULL, 'syn27056692', 'Hg19', NULL, 'BulkWESLevel3', 'Not Applicable', NULL, 'vcf', 'whole_exome_seq_level_3/VCF/MAP.00866_polyp_5234.rmdup.indel.recal-filtered.vcf', 'HTA11_866_200000101122111', 'https://console.cloud.google.com/storage/browser/_details/broad-references/hg19/v0/Homo_sapiens_assembly19.fasta', 'Not Applicable', 'MuTect2', 'HTAN Vanderbilt', 'syn39059825', 6, 11461971, 'bc3eb19f921c7ec7292b560009a5c1d8', 'Release 2.0', NULL), ('https://github.com/broadinstitute/gatk/tree/master/scripts/mutect2_wdl', 'HTA11_866_300476101123111', '0acc211e-f4a8-4532-88f1-043bc440647c', NULL, 'Case Sample', NULL, NULL, 'syn27056711', 'Hg19', NULL, 'BulkWESLevel3', 'Not Applicable', NULL, 'vcf', 'whole_exome_seq_level_3/VCF/MAP.00866_polyp_6109.rmdup.indel.recal-filtered.vcf', 'HTA11_866_300476101122111', 'https://console.cloud.google.com/storage/browser/_details/broad-references/hg19/v0/Homo_sapiens_assembly19.fasta', 'Not Applicable', 'MuTect2', 'HTAN Vanderbilt', 'syn39059825', 6, 3237035, '43c6abfded476a6f071219d1d8b308c0', 'Release 2.0', NULL), ('https://github.com/broadinstitute/gatk/tree/master/scripts/mutect2_wdl', 'HTA11_1391_200000101123111', '06c47435-95cc-4de3-afe0-3ca1d4aaeba3', NULL, 'Case Sample', NULL, NULL, 'syn27056712', 'Hg19', NULL, 'BulkWESLevel3', 'Not Applicable', NULL, 'vcf', 'whole_exome_seq_level_3/VCF/MAP.01391_polyp.rmdup.indel.recal-filtered.vcf', 'HTA11_1391_200000101122111', 'https://console.cloud.google.com/storage/browser/_details/broad-references/hg19/v0/Homo_sapiens_assembly19.fasta', 'Not Applicable', 'MuTect2', 'HTAN Vanderbilt', 'syn39059825', 6, 14117648, 'be5a01204d9b0f9d152c75349c28fffa', 'Release 2.0', NULL);