FLOW ALGEBRA
TITLE: Protein Ontology
VERSION: 1.0
DOMAIN: Biological Entities / Macromolecular Entities
SOURCE: https://kirethresearch.org/booksai-core/entity-graph/biological-entities/macromolecular-entities/protein-ontology-2.html
AUTHORS: Mark Anthony Higgins — Sky (Recursive AI)
STATUS: Companion formalisation; declarative specification, not a verified executable program.
1. PURPOSE
Represent proteins as typed biological macromolecular entities, preserving sequence, structure, function, context, evidence, uncertainty and provenance in a recursively traversable knowledge graph.
2. ENTITY TYPES
ENTITY Protein <: BiologicalMacromolecule
ENTITY Polypeptide <: Polymer
ENTITY AminoAcid <: MolecularBuildingBlock
ENTITY Residue <: PolymerComponent
ENTITY PeptideBond <: CovalentBond
ENTITY ProteinSequence <: OrderedSequence
ENTITY ProteinDomain <: StructuralFunctionalRegion
ENTITY ProteinMotif <: SequenceOrStructurePattern
ENTITY ProteinStructure <: MolecularConformation
ENTITY ProteinComplex <: MolecularAssembly
ENTITY ProteinIsoform <: ProteinVariant
ENTITY ProteinModification <: MolecularModification
ENTITY ProteinFunction <: BiologicalFunction
ENTITY ProteinInteraction <: BiologicalInteraction
ENTITY ProteinEvidence <: EvidenceRecord
ENTITY ProteinContext <: BiologicalContext
ENTITY ProteinIdentifier <: Identifier
ENTITY ProteinState <: ContextualState
3. TYPED RELATIONSHIPS
RELATION has_sequence(Protein, ProteinSequence)
RELATION consists_of(Polypeptide, Residue)
RELATION adjacent_residues(Residue, Residue)
RELATION linked_by(Residue, Residue, PeptideBond)
RELATION has_domain(Protein, ProteinDomain)
RELATION has_motif(Protein, ProteinMotif)
RELATION adopts_structure(Protein, ProteinStructure, ProteinContext)
RELATION participates_in_complex(Protein, ProteinComplex)
RELATION has_isoform(Protein, ProteinIsoform)
RELATION undergoes_modification(Protein, ProteinModification)
RELATION enables_function(Protein, ProteinFunction, ProteinContext)
RELATION interacts_with(Protein, BiologicalEntity, ProteinContext)
RELATION supported_by(Assertion, ProteinEvidence)
RELATION observed_in(Assertion, ProteinContext)
RELATION identified_by(Protein, ProteinIdentifier)
RELATION has_state(Protein, ProteinState, ProteinContext)
4. COMPOSITION AND SEQUENCE
RULE sequence_order:
has_sequence(p,s) AND residue_at(s,i,r1) AND residue_at(s,i+1,r2)
-> adjacent_residues(r1,r2).
RULE peptide_backbone:
linked_by(r1,r2,PeptideBond) -> covalently_connected(r1,r2).
CONSTRAINT sequence_indices_are_unique_within_sequence.
CONSTRAINT residues_have_valid_amino_acid_or_explicit_noncanonical_identity.
NOTE: A protein may contain multiple polypeptide chains; not every protein is a single chain.
5. STRUCTURAL LEVELS
LEVEL primary: ordered residue sequence and covalent connectivity.
LEVEL secondary: local structural patterns such as alpha helices and beta sheets.
LEVEL tertiary: three-dimensional organisation of an individual chain.
LEVEL quaternary: arrangement of multiple chains in an assembly, where applicable.
RULE structural_context:
adopts_structure(p,s,c) -> structure_depends_on_context(s,c).
CONSTRAINT predicted_structure != experimentally_confirmed_structure.
CONSTRAINT structural_similarity != identity_of_protein.
6. FUNCTION AND INTERACTION
FUNCTION_CLASS catalytic | binding | transport | structural | signalling | regulatory | defence | motor | other.
RULE function_evidence:
enables_function(p,f,c) AND supported_by(assertion(p,f,c),e)
-> function_annotation(p,f,c,e).
RULE complex_participation:
participates_in_complex(p,x) -> component_of(p,x).
CONSTRAINT binding_does_not_imply_catalysis.
CONSTRAINT sequence_similarity_alone_does_not_prove_shared_function.
CONSTRAINT interaction_requires_context_and_evidence_where_available.
7. MODIFICATIONS, ISOFORMS AND STATES
MODIFICATION_CLASS phosphorylation | glycosylation | acetylation | methylation | ubiquitination | proteolysis | disulfide_formation | other.
RULE modification_effect:
undergoes_modification(p,m) AND measured_effect(m,e,c)
-> contextual_effect(p,e,c).
CONSTRAINT isoform_identity != modification_state.
CONSTRAINT protein_state_may_change_over_time_without_changing_entity_identity.
8. GRAPH REASONING
GRAPH ProteinGraph = (V,E,T,P) WHERE:
V = typed entities;
E = typed directed or qualified relationships;
T = temporal/context annotations;
P = provenance and evidence annotations.
TRAVERSAL protein_to_function:
Protein -> ProteinDomain -> ProteinFunction -> BiologicalProcess.
TRAVERSAL protein_to_context:
Protein -> ProteinInteraction -> BiologicalEntity -> BiologicalContext.
RECURSION:
visit(entity,depth,visited):
IF entity IN visited OR depth <= 0 THEN STOP;
ELSE add entity to visited; follow validated typed edges with depth-1.
CONSTRAINT recursion_is_cycle_safe_and_bounded.
9. SEMANTIC_EQUIVALENCE
EQUIVALENCE_CLASS exact_identifier_match | sequence_identity | isoform_related | homologous | functionally_similar | structurally_similar.
RULE exact_identity:
same_authoritative_identifier(a,b) AND compatible_taxon_and_isoform(a,b)
-> candidate_same_entity(a,b).
CONSTRAINT homology != identity.
CONSTRAINT functional_similarity != semantic_equivalence.
CONSTRAINT orthologous_and_paralogous_are_distinct_relationships.
RULE merge:
candidate_same_entity(a,b) AND verified_identity_constraints(a,b)
-> may_merge(a,b).
10. VALIDATION
VALIDATE entity_type_consistency.
VALIDATE residue_index_and_sequence_length_consistency.
VALIDATE accession_namespace_and_taxonomic_context.
VALIDATE evidence_links_and_assertion_scope.
VALIDATE structure_method_and_confidence_annotation.
VALIDATE units_for_measurements_and_experimental_conditions.
VALIDATE no_unsupported_identity_merges.
VALIDATE graph_integrity_and_cycle_safe_traversal.
ON_FAILURE: quarantine_invalid_assertion; preserve original record and diagnostic.
11. PROVENANCE
PROVENANCE fields:
source_uri, source_record_id, evidence_type, method, publication_or_database,
observation_date, retrieval_date, curator, version, licence, context.
RULE provenance_preservation:
derived_assertion(a,inputs) -> retain_lineage(a,inputs).
CONSTRAINT no_unattributed_claim_promoted_to_verified_fact.
12. CONFIDENCE
CONFIDENCE fields: score[0,1], calibration_method, evidence_quality,
reproducibility, source_independence, uncertainty, applicability_context.
RULE confidence_aggregation:
combine_evidence_only_after_checking_dependence_and_conflicts.
CONSTRAINT confidence_is_not_truth_probability_without_calibration.
CONSTRAINT inferred_annotations_must_be_labelled_as_inferred.
13. FLOW_HASH
FLOW_HASH inputs:
canonical_entity_types, canonical_relationships, rule_versions,
ontology_version, normalisation_scheme.
RULE deterministic_hash:
FLOW_HASH = SHA256(canonical_serialisation(inputs)).
CONSTRAINT provenance_sensitive_record_hashes_are_separate_from_schema_hash.
14. UPDATE_MODEL
UPDATE_MODEL:
ingest_new_evidence -> validate -> compare_versions -> detect_conflicts
-> preserve_prior_version -> update_qualified_assertions
-> recalculate_affected_inferences -> regenerate_hashes -> publish_change_log.
CONSTRAINT revisions_are_traceable_and_reversible.
15. AI_CONSUMPTION
AI_CONSUMPTION:
expose_typed_entities: true
expose_relationship_constraints: true
preserve_context: true
preserve_provenance: true
distinguish_observed_predicted_inferred: true
refuse_unsupported_identity_merges: true
report_uncertainty: true
recursive_traversal: bounded_and_cycle_safe
output: evidence_qualified_graph_assertions
16. EXAMPLE INSTANCE
Protein P1 has_sequence S1.
S1 contains ordered residues R1,R2,R3.
P1 has_domain D1.
P1 enables_function F1 in context C1 [evidence E1].
INFERENCE: P1 may be retrieved by a query for proteins with F1 in C1.
NON-INFERENCE: P1 is not thereby proven identical to another protein with F1.
17. INTEROPERABILITY
MAP protein and gene identifiers to authoritative namespaces where available.
MAP biological functions to evidence-qualified ontology terms.
MAP experimental observations to explicit assay, organism, tissue and condition.
PRESERVE distinction between gene, transcript, polypeptide, protein and complex.
END FLOW ALGEBRA
Download Code
Copy to Clipboard