-- DBMS: bigquery
CREATE TABLE `isb-cgc-bq.HTAN_versioned.scRNAseq_level1_metadata_r2_v2`
(
  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_Biospecimen_ID STRING OPTIONS(description="HTAN Biospecimen Identifier (eg HTANx_yyy_zzz) indicating the biospecimen(s) from which these files were derived; multiple parent biospecimen should be comma-separated"),
  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)"),
  Nucleic_Acid_Source STRING OPTIONS(description="The source of the input nucleic molecule"),
  Cryopreserved_Cells_in_Sample STRING OPTIONS(description="Indicate if library preparation was based on revived frozen cells."),
  Single_Cell_Isolation_Method STRING OPTIONS(description="The method by which cells are isolated into individual reaction containers at a single cell resolution (e.g. wells, micro-droplets)"),
  Dissociation_Method STRING OPTIONS(description="The tissue dissociation method used for scRNASeq or scATAC-seq assays"),
  Library_Construction_Method STRING OPTIONS(description="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]"),
  Read_Indicator STRING OPTIONS(description="Indicate if this is Read 1 (R1) or Read 2 (R2)"),
  Read1 STRING OPTIONS(description="Read 1 content description"),
  Read2 STRING OPTIONS(description="Read 2 content description"),
  End_Bias STRING OPTIONS(description="The end of the cDNA molecule that is preferentially sequenced, e.g. 3/5 prime tag/end or the full length transcript"),
  Reverse_Transcription_Primer STRING OPTIONS(description="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"),
  Spike_In STRING OPTIONS(description="A set of known synthetic RNA molecules with known sequence that are added to the cell lysis mix"),
  Sequencing_Platform STRING OPTIONS(description="A platform is an object aggregate that is the set of instruments and software needed to perform a process [OBI_0000050]. Specific model of the sequencing instrument."),
  Total_Number_of_Input_Cells STRING OPTIONS(description="Number of cells loaded/placed on plates"),
  Input_Cells_and_Nuclei STRING OPTIONS(description="Number of cells and number of nuclei input; entry format: number, number"),
  Library_Preparation_Days_from_Index STRING OPTIONS(description="Number of days between sample for assay was received in lab and the libraries were prepared for sequencing [number]. If not applicable please enter 'Not Applicable'"),
  Single_Cell_Dissociation_Days_from_Index STRING OPTIONS(description="Number of days between sample for single cell assay was received in lab and when the sample was dissociated and cells were isolated [number]. If not applicable please enter 'Not Applicable'"),
  Sequencing_Library_Construction_Days_from_Index STRING OPTIONS(description="Number of days between sample for assay was received in lab and day of sequencing library construction [number]. If not applicable please enter 'Not Applicable'"),
  Nucleic_Acid_Capture_Days_from_Index STRING OPTIONS(description="Number of days between sample for single cell assay was received in lab and day of nucleic acid capture part of library construction (in number of days since sample received in lab) [number]. If not applicable please enter 'Not Applicable'"),
  Protocol_Link STRING OPTIONS(description="Protocols.io ID or DOI link to a free/open protocol resource describing in detail the assay protocol (e.g. surface markers used in Smart-seq, dissociation duration,  lot/batch numbers for key reagents such as primers, sequencing reagent kits, etc.) or the protocol by which the sample was obtained or generated."),
  Technical_Replicate_Group STRING OPTIONS(description="A common term for all files belonging to the same cell or library. Provide a numbering of each library prep batch (can differ from encapsulation and sequencing batch)"),
  Cell_Barcode_Offset STRING OPTIONS(description="Offset in sequence for cell barcode read (in bp): number"),
  Cell_Barcode_Length STRING OPTIONS(description="Length of cell barcode read (in bp): number"),
  Valid_Barcodes_Cell_Number STRING OPTIONS(description="Number"),
  UMI_Barcode_Offset STRING OPTIONS(description="Start position of UMI barcode in the sequence. Values: number, 0 for start of read"),
  UMI_Barcode_Length STRING OPTIONS(description="Length of UMI barcode read (in bp): number"),
  Median_UMIs_per_Cell_Number STRING OPTIONS(description="Number"),
  Empty_Well_Barcode STRING OPTIONS(description="Unique cell barcode assigned to empty cells used as controls in CEL-seq2 assays."),
  Well_Index STRING OPTIONS(description="Indicate if protein expression (EPCAM/CD45) positive/negative data  is available for each cell in CEL-seq2 assays"),
  Feature_Reference_Id STRING OPTIONS(description="Unique ID for this feature. Must not contain whitespace, quote or comma characters. Each ID must be unique and must not collide with a gene identifier from the transcriptome [https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/feature-bc-analysis#feature-ref]"),
  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"),
  File_Size INT64 OPTIONS(description="Size of file (bucket object) in bytes"),
  Base_Filename STRING OPTIONS(description="Base name of file"),
  md5 STRING OPTIONS(description="md5 hash of file")
)
OPTIONS(
  friendly_name="HTAN SCRNASEQ LEVEL 1 METADATA R2 VERSIONED",
  description="Data was extracted from HTAN Synapse projects in April 2022. 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.scRNAseq_level1_metadata_r2_v2` (Component, Filename, File_Format, HTAN_Parent_Biospecimen_ID, HTAN_Data_File_ID, Nucleic_Acid_Source, Cryopreserved_Cells_in_Sample, Single_Cell_Isolation_Method, Dissociation_Method, Library_Construction_Method, Read_Indicator, Read1, Read2, End_Bias, Reverse_Transcription_Primer, Spike_In, Sequencing_Platform, Total_Number_of_Input_Cells, Input_Cells_and_Nuclei, Library_Preparation_Days_from_Index, Single_Cell_Dissociation_Days_from_Index, Sequencing_Library_Construction_Days_from_Index, Nucleic_Acid_Capture_Days_from_Index, Protocol_Link, Technical_Replicate_Group, Cell_Barcode_Offset, Cell_Barcode_Length, Valid_Barcodes_Cell_Number, UMI_Barcode_Offset, UMI_Barcode_Length, Median_UMIs_per_Cell_Number, Empty_Well_Barcode, Well_Index, Feature_Reference_Id, entityId, HTAN_Center, Data_Release, File_Size, Base_Filename, md5) VALUES ('ScRNA-seqLevel1', 'sc_rna_seq_level_1/Linh_UCLA/Case1/Ground-glass-opacity/Ground-glass-opacity_S8_L001_R1_001.fastq.gz', 'fastq', 'HTA3_8001_1002', 'HTA3_8001_4651918348', 'Single Cell', 'No', '10x', 'Enzymatic Digestion', '10xV2', 'R1', 'Cell Barcode and UMI', 'cDNA', '3 Prime', 'Oligo-dT', 'No Spike In', 'Illumina NovaSeq 6000', '16000.0', '16000.0', '0.0', '0.0', '34.0', '0.0', 'https://doi.org/10.1002/cyto.b.21481', 'None', '0.0', '16.0', 'None', '16.0', '10.0', '155118.0', 'None', 'No', 'GRCh38', 'syn23665348', 'HTAN BU', 'Release 1.0', 12455861987, 'Ground-glass-opacity_S8_L001_R1_001.fastq.gz', '2b3125e1e0aee29c512c2858b5db900c'), ('ScRNA-seqLevel1', 'sc_rna_seq_level_1/Linh_UCLA/Case1/Ground-glass-opacity/Ground-glass-opacity_S8_L002_R1_001.fastq.gz', 'fastq', 'HTA3_8001_1002', 'HTA3_8001_1769188461', 'Single Cell', 'No', '10x', 'Enzymatic Digestion', '10xV2', 'R1', 'Cell Barcode and UMI', 'cDNA', '3 Prime', 'Oligo-dT', 'No Spike In', 'Illumina NovaSeq 6000', '16000.0', '16000.0', '0.0', '0.0', '34.0', '0.0', 'https://doi.org/10.1002/cyto.b.21481', 'None', '0.0', '16.0', 'None', '16.0', '10.0', '155118.0', 'None', 'No', 'GRCh38', 'syn23665347', 'HTAN BU', 'Release 1.0', 12360206194, 'Ground-glass-opacity_S8_L002_R1_001.fastq.gz', '17ab0ab276564dc670455c5de3f3146d'), ('ScRNA-seqLevel1', 'sc_rna_seq_level_1/Linh_UCLA/Case1/Normal-lung/Normal-lung_S7_L001_R1_001.fastq.gz', 'fastq', 'HTA3_8001_1001', 'HTA3_8001_1067135576', 'Single Cell', 'No', '10x', 'Enzymatic Digestion', '10xV2', 'R1', 'Cell Barcode and UMI', 'cDNA', '3 Prime', 'Oligo-dT', 'No Spike In', 'Illumina NovaSeq 6000', '16000.0', '16000.0', '0.0', '0.0', '34.0', '0.0', 'https://doi.org/10.1002/cyto.b.21481', 'None', '0.0', '16.0', 'None', '16.0', '10.0', '101943.0', 'None', 'No', 'GRCh38', 'syn23665346', 'HTAN BU', 'Release 1.0', 10465412727, 'Normal-lung_S7_L001_R1_001.fastq.gz', '276dc946ca4cb28627b25bf2a59afa58'), ('ScRNA-seqLevel1', 'sc_rna_seq_level_1/Linh_UCLA/Case1/Normal-lung/Normal-lung_S7_L002_R1_001.fastq.gz', 'fastq', 'HTA3_8001_1001', 'HTA3_8001_8850650337', 'Single Cell', 'No', '10x', 'Enzymatic Digestion', '10xV2', 'R1', 'Cell Barcode and UMI', 'cDNA', '3 Prime', 'Oligo-dT', 'No Spike In', 'Illumina NovaSeq 6000', '16000.0', '16000.0', '0.0', '0.0', '34.0', '0.0', 'https://doi.org/10.1002/cyto.b.21481', 'None', '0.0', '16.0', 'None', '16.0', '10.0', '101943.0', 'None', 'No', 'GRCh38', 'syn23665345', 'HTAN BU', 'Release 1.0', 10372562163, 'Normal-lung_S7_L002_R1_001.fastq.gz', 'd49f5233bbd593c8b5ef9ef1ee5234e1'), ('ScRNA-seqLevel1', 'sc_rna_seq_level_1/Linh_UCLA/Case2/GGO/Ground_glass_opacity_S2_L001_R1_001.fastq.gz', 'fastq', 'HTA3_8002_1004', 'HTA3_8002_0204111591', 'Single Cell', 'No', '10x', 'Enzymatic Digestion', '10xV2', 'R1', 'Cell Barcode and UMI', 'cDNA', '3 Prime', 'Oligo-dT', 'No Spike In', 'Illumina NovaSeq 6000', '16000.0', '16000.0', '0.0', '0.0', '27.0', '0.0', 'https://doi.org/10.1002/cyto.b.21481', 'None', '0.0', '16.0', 'None', '16.0', '10.0', '91636.0', 'None', 'No', 'GRCh38', 'syn23665366', 'HTAN BU', 'Release 1.0', 6669650939, 'Ground_glass_opacity_S2_L001_R1_001.fastq.gz', '13734085203ff9ab00f6204376c7f2e7');