orphos_core/algorithms/
mod.rs

1//! Core gene-finding algorithms.
2//!
3//! This module contains the fundamental algorithms used for prokaryotic gene prediction:
4//!
5//! ## Modules
6//!
7//! - [`dynamic_programming`]: Optimal gene path selection using dynamic programming
8//! - [`gene_finding`]: Gene construction and annotation from prediction nodes
9//!
10//! ## Algorithm Overview
11//!
12//! Gene prediction follows a multi-stage pipeline:
13//!
14//! 1. **Node Generation**: Identify all potential start/stop codons
15//! 2. **Node Scoring**: Calculate quality scores for each potential gene
16//!    - Coding potential (dicodon frequencies)
17//!    - Start codon preference (ATG vs GTG vs TTG)
18//!    - Ribosome binding site strength
19//!    - Upstream sequence composition
20//! 3. **Dynamic Programming**: Select optimal non-overlapping gene set
21//! 4. **Gene Refinement**: Fine-tune start positions and annotations
22//!
23//! ## Dynamic Programming
24//!
25//! The core algorithm uses dynamic programming to find the highest-scoring set
26//! of non-overlapping genes. For each position, it calculates:
27//!
28//! ```text
29//! score[i] = max(
30//!     score[i-1],                    // Skip this gene
31//!     score[j] + gene_score(j, i)    // Take this gene starting at j
32//! )
33//! ```
34//!
35//! This ensures optimal gene selection while respecting biological constraints.
36
37pub mod dynamic_programming;
38pub mod gene_finding;