-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.CPTAC.miRNAseq_isoform_hg38_gdc_current`
(
  project_short_name STRING OPTIONS(description="Project name abbreviation, eg TARGET-AML"),
  case_barcode STRING OPTIONS(description="Original TARGET case barcode, eg TARGET-20-PASCGR"),
  sample_barcode STRING OPTIONS(description="TARGET sample barcode, eg TARGET-20-PASWAT-09A"),
  aliquot_barcode STRING OPTIONS(description="TARGET aliquot barcode, eg TARGET-20-PAJLIP-01A-01R"),
  primary_site STRING OPTIONS(description="Anatomical site of the cancer under investigation or review"),
  miRNA_id STRING OPTIONS(description="Unique miRNA id (aka symbol), eg hsa-mir-21  --  relevant reference information can be found in the isb-cgc:genome_reference dataset in the tables miRBase_v21 and miRBase_v21_hsa_gff3"),
  chromosome STRING OPTIONS(description="Chromosome, possible values: chr1-22, and chrX"),
  start_pos INT64 OPTIONS(description="1-based start chromosome position of isoform"),
  end_pos INT64 OPTIONS(description="1-based end chromosome position of isoform"),
  strand STRING OPTIONS(description="Either + or - to denote whether read mapped to the sense (+) or anti-sense (-) strand"),
  read_count INT64 OPTIONS(description="Number of reads that were mapped to this mirna_id"),
  reads_per_million_miRNA_mapped FLOAT64 OPTIONS(description="Read count normalized by total reads mapped divided by 1 million"),
  cross_mapped STRING OPTIONS(description="A short isomiR read may map exactly to mature strands whose sequences are similar but not identical, when the read sequence does not capture the bases that distinguish these miRNAs (e.g. hsa-mir-30a at 6q13 and hsa-mir-30e at 1p34.2, which differ at position 18). We report such a <line_feed> read as cross-mapped, and we increment the read count for each MIMAT that it mapped to. Either Y or N -- fewer than 2% are Y"),
  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="GDC unique identifier for this case (corresponds to the case_barcode)  --  this can be used to access more information from the GDC data portal like this:   https://portal.gdc.cancer.gov/files/c21b332c-06c6-4403-9032-f91c8f407ba13"),
  sample_gdc_id STRING OPTIONS(description="Unique GDC identifier for this sample (corresponds to the sample_barcode), eg a1ec9279-c1a6-4e58-97ed-9ec1f36187c5  --  this can be used to access more information from the GDC data portal"),
  aliquot_gdc_id STRING OPTIONS(description="Unique GDC identifier for this aliquot (corresponds to the aliquot_barcode), eg 7fbfdb3e-1fd2-4206-8d2e-7f68e4a15844  --  this can be used to access more information from the GDC data portal"),
  file_gdc_id STRING OPTIONS(description="Unique GDC identifier for this file (corresponds to the file_barcode)  --  this can be used to access more information from the GDC data portal like this: https://portal.gdc.cancer.gov/files/c21b332c-06c6-4403-9032-f91c8f407ba13"),
  miRNA_transcript STRING OPTIONS(description="The type of transcript -- either mature, precursor, unannotated, or stemloop  (if this value is not mature, then the mirna_accession field will be null)"),
  miRNA_accession STRING OPTIONS(description="The mature miRNA accession id (eg MIMAT0000062) -- note that this can also be null, in the event that this read does not map to a mature portion of the miRNA")
)
OPTIONS(
  friendly_name="CPTAC HG38 MIRNA ISOFORM EXPRESSION",
  description="Data was extracted from Rel 28 of the active GDC archive in October 2020 for CPTAC miRNA isoform data. The mRNA expression data was originally generated by next generation sequencing runs and quantified using the GDC miRNAseq isoform analysis pipeline.",
  labels=[("access", "open"), ("program_0", "cptac2"), ("reference_genome", "hg38"), ("program_1", "cptac3"), ("data_type", "mirna_isoform_expression"), ("source", "gdc"), ("category", "processed_-omics_data"), ("status", "current"), ("version", "r28")]
);

INSERT INTO `isb-cgc-bq.CPTAC.miRNAseq_isoform_hg38_gdc_current` (project_short_name, case_barcode, sample_barcode, aliquot_barcode, primary_site, miRNA_id, chromosome, start_pos, end_pos, strand, read_count, reads_per_million_miRNA_mapped, cross_mapped, sample_type_name, case_gdc_id, sample_gdc_id, aliquot_gdc_id, file_gdc_id, miRNA_transcript, miRNA_accession) VALUES ('CPTAC-2', '17OV027', '38f29517-c046-4da5-ba0d-67d614', '38f29517-c046-4da5-ba0d-67d614_D7', 'Retroperitoneum and peritoneum', 'hsa-mir-214', 'chr1', 172138818, 172138837, '-', 214, 75725.406936, 'N', 'Primary Tumor', 'b38e6e7c-877f-44eb-aef7-04af61f96469', 'e80600d9-5373-4bf2-891d-270cc4d3230e', '859b7834-d16e-4aad-86d7-55435a711c05', '98ef1cf6-7c31-4979-9dbf-c3c447a48899', NULL, NULL), ('CPTAC-2', '04OV004', 'e3ebe010-cd31-4b5d-8fcb-b7103b', 'e3ebe010-cd31-4b5d-8fcb-b7103b_D7', 'Retroperitoneum and peritoneum', 'hsa-mir-181b-1', 'chr1', 198858925, 198858947, '-', 1357, 194999.281506, 'N', 'Primary Tumor', '11fb5957-a5ab-424e-bd60-1100ae5814f6', '6f70d8f5-9583-4b5f-ae1c-7b3de16d1071', '2387b9fd-20f4-4610-881f-596937c8742a', 'f4729a98-01ba-4990-bfe8-89abcd0da05b', NULL, NULL), ('CPTAC-2', '01OV023', 'd38f40fb-dd78-43b2-8b7b-4b6977', 'd38f40fb-dd78-43b2-8b7b-4b6977_D7', 'Retroperitoneum and peritoneum', 'hsa-mir-30c-1', 'chr1', 40757300, 40757319, '+', 2, 2392.344498, 'N', 'Primary Tumor', '857845ca-096c-40ed-8edc-ab4572688280', '2c8994be-8d94-486e-983f-c82929f1836d', '14f5031d-08ee-4f31-9797-dbf9f66581a3', '26ac3ce4-2627-45f0-b4ef-6f16df13df4f', NULL, NULL), ('CPTAC-2', '17OV025', 'e7b656bf-3c34-4ba1-bdf3-c7eefe', 'e7b656bf-3c34-4ba1-bdf3-c7eefe_D7', 'Retroperitoneum and peritoneum', 'hsa-mir-200a', 'chr1', 1167878, 1167902, '+', 1, 252.908447, 'N', 'Primary Tumor', '0b85b532-ea92-4103-9356-4bdc7a04db6d', '437b8eea-1026-461f-8379-79d3cc761fae', '28bf60fc-6ee6-4484-afb8-1f07cfc26678', '3ebbe64e-c1d0-4095-b892-ded17d0fb2f0', NULL, NULL), ('CPTAC-2', '01OV026', '347e379b-77c0-4dd3-aa25-18c9d1', '347e379b-77c0-4dd3-aa25-18c9d1_D7', 'Retroperitoneum and peritoneum', 'hsa-mir-320b-2', 'chr1', 224257051, 224257069, '-', 35, 3110.558123, 'N', 'Primary Tumor', '4f552cb7-0380-4918-82ea-1f38562406b9', '01b67ed4-1a6d-4cc5-b542-d9642c0cc2ba', '496f98d5-9229-4c56-b83d-3172cb824e73', '8841f2ba-5bb3-4102-80a8-3ee566f22e19', NULL, NULL);