-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.bulkWES_level3_metadata_r3`
(
  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_Data_File_ID STRING OPTIONS(description="HTAN Data File Identifier indicating the file(s) from which these files were derived"),
  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)"),
  Genomic_Reference STRING OPTIONS(description="Exact version of the human genome reference used in the alignment of reads (e.g. GCF_000001405.39)"),
  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"),
  Germline_Variants_Workflow_Type STRING OPTIONS(description="Generic name for the workflow used to analyze a data set"),
  Somatic_Variants_Workflow_URL STRING OPTIONS(description="Generic name for the workflow used to analyze a data set."),
  Somatic_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"),
  Structural_Variant_Workflow_URL STRING OPTIONS(description="Link to workflow document. DockStore.org recommended. URL"),
  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"),
  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"),
  Manifest_Version INT64 OPTIONS(description="Latest version of metadata manifest"),
  Uuid STRING OPTIONS(description="Unique identifier of entity e.g. a96059eb-81af-4b24-ae50-9242c0d8f819"),
  File_Size INT64 OPTIONS(description="Size of file (bucket object) in bytes"),
  md5 STRING OPTIONS(description="md5 hash of file"),
  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 R3 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 April 2023. 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.bulkWES_level3_metadata_r3` (Component, Filename, File_Format, HTAN_Parent_Data_File_ID, HTAN_Data_File_ID, Genomic_Reference, Genomic_Reference_URL, Germline_Variants_Workflow_URL, Germline_Variants_Workflow_Type, Somatic_Variants_Workflow_URL, Somatic_Variants_Workflow_Type, Somatic_Variants_Sample_Type, Structural_Variant_Workflow_URL, Structural_Variant_Workflow_Type, entityId, HTAN_Center, Data_Release, Manifest_Version, Uuid, File_Size, md5, CDS_Release) VALUES ('BulkWESLevel3', 'whole_exome_seq_level_3/VCF/MAP.00347_polyp.rmdup.indel.recal-filtered.vcf', 'vcf', 'HTA11_347_200000101122111', 'HTA11_347_200000101123111', 'Hg19', 'https://console.cloud.google.com/storage/browser/_details/broad-references/hg19/v0/Homo_sapiens_assembly19.fasta', 'Not Applicable', NULL, 'https://github.com/broadinstitute/gatk/tree/master/scripts/mutect2_wdl', 'MuTect2', 'Case Sample', 'Not Applicable', NULL, 'syn27056693', 'HTAN Vanderbilt', 'Release 2.0', 2, 'c5f10412-45ec-4ea1-8571-5797af2c8e35', 50125642, '9719648412d98fb4d5340ddeff43d029', NULL), ('BulkWESLevel3', 'whole_exome_seq_level_3/VCF/MAP.00696_polyp.rmdup.indel.recal-filtered.vcf', 'vcf', 'HTA11_696_200000101122111', 'HTA11_696_200000101123111', 'Hg19', 'https://console.cloud.google.com/storage/browser/_details/broad-references/hg19/v0/Homo_sapiens_assembly19.fasta', 'Not Applicable', NULL, 'https://github.com/broadinstitute/gatk/tree/master/scripts/mutect2_wdl', 'MuTect2', 'Case Sample', 'Not Applicable', NULL, 'syn27056695', 'HTAN Vanderbilt', 'Release 2.0', 2, '671f83aa-fcde-46d3-b6c5-2fc4c1954d2a', 24029010, 'd93b15fb2c67e86c7cc49295e107c829', NULL), ('BulkWESLevel3', 'whole_exome_seq_level_3/VCF/MAP.00866_polyp_5234.rmdup.indel.recal-filtered.vcf', 'vcf', 'HTA11_866_200000101122111', 'HTA11_866_200000101123111', 'Hg19', 'https://console.cloud.google.com/storage/browser/_details/broad-references/hg19/v0/Homo_sapiens_assembly19.fasta', 'Not Applicable', NULL, 'https://github.com/broadinstitute/gatk/tree/master/scripts/mutect2_wdl', 'MuTect2', 'Case Sample', 'Not Applicable', NULL, 'syn27056692', 'HTAN Vanderbilt', 'Release 2.0', 2, '7f3dacdd-7127-4eee-aa18-af4930055b51', 11461971, 'bc3eb19f921c7ec7292b560009a5c1d8', NULL), ('BulkWESLevel3', 'whole_exome_seq_level_3/VCF/MAP.00866_polyp_6109.rmdup.indel.recal-filtered.vcf', 'vcf', 'HTA11_866_300476101122111', 'HTA11_866_300476101123111', 'Hg19', 'https://console.cloud.google.com/storage/browser/_details/broad-references/hg19/v0/Homo_sapiens_assembly19.fasta', 'Not Applicable', NULL, 'https://github.com/broadinstitute/gatk/tree/master/scripts/mutect2_wdl', 'MuTect2', 'Case Sample', 'Not Applicable', NULL, 'syn27056711', 'HTAN Vanderbilt', 'Release 2.0', 2, '0acc211e-f4a8-4532-88f1-043bc440647c', 3237035, '43c6abfded476a6f071219d1d8b308c0', NULL), ('BulkWESLevel3', 'whole_exome_seq_level_3/VCF/MAP.01391_polyp.rmdup.indel.recal-filtered.vcf', 'vcf', 'HTA11_1391_200000101122111', 'HTA11_1391_200000101123111', 'Hg19', 'https://console.cloud.google.com/storage/browser/_details/broad-references/hg19/v0/Homo_sapiens_assembly19.fasta', 'Not Applicable', NULL, 'https://github.com/broadinstitute/gatk/tree/master/scripts/mutect2_wdl', 'MuTect2', 'Case Sample', 'Not Applicable', NULL, 'syn27056712', 'HTAN Vanderbilt', 'Release 2.0', 2, '06c47435-95cc-4de3-afe0-3ca1d4aaeba3', 14117648, 'be5a01204d9b0f9d152c75349c28fffa', NULL);