-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.CPTAC.RNAseq_hg38_gdc_current`
(
  project_short_name STRING OPTIONS(description="Project name abbreviation; the program name appended with a project name abbreviation; eg. TCGA-OV, etc."),
  primary_site STRING OPTIONS(description="Anatomical site of the cancer under investigation or review"),
  case_barcode STRING OPTIONS(description="Original case barcode"),
  sample_barcode STRING OPTIONS(description="sample barcode, eg. TCGA-12-1089-01A. One sample may have multiple sets of expression values corresponding to multiple aliquots; use GROUP BY appropriately in queries"),
  aliquot_barcode STRING OPTIONS(description="TCGA aliquot barcode, eg. TCGA-12-1089-01A-01D-0517-31"),
  gene_name STRING OPTIONS(description="Gene name eg. TTN, DDR1"),
  gene_type STRING OPTIONS(description="The type of genetic element the reads mapped to, eg. protein_coding, ribozyme"),
  Ensembl_gene_id STRING OPTIONS(description="The Ensembl gene ID from the underlying file, but stripped of the version suffix -- eg. ENSG00000185028"),
  Ensembl_gene_id_v STRING OPTIONS(description="The Ensembl gene ID from the underlying file, including the version suffix -- eg. ENSG00000235943.1"),
  unstranded INT64 OPTIONS(description="Number of mapped reads mapping to both strands of the genomic region of each gene as calculated by STAR"),
  stranded_first INT64 OPTIONS(description="Number of mapped reads mapping to only the first strand of the genomic region of each gene as calculated by STAR"),
  stranded_second INT64 OPTIONS(description="Number of mapped reads mapping to only the second strand of the genomic region of each gene as calculated by STAR"),
  tpm_unstranded FLOAT64 OPTIONS(description="Transcripts per million with transcripts normalized for length, as calculated by a custom GDC pipeline"),
  fpkm_unstranded FLOAT64 OPTIONS(description="Fragments per kilobase of transcript per million mapped reads (FPKM) calculation, intended to control for transcript length and overall sequencing quantity"),
  fpkm_uq_unstranded FLOAT64 OPTIONS(description="Upper quartile FPKM (FPKM-UQ), a modified FPKM calculation in which the protein coding gene in the 75th percentile position is substituted for the sequencing quantity. This is thought to provide a more stable value than including the noisier genes at the extremes"),
  sample_type_name STRING OPTIONS(description="The longer name of the sample type; eg. Primary Tumor, Recurrent Tumor, etc"),
  case_gdc_id STRING OPTIONS(description="Unique GDC identifier for this case (corresponds to the case_barcode)"),
  sample_gdc_id STRING OPTIONS(description="Unique GDC identifier for this sample (corresponds to the sample_barcode)"),
  aliquot_gdc_id STRING OPTIONS(description="Unique GDC identifier for this aliquot (corresponds to the aliquot_barcode)"),
  file_gdc_id STRING OPTIONS(description="Unique GDC identifier for the file containing the expression values (corresponds to the file_barcode)"),
  platform STRING OPTIONS(description="Platform used to generate data; eg. IlluminaHiSeq or IlluminaGA")
)
CLUSTER BY project_short_name, case_barcode, sample_barcode, aliquot_barcode
OPTIONS(
  friendly_name="CPTAC HG38 RNASEQ GENE EXPRESSION",
  description="RNAseq data of the CPTAC program was extracted from release 40 of the active GDC archive in July 2024. The mRNA expression data was originally generated by Illumina GA or HiSeq sequencing runs and quantified using the GDC RNAseq analysis pipeline. RNA-Seq expression values, such as stranded and unstranded read counts per gene are produced by STAR. GDC also generated normalized values in the forms of FPKM and FPKM Upper Quartile using a custom pipeline.\n",
  labels=[("access", "open"), ("program_0", "cptac2"), ("program_1", "cptac3"), ("data_type", "gene_expression"), ("reference_genome_0", "hg38"), ("source", "gdc"), ("category", "processed_-omics_data"), ("experimental_strategy", "rnaseq"), ("status", "current"), ("version", "r40")]
);

INSERT INTO `isb-cgc-bq.CPTAC.RNAseq_hg38_gdc_current` (project_short_name, primary_site, case_barcode, sample_barcode, aliquot_barcode, gene_name, gene_type, Ensembl_gene_id, Ensembl_gene_id_v, unstranded, stranded_first, stranded_second, tpm_unstranded, fpkm_unstranded, fpkm_uq_unstranded, sample_type_name, case_gdc_id, sample_gdc_id, aliquot_gdc_id, file_gdc_id, platform) VALUES ('CPTAC-3', 'Bronchus and lung', 'C3N-02529', 'C3N-02529-03', 'CPT0147500006', 'MIA2', 'protein_coding', 'ENSG00000150527', 'ENSG00000150527.17', 2297, 17, 2338, 17.0395, 6.0617, 5.5981, 'Solid Tissue Normal', '417c1659-201c-4d1d-99bf-c28c986c559d', '47f17b21-a180-490d-9f20-5be9ca4101da', '002c41c2-6c2f-4f42-ae9c-430e23a9d5fe', 'ce1d0041-393b-4e0c-ab83-1f9aaf0a5856', 'Illumina'), ('CPTAC-3', 'Bronchus and lung', 'C3N-02529', 'C3N-02529-03', 'CPT0147500006', 'CHD1L', 'protein_coding', 'ENSG00000131778', 'ENSG00000131778.19', 130, 2, 170, 2.363, 0.8406, 0.7763, 'Solid Tissue Normal', '417c1659-201c-4d1d-99bf-c28c986c559d', '47f17b21-a180-490d-9f20-5be9ca4101da', '002c41c2-6c2f-4f42-ae9c-430e23a9d5fe', 'ce1d0041-393b-4e0c-ab83-1f9aaf0a5856', 'Illumina'), ('CPTAC-3', 'Bronchus and lung', 'C3N-02529', 'C3N-02529-03', 'CPT0147500006', 'FIGNL2', 'protein_coding', 'ENSG00000261308', 'ENSG00000261308.3', 30, 19, 48, 0.4874, 0.1734, 0.1601, 'Solid Tissue Normal', '417c1659-201c-4d1d-99bf-c28c986c559d', '47f17b21-a180-490d-9f20-5be9ca4101da', '002c41c2-6c2f-4f42-ae9c-430e23a9d5fe', 'ce1d0041-393b-4e0c-ab83-1f9aaf0a5856', 'Illumina'), ('CPTAC-3', 'Bronchus and lung', 'C3N-02529', 'C3N-02529-03', 'CPT0147500006', 'GK-AS1', 'lncRNA', 'ENSG00000243055', 'ENSG00000243055.1', 86, 221, 0, 10.3279, 3.6741, 3.3931, 'Solid Tissue Normal', '417c1659-201c-4d1d-99bf-c28c986c559d', '47f17b21-a180-490d-9f20-5be9ca4101da', '002c41c2-6c2f-4f42-ae9c-430e23a9d5fe', 'ce1d0041-393b-4e0c-ab83-1f9aaf0a5856', 'Illumina'), ('CPTAC-3', 'Bronchus and lung', 'C3N-02529', 'C3N-02529-03', 'CPT0147500006', 'RPL29P24', 'processed_pseudogene', 'ENSG00000241030', 'ENSG00000241030.1', 22, 0, 22, 3.7968, 1.3507, 1.2474, 'Solid Tissue Normal', '417c1659-201c-4d1d-99bf-c28c986c559d', '47f17b21-a180-490d-9f20-5be9ca4101da', '002c41c2-6c2f-4f42-ae9c-430e23a9d5fe', 'ce1d0041-393b-4e0c-ab83-1f9aaf0a5856', 'Illumina');