{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://scischema.org/schemas/biology/rna-seq-library-preparation/1.0.0/master-schema.json",
  "version": "1.0.0",
  "title": "Bulk RNA-seq Library Preparation and Sequencing Process",
  "description": "Gold-standard schema representing the complete workflow for Bulk RNA-seq library preparation and sequencing, incorporating best practices from iterative expert evaluation across five rounds of Schema Miner refinement.",
  "type": "object",
  "$defs": {
    "kit_details": {
      "type": "object",
      "description": "Reusable commercial kit identification block — referenced across RNA extraction, library preparation, and transcript enrichment to avoid redundant property definitions.",
      "required": [
        "kit_name",
        "manufacturer"
      ],
      "properties": {
        "kit_name": {
          "type": "string",
          "description": "Full commercial name of the kit used (e.g., Qiagen RNeasy Plus Mini Kit, NEBNext Ultra II RNA Library Prep Kit)",
          "examples": [
            "Qiagen RNeasy Plus",
            "NEBNext Ultra II"
          ]
        },
        "manufacturer": {
          "type": "string",
          "description": "Name of the kit manufacturer (e.g., Qiagen, New England Biolabs, Illumina, Thermo Fisher Scientific)",
          "examples": [
            "Qiagen",
            "NEB",
            "Illumina"
          ]
        },
        "catalog_number": {
          "type": "string",
          "description": "Manufacturer catalog number for precise lot-to-lot traceability and reproducibility verification",
          "examples": [
            "74134",
            "E7770S"
          ]
        },
        "kit_version": {
          "type": "string",
          "description": "Version or lot number of the kit used, important for tracking batch-to-batch variation in reagent performance",
          "examples": [
            "v2",
            "Lot_20240101"
          ]
        }
      }
    }
  },
  "required": [
    "sample",
    "rna_extraction",
    "rna_input",
    "quality_control",
    "library_preparation",
    "sequencing",
    "primary_data_processing",
    "experimental_design",
    "metadata"
  ],
  "properties": {
    "sample": {
      "type": "object",
      "description": "Biological sample identity and source information, separated from extraction and QC as an independent workflow stage.",
      "required": [
        "sample_id",
        "organism",
        "tissue_type",
        "source_material"
      ],
      "properties": {
        "sample_id": {
          "type": "string",
          "description": "Unique identifier for the biological sample within the study, used to track the sample across all workflow stages and link to public repository records",
          "examples": [
            "Sample_001",
            "GSM123456"
          ]
        },
        "organism": {
          "type": "string",
          "description": "Scientific name of the organism from which the sample was derived, following NCBI taxonomy conventions",
          "examples": [
            "Homo sapiens",
            "Mus musculus"
          ]
        },
        "tissue_type": {
          "type": "string",
          "description": "Specific tissue or organ from which RNA was extracted. Should be as precise as possible (e.g., prefrontal cortex rather than brain) to enable accurate cross-study comparisons",
          "examples": [
            "liver",
            "breast tumor",
            "whole blood",
            "prefrontal cortex"
          ]
        },
        "cell_type": {
          "type": "string",
          "description": "Specific cell line or cell population if applicable. For primary cells, use established nomenclature (e.g., CD4+ T cells); for cell lines, use ATCC or equivalent registry name",
          "examples": [
            "MCF7",
            "CD4+ T cells",
            "HEK293T"
          ]
        },
        "source_material": {
          "type": "string",
          "description": "Type and preservation state of the biological material at the point of collection. Affects RNA integrity expectations and extraction protocol selection",
          "examples": [
            "fresh frozen",
            "FFPE",
            "cultured cells",
            "RNAlater-stabilized"
          ]
        },
        "storage_conditions": {
          "type": "object",
          "description": "Storage conditions for the biological sample at different stages prior to and after RNA extraction, relevant for assessing RNA integrity",
          "properties": {
            "prior_to_extraction": {
              "type": "string",
              "description": "How and at what temperature the sample was stored between collection and RNA extraction",
              "examples": [
                "Flash-frozen at -80°C",
                "FFPE block at room temperature",
                "RNAlater at -20°C"
              ]
            },
            "post_extraction": {
              "type": "string",
              "description": "Storage conditions for the extracted RNA prior to library preparation",
              "examples": [
                "-80°C in RNase-free water",
                "-80°C in ethanol precipitation",
                "-80°C in TE buffer"
              ]
            }
          }
        },
        "treatment_or_condition": {
          "type": "string",
          "description": "Experimental treatment or condition applied to the sample prior to RNA extraction. Should include dose, duration, and vehicle where applicable",
          "examples": [
            "10µM doxorubicin 24h",
            "Wild-type control",
            "siRNA knockdown 48h",
            "hypoxia 1% O2 6h"
          ]
        }
      }
    },
    "rna_extraction": {
      "type": "object",
      "description": "RNA isolation methodology and associated parameters. Post-extraction quality assessment is handled exclusively in the quality_control block to avoid duplication.",
      "required": [
        "method",
        "dnase_treatment"
      ],
      "properties": {
        "method": {
          "type": "string",
          "description": "General approach or protocol used for RNA isolation. Determines expected RNA purity and integrity and informs downstream QC thresholds",
          "examples": [
            "TRIzol phenol-chloroform extraction",
            "Qiagen RNeasy column-based",
            "mechanical homogenization followed by column purification"
          ]
        },
        "kit_details": {
          "$ref": "#/$defs/kit_details",
          "description": "Commercial kit used for RNA extraction, if applicable. Not all extractions use a commercial kit."
        },
        "protocol_reference": {
          "type": "string",
          "description": "DOI, URL, or citation for the extraction protocol used, enabling exact replication of the isolation procedure",
          "examples": [
            "https://doi.org/10.1038/nprot.2006.83",
            "Manufacturer protocol v2.0"
          ]
        },
        "dnase_treatment": {
          "type": "boolean",
          "description": "Whether DNase I treatment was applied post-extraction to remove residual genomic DNA contamination, which can confound alignment and quantification"
        },
        "yield": {
          "type": "number",
          "minimum": 0,
          "description": "Total RNA yield after extraction, measured in nanograms (ng). Used to determine whether sufficient material is available for library preparation and to assess extraction efficiency",
          "examples": [
            1000,
            5000,
            25000
          ]
        },
        "starting_material": {
          "type": "object",
          "description": "Pre-extraction biological input material quantity, used to calculate extraction efficiency and normalize yield across samples",
          "properties": {
            "quantity": {
              "type": "number",
              "minimum": 0,
              "description": "Amount of biological starting material used for RNA extraction",
              "examples": [
                25,
                100,
                1000000
              ]
            },
            "unit": {
              "type": "string",
              "enum": [
                "mg",
                "g",
                "cells",
                "uL"
              ],
              "description": "Unit of measurement for the starting material quantity (mg or g for tissue; cells for cell cultures; uL for liquid samples)"
            }
          }
        },
        "extraction_date": {
          "type": "string",
          "format": "date",
          "description": "Date when RNA extraction was performed, in ISO 8601 format (YYYY-MM-DD). Required for temporal traceability and batch effect documentation",
          "examples": [
            "2024-01-10"
          ]
        }
      }
    },
    "rna_input": {
      "type": "object",
      "description": "RNA input quantity used for library preparation — documented as a separate workflow stage from extraction to capture the specific amount committed to library construction, which may differ from total yield.",
      "required": [
        "quantity",
        "quantity_unit"
      ],
      "properties": {
        "quantity": {
          "type": "number",
          "minimum": 0.001,
          "description": "Amount of RNA used as input for library preparation. Influences PCR cycle number requirements and downstream library complexity",
          "examples": [
            50,
            100,
            500,
            1000
          ]
        },
        "quantity_unit": {
          "type": "string",
          "enum": [
            "ng",
            "µg"
          ],
          "description": "Unit of measurement for RNA input quantity. Nanograms (ng) for standard inputs; micrograms (µg) for high-input protocols"
        }
      }
    },
    "quality_control": {
      "type": "object",
      "description": "Comprehensive two-stage quality control block covering post-extraction RNA integrity assessment and post-library-preparation library quality assessment. Both sub-blocks are required to fully document sample suitability for sequencing.",
      "required": [
        "rna_integrity",
        "library_quality"
      ],
      "properties": {
        "rna_integrity": {
          "type": "object",
          "description": "Post-extraction RNA quality metrics assessing integrity, purity, and concentration using Bioanalyzer, TapeStation, or spectrophotometric instruments",
          "required": [
            "rin"
          ],
          "properties": {
            "rin": {
              "type": "number",
              "minimum": 1,
              "maximum": 10,
              "description": "RNA Integrity Number (RIN) from Bioanalyzer or equivalent (scale 1-10). Values above 7 are generally recommended for standard poly-A RNA-seq; lower values may be acceptable for rRNA-depleted or FFPE samples",
              "examples": [
                8.5,
                9.2,
                7.1
              ]
            },
            "dv200": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "description": "Percentage of RNA fragments greater than 200 nucleotides in length. Critical quality metric for FFPE samples where RIN is not applicable; values above 30% are generally considered acceptable",
              "examples": [
                65,
                85,
                95
              ]
            },
            "bioanalyzer_profile": {
              "type": "string",
              "description": "Qualitative description of the electropherogram trace from Bioanalyzer or TapeStation, documenting the visual appearance of the 18S and 28S ribosomal RNA peaks and any degradation markers",
              "examples": [
                "intact 28S/18S peaks",
                "moderately degraded with 28S shoulder",
                "high quality with RIN 9.2"
              ]
            },
            "quality_assessment_date": {
              "type": "string",
              "format": "date",
              "description": "Date when RNA quality assessment was performed, in ISO 8601 format (YYYY-MM-DD). Used to track time elapsed between extraction and quality assessment",
              "examples": [
                "2024-01-11"
              ]
            },
            "spectrophotometric_ratios": {
              "type": "object",
              "description": "Spectrophotometric purity ratios measured by NanoDrop or equivalent instrument, used to detect protein and organic compound contamination in the RNA sample",
              "required": [
                "a260_a280",
                "a260_a230"
              ],
              "properties": {
                "a260_a280": {
                  "type": "number",
                  "minimum": 1.5,
                  "maximum": 2.5,
                  "description": "Absorbance ratio at 260nm to 280nm — indicator of protein contamination. Pure RNA is expected to have a ratio of approximately 2.0; values below 1.8 suggest protein or phenol contamination",
                  "examples": [
                    2.0,
                    1.95,
                    2.05
                  ]
                },
                "a260_a230": {
                  "type": "number",
                  "minimum": 1.5,
                  "maximum": 3.0,
                  "description": "Absorbance ratio at 260nm to 230nm — indicator of organic compound contamination (guanidinium salts, phenol, EDTA). Expected range 2.0–2.2 for pure RNA; values below 1.8 indicate carryover contamination",
                  "examples": [
                    2.1,
                    2.3,
                    2.15
                  ]
                }
              }
            }
          }
        },
        "library_quality": {
          "type": "object",
          "description": "Post-library-preparation quality metrics assessing fragment size distribution, concentration, and sequencing suitability of the prepared library before loading onto the sequencer",
          "properties": {
            "average_insert_size": {
              "type": "integer",
              "description": "Average insert size of library fragments after adapter ligation, measured in base pairs (bp) by Bioanalyzer or TapeStation. Typical range 150–500 bp for standard RNA-seq",
              "examples": [
                300,
                250,
                350
              ]
            },
            "min_size": {
              "type": "integer",
              "description": "Minimum fragment size detected in the library by Bioanalyzer or TapeStation, in base pairs (bp). Used to detect adapter dimer contamination (typically <150 bp)",
              "examples": [
                150,
                180
              ]
            },
            "max_size": {
              "type": "integer",
              "description": "Maximum fragment size detected in the library by Bioanalyzer or TapeStation, in base pairs (bp). Large fragments may indicate incomplete fragmentation",
              "examples": [
                500,
                600
              ]
            },
            "library_concentration": {
              "type": "number",
              "description": "Final library concentration before sequencing, measured in nanograms per microliter (ng/µL) by Qubit fluorometry or equivalent. Used to calculate loading concentration for the sequencer",
              "examples": [
                12.5,
                8.3,
                25.0
              ]
            },
            "quantification_method": {
              "type": "string",
              "enum": [
                "Qubit fluorometry",
                "Bioanalyzer",
                "TapeStation",
                "qPCR"
              ],
              "description": "Instrument or method used to quantify library concentration. Qubit fluorometry is preferred for accurate dsDNA-specific quantification; qPCR measures only amplifiable molecules"
            },
            "adapter_dimer_contamination": {
              "type": "boolean",
              "description": "Whether adapter dimer artifacts (typically 120–150 bp fragments) were detected in the final library. Presence indicates incomplete size selection and may reduce effective sequencing yield"
            },
            "gc_content_bias": {
              "type": "object",
              "description": "Assessment of GC content bias in the library, which can affect quantification accuracy of high- or low-GC transcripts",
              "properties": {
                "detected": {
                  "type": "boolean",
                  "description": "Whether GC content bias was detected during library QC or post-sequencing FastQC analysis"
                },
                "bias_direction": {
                  "type": "string",
                  "enum": [
                    "high GC",
                    "low GC",
                    "both"
                  ],
                  "description": "Direction of GC bias if detected — high GC bias favors amplification of GC-rich transcripts; low GC bias favors AT-rich transcripts"
                },
                "assessment_method": {
                  "type": "string",
                  "description": "Method used to assess GC content bias (e.g., FastQC per-sequence GC content module, RSeQC, MultiQC)",
                  "examples": [
                    "FastQC",
                    "RSeQC",
                    "MultiQC"
                  ]
                }
              }
            },
            "alignment_rate": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "description": "Percentage of sequenced reads that successfully aligned to the reference genome. Values below 70% may indicate contamination, wrong reference genome, or library quality issues",
              "examples": [
                92.5,
                87.3,
                95.1
              ]
            },
            "exon_capture_rate": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "description": "Percentage of annotated exons with at least one read of coverage. Low values indicate poor library complexity or coverage uniformity",
              "examples": [
                85.2,
                91.0,
                78.5
              ]
            },
            "coverage_variance": {
              "type": "number",
              "description": "Coefficient of variation (CV) of base-level coverage across exons. Higher values indicate uneven coverage, which may reflect GC bias, fragmentation bias, or low library complexity",
              "examples": [
                0.45,
                0.62,
                0.31
              ]
            }
          }
        }
      }
    },
    "library_preparation": {
      "type": "object",
      "description": "Complete library construction workflow from transcript enrichment through PCR amplification. Transcript enrichment is nested here as an intrinsic construction step rather than a standalone block.",
      "required": [
        "transcript_enrichment",
        "protocol_or_kit",
        "library_type",
        "umi_usage",
        "fragmentation_and_amplification"
      ],
      "properties": {
        "transcript_enrichment": {
          "type": "object",
          "description": "Transcript population targeting strategy applied before or during library construction to selectively capture specific RNA species and reduce representation of unwanted transcripts",
          "required": [
            "strategy"
          ],
          "properties": {
            "strategy": {
              "type": "string",
              "enum": [
                "poly-A selection",
                "rRNA depletion (RiboZero)",
                "globin depletion",
                "total RNA"
              ],
              "description": "Method used to enrich for specific transcript populations. Poly-A selection captures mRNA via oligo-dT beads; rRNA depletion removes ribosomal RNA to retain all RNA species including non-polyadenylated transcripts"
            },
            "target_rna": {
              "type": "string",
              "description": "Specific RNA population targeted by the enrichment strategy, if more specific than the general strategy indicates",
              "examples": [
                "mRNA",
                "lncRNA",
                "total RNA excluding rRNA",
                "small RNA"
              ]
            },
            "kit_details": {
              "$ref": "#/$defs/kit_details",
              "description": "Commercial kit used for transcript enrichment (e.g., Illumina TruSeq Stranded mRNA, Ribo-Zero Gold)"
            },
            "protocol_reference": {
              "type": "string",
              "description": "DOI, URL, or citation for the transcript enrichment protocol used",
              "examples": [
                "https://doi.org/10.1101/pdb.prot5350"
              ]
            }
          }
        },
        "protocol_or_kit": {
          "type": "string",
          "description": "Name of the library preparation protocol or commercial kit used for the complete library construction workflow",
          "examples": [
            "Illumina TruSeq Stranded mRNA Library Prep",
            "NEBNext Ultra II RNA Library Prep",
            "KAPA RNA HyperPrep"
          ]
        },
        "kit_details": {
          "$ref": "#/$defs/kit_details",
          "description": "Detailed kit identification for the library preparation kit, including catalog number for lot traceability"
        },
        "library_type": {
          "type": "string",
          "enum": [
            "stranded-RF (first-strand)",
            "stranded-FR (second-strand)",
            "unstranded"
          ],
          "description": "Library strandedness and directionality using tool-convention labels compatible with STAR, Salmon, HTSeq, and featureCounts. RF = reverse-forward (first-strand synthesis, e.g., dUTP method); FR = forward-reverse (second-strand synthesis)"
        },
        "strand_specific_method": {
          "type": "string",
          "enum": [
            "dUTP/UDG",
            "ligation-based",
            "other"
          ],
          "description": "Specific biochemical method used to achieve strand specificity. The dUTP/UDG method incorporates deoxyuridine triphosphate (dUTP) during second-strand synthesis and selectively degrades the dUTP-containing strand using uracil-DNA glycosylase (UDG), preserving original strand information"
        },
        "umi_usage": {
          "type": "boolean",
          "description": "Whether Unique Molecular Identifiers (UMIs) were incorporated during library preparation to enable PCR duplicate identification and correction, improving quantification accuracy especially for low-input samples"
        },
        "adapter_sequences": {
          "type": "object",
          "description": "Specific adapter oligonucleotide sequences ligated to library fragments for sequencing platform compatibility and sample identification",
          "required": [
            "read1_adapter"
          ],
          "properties": {
            "read1_adapter": {
              "type": "string",
              "description": "Adapter sequence ligated to the first read end, required for all library types",
              "examples": [
                "AGATCGGAAGAGC",
                "CTGTCTCTTATACACATCT"
              ]
            },
            "read2_adapter": {
              "type": "string",
              "description": "Adapter sequence ligated to the second read end — only applicable for paired-end sequencing libraries",
              "examples": [
                "AGATCGGAAGAGC",
                "CTGTCTCTTATACACATCT"
              ]
            }
          }
        },
        "adapter_ligation": {
          "type": "object",
          "description": "Detailed parameters of the adapter ligation step, providing complete documentation of the library construction chemistry",
          "properties": {
            "adapter_type": {
              "type": "string",
              "enum": [
                "Y-shaped",
                "A-tailed",
                "blunt-end",
                "other"
              ],
              "description": "Structural type of adapter used. Y-shaped adapters are standard for strand-specific libraries; A-tailed adapters use a 3' adenine overhang for ligation"
            },
            "adapter_sequence_5prime": {
              "type": "string",
              "description": "Full nucleotide sequence of the adapter ligated to the 5' end of the RNA or cDNA fragment"
            },
            "adapter_sequence_3prime": {
              "type": "string",
              "description": "Full nucleotide sequence of the adapter ligated to the 3' end of the RNA or cDNA fragment"
            },
            "ligation_strategy": {
              "type": "string",
              "description": "Specific ligation chemistry or approach used to attach adapters to library fragments",
              "examples": [
                "A-tailing followed by Y-adapter ligation",
                "blunt-end ligation",
                "RNA ligation without adapter"
              ]
            }
          }
        },
        "reverse_transcription": {
          "type": "string",
          "description": "Method used for converting RNA to complementary DNA (cDNA) during library preparation. Priming strategy affects coverage uniformity and transcript representation",
          "examples": [
            "oligo-dT priming",
            "random hexamers",
            "gene-specific priming",
            "template switching"
          ]
        },
        "phosphorothioate_oligos_used": {
          "type": "boolean",
          "description": "Whether phosphorothioate-modified oligonucleotides were used during library preparation to prevent adapter-adapter ligation (adapter dimer formation) and improve library complexity"
        },
        "indexing": {
          "type": "object",
          "description": "Sample multiplexing index information, enabling multiple samples to be pooled and sequenced in a single lane with subsequent demultiplexing by barcode",
          "required": [
            "index_type"
          ],
          "properties": {
            "index_type": {
              "type": "string",
              "enum": [
                "single",
                "dual"
              ],
              "description": "Whether single or dual indexing was used. Dual indexing reduces index hopping artifacts and is required for high-throughput multiplexing on patterned flow cells"
            },
            "index_sequence": {
              "type": "string",
              "description": "Actual barcode nucleotide sequence used to uniquely identify this sample in the multiplexed pool",
              "examples": [
                "ATCACG",
                "TTAGGC-ATCACG"
              ]
            },
            "index_length": {
              "type": "integer",
              "minimum": 4,
              "maximum": 10,
              "description": "Length of the index sequence in nucleotides. Standard Illumina indexes are 6–8 nucleotides",
              "examples": [
                6,
                8,
                10
              ]
            }
          }
        },
        "fragmentation_and_amplification": {
          "type": "object",
          "description": "Unified block documenting RNA or cDNA fragmentation parameters and subsequent PCR amplification conditions. Both steps are intrinsically linked in library construction as fragmentation size directly influences amplification efficiency.",
          "required": [
            "fragmentation_method",
            "fragmentation_temperature",
            "fragmentation_time",
            "pcr_cycles"
          ],
          "properties": {
            "fragmentation_method": {
              "type": "string",
              "enum": [
                "enzymatic",
                "thermal",
                "sonication",
                "chemical",
                "acoustic shearing",
                "mechanical shearing",
                "none"
              ],
              "description": "Method used to fragment RNA or cDNA into sequenceable lengths. Enzymatic fragmentation uses RNA fragmentation reagents or transposases; thermal fragmentation uses heat-induced hydrolysis; acoustic shearing is advantageous for samples with high rRNA content"
            },
            "target_size": {
              "type": "integer",
              "minimum": 100,
              "maximum": 1000,
              "description": "Target fragment size in base pairs (bp) after fragmentation. Typical range 150–500 bp for standard RNA-seq; shorter fragments (150–200 bp) are used for small RNA or FFPE samples",
              "examples": [
                200,
                300,
                400
              ]
            },
            "fragmentation_temperature": {
              "type": "number",
              "minimum": 4,
              "description": "Temperature in degrees Celsius at which fragmentation was performed. Minimum 4°C to exclude physically impossible values; thermal fragmentation typically performed at 94°C",
              "examples": [
                94,
                95,
                85
              ]
            },
            "fragmentation_time": {
              "type": "number",
              "minimum": 1,
              "description": "Duration of the fragmentation step in minutes. Minimum 1 minute; longer times produce smaller fragments. Typical range 1–15 minutes depending on target size and method",
              "examples": [
                3,
                5,
                8,
                15
              ]
            },
            "pcr_cycles": {
              "type": "integer",
              "minimum": 5,
              "maximum": 20,
              "description": "Number of PCR amplification cycles used to generate sufficient library material for sequencing. Typical range 5–15 cycles for standard RNA-seq inputs; optimal cycle count should be determined by real-time PCR to avoid over-amplification and GC bias",
              "examples": [
                8,
                12,
                15
              ]
            },
            "polymerase": {
              "type": "string",
              "description": "DNA polymerase used for PCR amplification during library preparation. High-fidelity polymerases reduce amplification-introduced errors and GC bias",
              "examples": [
                "KAPA HiFi",
                "Phusion High-Fidelity",
                "Q5 Hot Start"
              ]
            },
            "amplification_method": {
              "type": "string",
              "enum": [
                "rolling circle",
                "bridge PCR",
                "other"
              ],
              "description": "Mechanism used for library amplification on the sequencing platform. Rolling circle amplification (DNBseq/MGI platforms) generates DNA nanoballs by isothermal linear amplification without PCR errors. Bridge PCR (Illumina platforms) uses exponential cluster amplification and is prone to GC content bias"
            },
            "purification_method": {
              "type": "string",
              "enum": [
                "SPRI beads",
                "gel electrophoresis",
                "column-based"
              ],
              "description": "Method used to purify library fragments between workflow steps, removing enzymes, primers, and unwanted fragment sizes"
            },
            "size_selection_method": {
              "type": "string",
              "enum": [
                "SPRI bead subtraction",
                "gel extraction",
                "none"
              ],
              "description": "Method used to select library fragments within the desired size range. SPRI bead subtraction allows size selection without gel; gel extraction provides precise size selection but is lower throughput"
            }
          }
        },
        "library_preparation_notes": {
          "type": "string",
          "description": "Free-text field for additional notes about library preparation, including deviations from standard protocols, QC observations, batch effects, or troubleshooting steps taken"
        }
      }
    },
    "sequencing": {
      "type": "object",
      "description": "Sequencing instrument configuration, run parameters, and metadata documenting the technical specifications of the sequencing experiment.",
      "required": [
        "platform",
        "read_configuration",
        "sequencing_depth"
      ],
      "properties": {
        "platform": {
          "type": "string",
          "description": "Full name of the sequencing instrument model used. Not restricted to Illumina platforms to support emerging short-read and long-read sequencing technologies",
          "examples": [
            "Illumina NovaSeq 6000",
            "Illumina NextSeq 2000",
            "MGI DNBSEQ-G400",
            "BGISEQ-500",
            "Element Biosciences AVITI",
            "Illumina HiSeq 4000"
          ]
        },
        "flow_cell_type": {
          "type": "string",
          "description": "Flow cell type used for sequencing run, which determines cluster density, read length capacity, and total output. Relevant primarily for Illumina platforms",
          "examples": [
            "S4",
            "S2",
            "SP",
            "P2",
            "High Output"
          ]
        },
        "flow_cell_patterned": {
          "type": "boolean",
          "description": "Whether a patterned flow cell was used for sequencing. Patterned flow cells (e.g., Illumina NovaSeq, NextSeq 2000) use nanowells for higher cluster density and reduced optical duplicates compared to randomly distributed clusters"
        },
        "read_configuration": {
          "type": "object",
          "description": "Sequencing read layout and length parameters defining the fundamental sequencing strategy",
          "required": [
            "read_type",
            "read_length"
          ],
          "properties": {
            "read_type": {
              "type": "string",
              "enum": [
                "single-end",
                "paired-end"
              ],
              "description": "Whether sequencing reads were generated from one end (single-end) or both ends (paired-end) of the library fragment. Paired-end sequencing improves alignment accuracy and enables detection of splice junctions and structural variants"
            },
            "read_length": {
              "type": "object",
              "description": "Read lengths in base pairs — structured as a two-field object to support asymmetric paired-end runs where read 1 and read 2 may have different lengths",
              "required": [
                "read1"
              ],
              "properties": {
                "read1": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "Length of the first sequencing read in base pairs (bp). Required for all library types",
                  "examples": [
                    75,
                    100,
                    150
                  ]
                },
                "read2": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "Length of the second sequencing read in base pairs (bp). Only applicable for paired-end sequencing; may differ from read1 in asymmetric runs",
                  "examples": [
                    75,
                    100,
                    150
                  ]
                }
              }
            }
          }
        },
        "sequencing_depth": {
          "type": "integer",
          "minimum": 1000000,
          "description": "Total number of reads generated per sample. Standard bulk RNA-seq for differential expression analysis requires 20–50 million reads; minimum of 1,000,000 enforced to exclude unrealistically low values",
          "examples": [
            20000000,
            30000000,
            50000000
          ]
        },
        "run_id": {
          "type": "string",
          "description": "Unique identifier for the sequencing run, either an internal run ID or a public repository accession number (e.g., SRA run accession)",
          "examples": [
            "SRR123456",
            "RUN_2024_001",
            "240115_NB501234_0123_AHXXXXX"
          ]
        },
        "multiplexing_pool_size": {
          "type": "integer",
          "minimum": 1,
          "description": "Number of samples pooled together and sequenced in a single sequencing run or lane. Relevant for understanding sequencing depth per sample and potential index hopping rates",
          "examples": [
            8,
            12,
            16,
            24
          ]
        },
        "sequencing_date": {
          "type": "string",
          "format": "date",
          "description": "Date when sequencing was performed, in ISO 8601 format (YYYY-MM-DD). Required for temporal traceability and batch documentation",
          "examples": [
            "2024-02-01"
          ]
        },
        "sequencing_notes": {
          "type": "string",
          "description": "Free-text field for additional notes about the sequencing run, including cluster density, PhiX spike-in percentage, quality score distributions, or any technical issues encountered during the run"
        }
      }
    },
    "primary_data_processing": {
      "type": "object",
      "description": "Computational analysis pipeline applied to raw sequencing data to produce gene-level expression estimates. All required fields are mandatory for FAIR computational reproducibility.",
      "required": [
        "reference_genome",
        "gene_annotation",
        "trimming_tool",
        "alignment_tool",
        "quantification_tool",
        "normalization_method",
        "software_versions",
        "processing_date"
      ],
      "properties": {
        "reference_genome": {
          "type": "string",
          "description": "Reference genome assembly name and version used for read alignment. Should include assembly version to enable exact replication of alignment results",
          "examples": [
            "GRCh38",
            "GRCm39",
            "GRCh38.p14",
            "T2T-CHM13v2.0"
          ]
        },
        "gene_annotation": {
          "type": "string",
          "description": "Gene annotation file (GTF/GFF) name and version used for read quantification. Must match the reference genome assembly to ensure coordinate compatibility",
          "examples": [
            "GENCODE v44",
            "Ensembl v109",
            "RefSeq GRCh38.p14"
          ]
        },
        "trimming_tool": {
          "type": "string",
          "description": "Software tool and version used for adapter sequence removal and read quality trimming before alignment. Version number is required for reproducibility",
          "examples": [
            "fastp v0.23.2",
            "Trimmomatic v0.39",
            "Cutadapt v4.0",
            "TrimGalore v0.6.7"
          ]
        },
        "adapter_filtering_tool": {
          "type": "string",
          "description": "Separate tool used specifically for adapter sequence filtering if distinct from the general trimming tool. Used primarily in some DNBseq/MGI pipelines",
          "examples": [
            "SOAPnuke v2.1.7",
            "Cutadapt v4.0"
          ]
        },
        "alignment_tool": {
          "type": "string",
          "description": "Software tool and version used for aligning trimmed reads to the reference genome. Tool choice affects splice junction detection, multi-mapping handling, and alignment rate",
          "examples": [
            "STAR v2.7.10a",
            "HISAT2 v2.2.1",
            "Bowtie2 v2.4.5"
          ]
        },
        "quantification_tool": {
          "type": "string",
          "description": "Software tool and version used for counting aligned reads per gene or transcript to produce expression count matrices",
          "examples": [
            "featureCounts v2.0.3",
            "Salmon v1.9.0",
            "RSEM v1.3.3",
            "HTSeq-count v0.13.5"
          ]
        },
        "normalization_method": {
          "type": "string",
          "description": "Expression normalization strategy applied to raw counts to enable meaningful cross-sample comparisons. Method choice affects downstream statistical analysis",
          "examples": [
            "TPM",
            "TMM (edgeR)",
            "DESeq2 VST",
            "FPKM",
            "CPM"
          ]
        },
        "differential_expression_tool": {
          "type": "string",
          "description": "Statistical software and version used for differential expression analysis — optional field since not all RNA-seq experiments include a DE analysis step",
          "examples": [
            "DESeq2 v1.38",
            "edgeR v3.40",
            "limma-voom v3.52"
          ]
        },
        "software_versions": {
          "type": "array",
          "description": "Structured version tracking of all software tools used in the analysis pipeline. Each entry documents a tool-version pair to enable exact pipeline replication",
          "items": {
            "type": "object",
            "required": [
              "tool",
              "version"
            ],
            "properties": {
              "tool": {
                "type": "string",
                "description": "Name of the software tool used in the analysis pipeline",
                "examples": [
                  "STAR",
                  "Salmon",
                  "DESeq2",
                  "fastp"
                ]
              },
              "version": {
                "type": "string",
                "description": "Version number of the software tool",
                "examples": [
                  "2.7.10a",
                  "1.9.0",
                  "1.38.0",
                  "0.23.2"
                ]
              }
            }
          }
        },
        "processing_date": {
          "type": "string",
          "format": "date",
          "description": "Date when primary data processing pipeline was completed, in ISO 8601 format (YYYY-MM-DD). Required for tracking computational reproducibility over time as tool versions and reference databases are updated",
          "examples": [
            "2024-02-05"
          ]
        },
        "processing_notes": {
          "type": "string",
          "description": "Free-text field for additional notes about computational processing decisions, including filtering thresholds applied, multi-mapping read handling strategy, known pipeline deviations, or QC flags raised during processing"
        }
      }
    },
    "experimental_design": {
      "type": "object",
      "description": "Study-level experimental design parameters critical for statistical analysis model specification, batch effect correction, and accurate result interpretation.",
      "required": [
        "replicates",
        "comparison_groups",
        "design_type",
        "batch_information"
      ],
      "properties": {
        "replicates": {
          "type": "integer",
          "minimum": 1,
          "description": "Number of independent biological replicates per experimental condition. Minimum of 3 biological replicates is recommended for reliable differential expression analysis",
          "examples": [
            3,
            4,
            6
          ]
        },
        "batch_information": {
          "type": "object",
          "description": "Batch processing metadata documenting grouping of samples processed together, required for downstream batch effect identification and correction",
          "required": [
            "batch_id"
          ],
          "properties": {
            "batch_id": {
              "type": "string",
              "description": "Unique identifier for the processing batch — typically the date of library preparation or the sequencing run identifier used to group samples processed under identical conditions",
              "examples": [
                "Batch_2024_01",
                "LibraryPrepLot_42",
                "SequencingRun_20240115"
              ]
            },
            "batch_correction_method": {
              "type": "string",
              "description": "Statistical method used to correct for batch effects in the expression data, if applicable. Should be documented even if no correction was applied",
              "examples": [
                "ComBat",
                "limma removeBatchEffect",
                "ComBat-seq",
                "none"
              ]
            }
          }
        },
        "comparison_groups": {
          "type": "array",
          "description": "Specific pairwise condition contrasts used in differential expression analysis. Each entry should describe the exact biological comparison being made",
          "items": {
            "type": "string",
            "description": "A single pairwise comparison between two experimental conditions, written in the format 'condition A vs condition B'",
            "examples": [
              "treated vs control",
              "tumor vs normal",
              "KO vs WT",
              "high dose vs low dose"
            ]
          }
        },
        "design_type": {
          "type": "string",
          "enum": [
            "paired",
            "unpaired",
            "time series",
            "dose response",
            "factorial"
          ],
          "description": "Experimental design structure that informs the appropriate statistical model for differential expression analysis. Paired designs require a blocking factor in DESeq2 or limma; factorial designs require interaction terms; time series designs require longitudinal modeling"
        }
      }
    },
    "metadata": {
      "type": "object",
      "description": "Study-level metadata required for FAIR data compliance, public repository submission, and long-term data provenance tracking.",
      "required": [
        "study_id",
        "experiment_date",
        "lab",
        "study_title",
        "funding_source"
      ],
      "properties": {
        "study_id": {
          "type": "string",
          "description": "Unique internal or external identifier for the study, used to link all samples and data files to the same project",
          "examples": [
            "RNASEQ_2024_001",
            "PROJECT_MCF7_DOX"
          ]
        },
        "study_title": {
          "type": "string",
          "description": "Full descriptive title of the research study or project, as it would appear in a manuscript or public repository submission",
          "examples": [
            "Transcriptomic response of MCF7 cells to doxorubicin treatment"
          ]
        },
        "experiment_date": {
          "type": "string",
          "format": "date",
          "description": "Date when the primary experiment was performed, in ISO 8601 format (YYYY-MM-DD). Refers to the date of sample collection or treatment, not library preparation or sequencing",
          "examples": [
            "2024-01-10"
          ]
        },
        "lab": {
          "type": "string",
          "description": "Name of the research laboratory or institution where the experiment was conducted, including department and institution name where possible",
          "examples": [
            "Transcriptomics Lab, Department of Molecular Biology, Caltech"
          ]
        },
        "researcher": {
          "type": "string",
          "description": "Name of the primary researcher or principal investigator responsible for the experiment",
          "examples": [
            "Dr. Jane Smith",
            "Prof. John Doe"
          ]
        },
        "funding_source": {
          "type": "string",
          "description": "Funding agency or grant number supporting the research. Required for FAIR compliance and manuscript acknowledgement",
          "examples": [
            "NIH R01 GM123456",
            "ERC Starting Grant 987654",
            "NSF Award 1234567"
          ]
        },
        "public_repository_accession": {
          "type": "string",
          "description": "Accession number in a public data repository where the raw and processed data have been deposited for open access",
          "examples": [
            "GSE123456",
            "SRP123456",
            "PRJNA123456",
            "ERP123456"
          ]
        },
        "submission_date": {
          "type": "string",
          "format": "date",
          "description": "Date when the data was submitted to a public repository, in ISO 8601 format (YYYY-MM-DD)",
          "examples": [
            "2024-02-10"
          ]
        },
        "project_id": {
          "type": "string",
          "description": "Consortium, collaborative project, or funding programme identifier linking this study to a broader research initiative",
          "examples": [
            "ENCODE_Phase4",
            "GTEx_v9",
            "TCGA_BRCA"
          ]
        },
        "notes": {
          "type": "string",
          "description": "Free-text field for any additional observations, caveats, or contextual information about the study that does not fit into structured fields"
        }
      }
    }
  },
  "unevaluatedProperties": false
}
