Skip to main content

Expression Profile Ontology

Gene Expression Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 15 October 2026
Audio Overview
FLOW ALGEBRA
TITLE: -Expression Profile Ontology
VERSION: 1.0
DATE: 2026-10-15
SOURCE: https://kirethresearch.org/booksai-core/entity-graph/biological-entities/gene-expression-entities/expression-profile-ontology.html
AUTHORS: Mark Higgins — Sky (Recursive AI)
PROJECT: Kireth Semantic Library
STATUS: Domain-grounded formalisation; source chapter not independently verified.

# PURPOSE
flow "ExpressionProfileOntology" v1.0
  domain: BiologicalEntities.GeneExpressionEntities
  objective: Represent, validate, compare and interpret measured gene or protein expression across biological samples and experimental contexts.
  interpretation: An expression profile is a contextual collection of measured abundances or activities, not an intrinsic fixed property of a gene.

# TYPE SYSTEM
type Entity = {id:str, label:str, ontology_uri:str?}
type Gene extends Entity
type Transcript extends Entity
type Protein extends Entity
type Sample extends Entity {organism:str?, tissue:str?, cell_type:str?, condition:str?, timepoint:str?, replicate_id:str?}
type Assay extends Entity {technology:str, platform:str?, protocol:str?, batch_id:str?}
type Feature extends Entity {kind:enum[gene,transcript,protein], reference_id:str}
type Measurement = {feature:Feature, sample:Sample, assay:Assay, value:float?, unit:str, missing_reason:str?, qc_status:str}
type ExpressionProfile extends Entity {features:list[Feature], samples:list[Sample], measurements:list[Measurement], processing:list[ProcessingStep], provenance:Provenance}
type ProcessingStep = {name:str, parameters:map, software:str?, version:str?, timestamp:str?}
type Provenance = {dataset_uri:str?, source:str, reference_build:str?, annotation_version:str?, licence:str?, created_at:str?}
type Contrast = {case_samples:list[Sample], control_samples:list[Sample], design_formula:str, covariates:list[str]}
type DifferentialResult = {feature:Feature, log2_fold_change:float?, p_value:float?, adjusted_p_value:float?, method:str, contrast:Contrast}
type Evidence = {claim:str, source_uri:str?, method:str?, confidence:float?, limitations:list[str]}

# CORE RELATIONSHIPS
relation PROFILE_CONTAINS_FEATURE(ExpressionProfile, Feature)
relation PROFILE_CONTAINS_SAMPLE(ExpressionProfile, Sample)
relation MEASURES(Measurement, Feature)
relation OBSERVED_IN(Measurement, Sample)
relation PRODUCED_BY(Measurement, Assay)
relation DERIVED_FROM(ExpressionProfile, ExpressionProfile)
relation NORMALISED_BY(ExpressionProfile, ProcessingStep)
relation TRANSCRIPT_OF(Transcript, Gene)
relation ENCODES(Transcript, Protein)
relation COMPARED_WITH(ExpressionProfile, ExpressionProfile)
relation SUPPORTED_BY(DifferentialResult, Evidence)

# CLASSIFICATION
class BulkRNAExpressionProfile <: -ExpressionProfile
class SingleCellRNAExpressionProfile <: -ExpressionProfile
class SpatialExpressionProfile <: -ExpressionProfile
class ProteomicExpressionProfile <: -ExpressionProfile
class TimeSeriesExpressionProfile <: -ExpressionProfile
class ConditionSpecificExpressionProfile <: -ExpressionProfile
class ReferenceExpressionAtlas <: -ExpressionProfile

# VALIDATION RULES
rule UNIQUE_FEATURE_REFERENCE:
  every feature has a resolvable identifier and declared feature kind.
rule SAMPLE_CONTEXT:
  every measurement references exactly one declared sample and assay.
rule MISSINGNESS:
  missing values are distinct from measured zero values.
rule UNIT_CONSISTENCY:
  comparisons require compatible measurement scales and processing histories.
rule REPLICATE_IDENTITY:
  technical and biological replicates are distinguished.
rule NORMALISATION_PROVENANCE:
  retain raw measurements or links to raw data where available.
rule STATISTICAL_DESIGN:
  differential testing records covariates, batches, replicates and correction method.
rule REFERENCE_COMPATIBILITY:
  reference genome and annotation versions must be tracked for transcript-level comparisons.
rule SINGLE_CELL_QC:
  document cell filtering, library size, ambient RNA, doublet handling and normalisation where relevant.
rule PRIVACY:
  do not disclose potentially identifying donor metadata without appropriate authority.

# TRANSFORMATIONS
transform INGEST(raw_assay_data, metadata) -> ExpressionProfile:
  validate identifiers, sample metadata, units, assay metadata and provenance.
transform QUALITY_CONTROL(profile) -> ExpressionProfile:
  annotate outliers, low-quality features and samples; do not silently discard observations.
transform NORMALISE(profile, method, parameters) -> ExpressionProfile:
  record method and parameters; preserve lineage to the input profile.
