FLOW ALGEBRA
TITLE: Genetic Marker Ontology
VERSION: 1.0
DOMAIN: Biological Entities / Genetic Entities
SOURCE_URL: https://kirethresearch.org/booksai-core/entity-graph/biological-entities/genetic-entities/genetic-marker-ontology.html
STATUS: Domain-grounded formalisation; source page not independently verified.
AUTHORS: Mark Higgins — Sky (Recursive AI)
LICENCE: Open research use; refer to the Kireth Research Open Research Licence for governing terms.
# 01 PURPOSE
flow "GeneticMarkerOntology" v1.0
purpose: Represent identifiable genomic features used to distinguish individuals, alleles, populations, lineages or genomic regions, while preserving assay, reference, uncertainty and provenance.
# 02 TYPED ENTITIES
entity GeneticMarker <: GenomicFeature
entity MarkerLocus <: GenomicLocus
entity MarkerAllele <: Allele
entity ReferenceGenome <: GenomeAssembly
entity GenomicCoordinate <: Coordinate
entity Variant <: GenomicFeature
entity SingleNucleotidePolymorphism <: Variant
entity ShortTandemRepeat <: RepeatVariant
entity VariableNumberTandemRepeat <: RepeatVariant
entity InsertionDeletion <: Variant
entity CopyNumberVariant <: StructuralVariant
entity RestrictionFragmentLengthPolymorphism <: GeneticMarkerMethodClass
entity Haplotype <: AlleleCombination
entity Sample <: BiologicalSample
entity Individual <: Organism
entity Population <: OrganismGroup
entity GenotypeCall <: Observation
entity MarkerAssay <: LaboratoryAssay
entity QualityMetric <: Measurement
entity EvidenceRecord <: ProvenanceRecord
entity TraitAssociation <: StatisticalAssociation
# 03 CORE ATTRIBUTES
GeneticMarker.id: Identifier
GeneticMarker.label: String
GeneticMarker.marker_type: Enum[SNP,STR,VNTR,INDEL,CNV,RFLP,HAPLOTYPE,OTHER]
GeneticMarker.locus: MarkerLocus
GeneticMarker.reference_assembly: ReferenceGenome?
GeneticMarker.reference_allele: String?
GeneticMarker.alternate_alleles: List[String]
GeneticMarker.discovery_method: String?
GeneticMarker.validation_status: Enum[UNVERIFIED,VALIDATED,RETIRED]
GeneticMarker.provenance: EvidenceRecord
GenomicCoordinate.contig: String
GenomicCoordinate.start: Integer
GenomicCoordinate.end: Integer
GenomicCoordinate.coordinate_system: Enum[ZERO_BASED_HALF_OPEN,ONE_BASED_CLOSED]
GenotypeCall.sample: Sample
GenotypeCall.marker: GeneticMarker
GenotypeCall.alleles: List[String]
GenotypeCall.ploidy: Integer?
GenotypeCall.quality: QualityMetric?
GenotypeCall.missing: Boolean
# 04 TYPED RELATIONSHIPS
relation located_at(GeneticMarker,MarkerLocus)
relation referenced_to(MarkerLocus,ReferenceGenome)
relation has_coordinate(MarkerLocus,GenomicCoordinate)
relation has_allele(GeneticMarker,MarkerAllele)
relation overlaps(GeneticMarker,GenomicFeature)
relation typed_as(GeneticMarker,Variant)
relation assayed_by(GeneticMarker,MarkerAssay)
relation observed_in(GenotypeCall,Sample)
relation calls_marker(GenotypeCall,GeneticMarker)
relation sampled_from(Sample,Individual)
relation belongs_to(Individual,Population)
relation tags_haplotype(GeneticMarker,Haplotype)
relation associated_with(GeneticMarker,TraitAssociation)
relation supported_by(GenotypeCall,EvidenceRecord)
relation derived_from(EvidenceRecord,EvidenceRecord)
# 05 CONSTRAINTS
constraint marker_id_unique: UNIQUE(GeneticMarker.id)
constraint valid_interval: coordinate.start >= 0 AND coordinate.end >= coordinate.start
constraint assembly_required_for_coordinate: has_coordinate(m,c) => EXISTS a: referenced_to(locus(m),a)
constraint coordinate_convention_explicit: has_coordinate(m,c) => DEFINED(c.coordinate_system)
constraint allele_reference_context: reference_allele(m) != NULL => reference_assembly(m) != NULL
constraint call_marker_required: GenotypeCall(c) => EXACTLY_ONE calls_marker(c,m)
constraint missing_call_not_homozygous: missing(c) => NOT infer_genotype(c)
constraint association_not_causation: associated_with(m,t) != causes(m,t)
constraint marker_not_necessarily_functional: GeneticMarker(m) !=> ProteinCodingEffect(m)
# 06 CLASSIFICATION
rule SNP(m): single_base_substitution(m) AND defined_reference(m)
rule STR(m): tandem_repeat_unit(m) AND repeat_unit_length(m) IN [1..6]
rule INDEL(m): sequence_insertion(m) OR sequence_deletion(m)
rule CNV(m): copy_number_change(m) AND segmental_extent(m)
rule polymorphic(m,p): allele_frequency_data(m,p) AND distinct_alleles(m,p) >= 2
rule informative(m,p): polymorphic(m,p) AND passes_quality_threshold(m,p)
rule linked_markers(a,b): same_chromosome(a,b) AND linkage_evidence(a,b)
# 07 OPERATIONAL FLOWS
flow "MarkerRegistration":
input: marker, assembly, coordinate, alleles, evidence
require: identifier_present(marker) AND coordinate_convention_explicit
validate: assembly_compatibility AND allele_normalisation
emit: registered_marker WITH provenance
flow "GenotypeInterpretation":
input: marker, sample, assay_result, quality_metrics
require: assay_result.references(marker)
evaluate: read_depth, call_confidence, contamination, ploidy, missingness
if: quality_metrics below validated_threshold
emit: NO_CALL WITH reasons
else:
emit: GenotypeCall WITH confidence AND evidence
flow "MarkerComparison":
input: marker_a, marker_b
normalise: assembly, coordinate_convention, allele_orientation, variant_representation
if: incompatible_reference_context
emit: INDETERMINATE
else:
compare: locus, alleles, variant_type
emit: SAME | OVERLAPPING | DISTINCT | INDETERMINATE
flow "PopulationMarkerAnalysis":
input: genotype_calls, population, sampling_metadata
validate: consent_scope, sample_quality, population_definition
compute: allele_frequencies, heterozygosity, missingness
flag: population_structure, ascertainment_bias, relatedness
emit: estimates WITH uncertainty AND provenance
# 08 REASONING AND INFERENCE
rule R01: located_at(m,l) AND has_coordinate(l,c) => genomic_position(m,c)
rule R02: calls_marker(g,m) AND observed_in(g,s) => observed_marker_in_sample(m,s)
rule R03: tags_haplotype(m,h) => statistical_tag(m,h), NOT identity(m,h)
rule R04: associated_with(m,t) => candidate_association(m,t), NOT causal_effect(m,t)
rule R05: same_coordinates(a,b) AND same_assembly(a,b) !=> equivalent_marker(a,b)
rule R06: equivalent_marker(a,b) REQUIRES normalised_alleles(a,b) AND compatible_variant_representation(a,b)
rule R07: low_quality(g) => reduce_confidence(g)
rule R08: different_assemblies(a,b) => require_liftover_validation(a,b)
# 09 RECURSIVE REASONING
recursive "MarkerEvidenceTraversal"(marker,visited):
stop_if: marker IN visited
append: marker TO visited
gather: assay_evidence(marker), validation_records(marker), reference_context(marker)
traverse: related_markers(marker) EXCLUDING visited
aggregate: evidence WITH source_independence AND uncertainty
return: auditable_marker_context
recursive "HaplotypeContext"(marker,depth):
stop_if: depth <= 0 OR no_linkage_evidence(marker)
expand: linked_markers(marker)
require: population_context AND recombination_context
return: probabilistic_haplotype_support, NOT deterministic_identity
# 10 CONFIDENCE
CONFIDENCE:
scale: [0.0,1.0]
components: [assay_quality, genotype_quality, reference_match, validation_strength, evidence_independence]
aggregate: calibrated_model(components)
rule: missing_evidence != negative_evidence
rule: correlated_sources must not be counted as independent
output: score, calibration_version, uncertainty_interval, limitations
# 11 SEMANTIC_EQUIVALENCE
SEMANTIC_EQUIVALENCE:
exact: matching_normalised_variant AND matching_reference_assembly AND matching_alleles
contextual: validated_cross_assembly_mapping AND matching_biological_variant
related: overlapping_locus OR linkage_disequilibrium OR shared_marker_class
prohibited: infer_equivalence_from_label_alone
prohibited: infer_equivalence_from_coordinate_alone
note: rs identifiers may merge or be retired; maintain identifier history
# 12 FLOW_HASH
FLOW_HASH:
algorithm: SHA-256
canonicalisation: UTF-8; Unicode NFC; stable field order; explicit nulls
scope: ontology_version + canonical_entities + canonical_relations + rules + constraints
exclude: transient_execution_timestamps
output: deterministic_digest
note: hash is computed by implementation, not preassigned
# 13 UPDATE_MODEL
UPDATE_MODEL:
trigger: reference_assembly_update | marker_remapping | new_validation | allele_revision | ontology_revision
steps:
- record prior version and provenance
- validate reference and coordinate transformations
- recalculate affected classifications and equivalence assertions
- preserve historic identifiers and mappings
- regenerate FLOW_HASH
- publish change_log and rollback_reference
invariant: historical evidence remains traceable
# 14 AI_CONSUMPTION
AI_CONSUMPTION:
representation: typed_knowledge_graph
formats: [TXT,JSON-LD,RDF]
required: [id,type,reference_context,relations,provenance,confidence]
reasoning_mode: evidence_aware, uncertainty_preserving
safeguards:
- do not infer identity, ancestry, disease or causality from a marker alone
- distinguish population-level association from individual prediction
- respect genomic privacy and consent boundaries
- report unresolved reference assemblies and ambiguous mappings
output: explainable_assertions WITH traceable_evidence
# 15 EXAMPLE
example:
marker: GM_EXAMPLE_001
marker_type: SNP
assembly: GRCh38
contig: chr1
coordinate: unspecified
alleles: unspecified
interpretation: illustrative schema instance only, not a real variant
confidence: unassigned
# 16 VALIDATION TESTS
test V01: reject marker coordinate lacking assembly
test V02: reject inconsistent coordinate convention
test V03: do not equate two markers solely by matching labels
test V04: preserve NO_CALL for insufficient quality
test V05: association inference never implies causation
test V06: stable canonical content yields stable FLOW_HASH
test V07: recursive traversal terminates on visited node
test V08: every genotype call retains assay provenance
# 17 ONTOLOGY CONNECTIONS
parent: Genetic Entity Ontology
related: Genome Ontology, Gene Ontology, Allele Ontology, Locus Ontology
related: Chromosome Ontology, DNA Ontology, Nucleotide Ontology
related: Base Pair Ontology, Genetic Variation, Population Genetics
# END FLOW ALGEBRA
Download Code
Copy to Clipboard