| Crates.io | infer_sex |
| lib.rs | infer_sex |
| version | 0.1.2 |
| created_at | 2026-01-05 21:51:16.697381+00 |
| updated_at | 2026-01-25 02:09:06.974439+00 |
| description | A high-performance, zero-dependency Rust library for inferring sex from variant data. |
| homepage | |
| repository | https://docs.rs/infer_sex/latest/ |
| max_upload_size | |
| id | 2024636 |
| size | 5,840,977 |
A high-performance, zero-dependency Rust library for classifying samples based on sex chromosome characteristics from summarized variant data.
This library uses a multi-pronged algorithm based on chromosome biology. It operates on an iterator of VariantInfo structs in a single pass, ensuring minimal memory usage and high throughput.
The core of the library is the SexInferenceAccumulator, a state machine that you feed variant data into to receive a classification and a detailed evidence report.
EvidenceReport showing the result of each internal check.The primary workflow involves creating a SexInferenceAccumulator, processing VariantInfo structs from your data source (e.g., a VCF file), and finalizing the analysis to get a result.
let mut accumulator = SexInferenceAccumulator::new(config);
VariantInfo structs from your data.The final classification is determined by a voting system based on four biological checks.
This algorithm has been validated on real-world microarray data.
InferenceConfig: Specifies the genome build (Build37 or Build38).VariantInfo: The input struct representing a single variant's chromosome, position, and heterozygosity.SexInferenceAccumulator: The main state machine that consumes VariantInfo structs.InferenceResult: The final output, containing the final_call (InferredSex) and the report. The call may be Indeterminate when no sex-chromosome evidence is observed.EvidenceReport: A breakdown of the results and vote from each of the internal checks.