-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.schema_r3`
(
  Attribute STRING OPTIONS(description="Key characteristic X of the assay, related protocol, or downstream data that we want to record as metadata feature."),
  Description STRING OPTIONS(description="Provide a definition or a reference containing the definition of attribute X. Preferably provide a source ontology link or code in addition to the definition. Leave blank if the final description is pending."),
  Valid_Values STRING OPTIONS(description="The range of attribute X: the values that can be assigned to attribute X; these values can include/be other attributes (i.e. listed in the 'Attribute' columns) themselves. Comma separated. If none provided any non-null value is valid for attribute X."),
  DependsOn STRING OPTIONS(description="Important characteristics, if any, of attribute X that need to be recorded as metadata features given attribute X is specified. These characteristics could be attributes or properties of attributes (i.e. they are listed in the 'Attribute' column and/or under the 'Properties' column). Comma separated."),
  Properties STRING OPTIONS(description="Properties specific to a particular attribute; note that properties could be attributes themselves (i.e. listed under the 'Attributes' column)."),
  Required STRING OPTIONS(description="Indicate if specifying value for attribute X is mandatory or optional by default. Set to TRUE or FALSE. If TRUE, a data contributor must provide a value for attribute X (e.g. one of the valid values in 'Valid Values', if any are specified). If FALSE, a data contributor may select between 'Not Applicable' or 'Not Specified' as a value for attribute X. Note that an attribute may not be required by default (i.e. 'Required' is set to FALSE), but it could be required by virtue of being an attribute of another required attribute (e.g. see ERCC)."),
  Parent STRING OPTIONS(description="Parent class of this attribute - i.e. where to 'hook' this attribute into an existing schema. Note that this assumes a single existing schema/a single json-ld schema context; if we need to support classes/attributes/properties defined across multiple schemas/json-ld contexts we'd need to add a schema/context column that specifies the context of each attribute, if different from the context of the attribute's parent."),
  DependsOn_Component STRING OPTIONS(description="Each component is a high level ontology class in which entities/objects are categorized/componentized; a component is an entity on its own that needs to be defined in the schema"),
  Source STRING OPTIONS(description="The source for the description of the term, usually an URI. Ontologies can be used as sources. E.g. Library Construction Method has source: http://purl.obolibrary.org/obo/OBI_0000711"),
  Validation_Rules STRING OPTIONS(description="What type of data is allowed in the Valid Values column. Only relevant if Valid Values are not present in the row. E.g. string, list, integer")
)
OPTIONS(
  friendly_name="HTAN DATA MODEL SCHEMA R3 VERSIONED",
  description="Data was extracted from the HTAN data model schema v23.3.1 in April 2023. More details: see https://data.humantumoratlas.org/standards",
  labels=[("access", "open"), ("program", "htan"), ("source", "htan"), ("category", "metadata"), ("status", "current"), ("data_type", "data_dictionary")]
);

INSERT INTO `isb-cgc-bq.HTAN_versioned.schema_r3` (Attribute, Description, Valid_Values, DependsOn, Properties, Required, Parent, DependsOn_Component, Source, Validation_Rules) VALUES ('Library Construction Method', 'Process which results in the creation of a library from fragments of DNA using cloning vectors or oligonucleotides with the role of adaptors [OBI_0000711]', 'Smart-seq2, Smart-SeqV4, 10xV1.0, 10xV1.1, 10xV2, 10xV3,10xV3.1, CEL-seq2, Drop-seq, inDropsV2, inDropsV3, TruDrop, sci-ATAC-seq', NULL, NULL, 'TRUE', 'Sequencing', NULL, 'http://purl.obolibrary.org/obo/OBI_0000711', NULL), ('Reverse Transcription Primer', 'An oligo to which new deoxyribonucleotides can be added by DNA polymerase [SO_0000112]. The type of primer used for reverse transcription, e.g. oligo-dT or random primer. This allows users to identify content of the cDNA library input e.g. enriched for mRNA', 'Oligo-dT, Poly-dT, Feature barcoding, Random', NULL, NULL, 'TRUE', 'scRNA-seq Level 1', NULL, 'http://www.sequenceontology.org/so_wiki/index.php/Category:SO:0000112_!_primer', NULL), ('Alignment Workflow Type', 'Generic name for the workflow used to analyze a data set.', 'BWA, BWA with BQSR, BWA-aln, BWA-mem, BWA with Mark Duplicates and BQSR, STAR 2-Pass, STAR 2-Pass Chimeric, STAR 2-Pass Genome, STAR 2-Pass Transcriptome, Bowtie, Bismark, GSNAP, BSMAP, BSmooth, BS-Seeker2, BS-Seeker, RMAP, MethylCoder, BRAT-BW, Pash, Segemehl, Bisulfighter, BatMeth, LAST, ERNE-BS5, B-SOLANA, SOCS-B, BWA-meth, Other Alignment Workflow, None', NULL, NULL, 'TRUE', 'Sequencing', NULL, 'https://docs.gdc.cancer.gov/Data_Dictionary/viewer/#?view=table-definition-view&id=alignment_workflow', NULL), ('Data Category', 'Specific content type of the data file.', 'Gene Expression, Transcript Expression, Exon Expression Quantification, Gene Expression Quantification, Isoform Expression Quantification, Splice Junction Quantification, Other', NULL, NULL, 'TRUE', 'Sequencing', NULL, 'https://docs.gdc.cancer.gov/Data_Dictionary/viewer/#?view=table-definition-view&id=gene_expression', NULL), ('Analyte Type', 'The kind of molecular specimen analyte: a molecular derivative (I.e. RNA / DNA / Protein Lysate) obtained from a specimen', 'cfDNA Analyte, DNA Analyte, RNA Analyte, Total RNA Analyte, Tissue Block Analyte, Tissue Section Analyte, PBMCs or Plasma or Serum Analyte, cDNA Libraries Analyte, PBMCs, Plasma, Serum Analyte', NULL, NULL, 'TRUE', 'Biospecimen', NULL, 'https://cdebrowser.nci.nih.gov/cdebrowserClient/cdeBrowser.html#/search?publicId=2513915&version=2.0', NULL);