transform BATCH_ADJUST(profile, batch_model) -> ExpressionProfile:
  adjust only when identifiable and justified; preserve biological condition signals.
transform AGGREGATE(profile, grouping, statistic) -> ExpressionProfile:
  declare whether aggregation is across cells, samples or replicates.
transform DIFFERENTIAL_EXPRESSION(profile, contrast, model) -> list[DifferentialResult]:
  estimate effect sizes, uncertainty and multiplicity-adjusted significance.
transform CLUSTER(profile, distance, algorithm) -> ClusterAssignment:
  record distance, scaling, algorithm and stability checks.
transform ANNOTATE(profile, reference_ontology) -> ExpressionProfile:
  map identifiers with explicit versioned equivalence evidence.

# INFERENCE RULES
infer EXPRESSED(feature, sample):
  require measurement above an assay-appropriate detection criterion;
  report detection confidence and assay limitations.
infer DIFFERENTIALLY_EXPRESSED(feature, contrast):
  require a specified statistical model, effect estimate and uncertainty;
  never equate statistical significance with biological importance.
infer CELL_TYPE_ASSOCIATION(feature, cell_type):
  require supporting measurements and suitable controls;
  do not infer unique cell-type specificity from a single dataset.
infer PATHWAY_ASSOCIATION(profile, pathway):
  require a declared enrichment method, background set and correction for multiple testing;
  association does not establish causal pathway activation.
infer CONDITION_ASSOCIATION(profile, condition):
  preserve potential confounding, sampling and batch effects.

# SEMANTIC_EQUIVALENCE
SEMANTIC_EQUIVALENCE:
  "expression profile" ~ "expression signature" only when operational definitions and measurement context match.
  "RNA abundance" != "protein abundance".
  "gene expression" != "gene activity" without an explicit assay-specific mapping.
  "zero count" != "absence of expression".
  "differential expression" != "causal regulation".
  equivalence_scope: [organism, feature_kind, reference_build, assay, unit, normalisation, biological_context]
  require_evidence: true

# CONFIDENCE
CONFIDENCE:
  measurement: evaluate assay sensitivity, specificity, quality metrics and missingness.
  reproducibility: evaluate biological replicates and independent datasets.
  annotation: evaluate identifier mapping and reference version.
  inference: evaluate effect size, uncertainty, multiple testing and confounding.
  scale: [0.0, 1.0]
  missing_confidence: unknown
  policy: never fabricate numeric confidence; record calibration method.

# RECURSIVE REASONING
recursive RESOLVE_EXPRESSION_CONTEXT(profile, visited=set()):
  if profile.id in visited: return cycle_detected
  visited.add(profile.id)
  validate(profile)
  for ancestor in provenance_parents(profile):
    RESOLVE_EXPRESSION_CONTEXT(ancestor, visited)
  return {profile.id, validated_lineage, compatible_measurements, unresolved_issues}

recursive TRACE_FEATURE(feature, profile, visited=set()):
  if (feature.id, profile.id) in visited: return cycle_detected
  visited.add((feature.id, profile.id))
  return {measurements_for(feature, profile), annotations_for(feature), evidence_for(feature)}

# FLOW_HASH
FLOW_HASH:
  algorithm: SHA-256
  canonicalise: [flow_name, version, ontology_uri, entity_types, relations, rules, transformations]
  exclude: [volatile_runtime_timestamps]
  output: lowercase_hex_digest
  note: Compute from canonical serialisation; no hash is claimed until computed.

# UPDATE_MODEL
UPDATE_MODEL:
  strategy: append_only_provenance_with_versioned_revisions
  triggers: [new_sample, assay_recalibration, corrected_annotation, reference_update, new_evidence, withdrawn_dataset]
  procedure:
    - preserve prior versions and their hashes
    - validate incoming evidence and schema compatibility
    - recompute dependent measurements and inferences where required
    - record changes, uncertainty and downstream impacts
    - publish new version only after validation
  rollback: restore previous validated version without deleting audit history

# AI_CONSUMPTION
AI_CONSUMPTION:
  format: typed_machine_readable_graph
  required: [entity_ids, ontology_uri, measurement_units, sample_context, assay, provenance, confidence_status]
  operations: [retrieve, compare, validate, explain, trace, update]
  safeguards:
    - distinguish measured facts from statistical inferences
    - disclose uncertainty, batch effects and study limitations
    - preserve source citations and data-use restrictions
    - do not infer clinical diagnosis from an expression profile alone
  response_contract: {answer, supporting_evidence, limitations, provenance, version}

# TEST CASES
test T1: zero counts remain distinguishable from missing measurements.
test T2: incompatible normalisation scales block direct numeric comparison.
test T3: transcript identifiers resolve to the correct annotation release.
test T4: differential results include contrast, effect size and adjusted p-value.
test T5: inferred associations do not become causal assertions.
test T6: cyclic provenance references terminate safely.
test T7: each update retains earlier provenance and hash metadata.
test T8: uncalibrated confidence remains unknown rather than invented.

# END FLOW ALGEBRA
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