Skip to main content

joaju_pedigree/
lib.rs

1//! # joaju-pedigree
2//!
3//! A high-performance Rust library for pedigree modeling, kinship calculation,
4//! and clinical pedigree rendering conforming to NSGC/ACMG guidelines.
5//!
6//! > ⚠️ **Early Development Notice (pre-1.0 / alpha)**: This library is currently in early
7//! > active development (`0.1.0`). It is NOT recommended for production use beyond experimental
8//! > testing and research. APIs are subject to breaking changes prior to a stable 1.0.0 release.
9//!
10//! ## Quick Example
11//!
12//! ```rust
13//! use joaju_pedigree::prelude::*;
14//!
15//! let ped = Ped::nuclear(2).unwrap();
16//! assert_eq!(ped.len(), 4);
17//!
18//! let kin = KinshipMatrix::compute(&ped);
19//! assert!((kin.get("1", "3").unwrap() - 0.25).abs() < 1e-6);
20//! ```
21
22pub mod core;
23pub mod genetics;
24pub mod graph;
25pub mod kinship;
26pub mod layout;
27pub mod prelude;
28pub mod render;
29
30pub use crate::core::{
31    AdoptionType, ChildlessType, Individual, Ped, PregnancyLossType, Sex, Status, TwinType,
32};
33pub use crate::genetics::{Genotype, Marker, MendelianError};
34pub use crate::graph::{
35    break_loops, find_inbreeding_loops, has_inbreeding_loops, peeling_order, InbreedingLoop,
36    LoopBreaker,
37};
38pub use crate::kinship::{compute_kinship_matrix, KinshipMatrix};
39pub use crate::layout::{LayoutOptions, PedLayout};
40pub use crate::render::{render_svg, ClinicalSymbol, RenderOptions};
41
42pub fn version() -> &'static str {
43    env!("CARGO_PKG_VERSION")
44}
45
46#[cfg(test)]
47mod tests {
48    use super::*;
49
50    #[test]
51    fn test_pedigree_rs_version() {
52        assert!(!version().is_empty());
53    }
54}