Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ backend_mkl_system = ["dep:ndarray-linalg", "ndarray-linalg/intel-mkl-system"]
backend_faer = ["dep:faer"]
faer_links_ndarray_static_openblas = ["backend_faer", "backend_openblas"]

eigensnp = [] # Requires nightly Rust

# --- Utility Features ---
jemalloc = ["dep:jemalloc-ctl"]
enable-eigensnp-diagnostics = []
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,16 @@ Loads a PCA model from a file previously saved with `save_model`. The loaded mod

EigenSNP is a sophisticated Principal Component Analysis algorithm specifically designed for large-scale genomic datasets, such as those found in biobanks or population-scale studies. It efficiently handles datasets where the number of SNPs (features) significantly exceeds the number of samples.

To use EigenSNP, enable the `eigensnp` feature in your `Cargo.toml` (note that this currently requires the use of nightly Rust):
```toml
[dependencies]
efficient_pca = { version = "*", features = ["eigensnp"] }
```

### Key Features

* 🧬 **Genomic-Optimized**: Designed for SNP data with linkage disequilibrium (LD) block structure
* ⚡ **Scalable**: Uses randomized SVD (RSVD) and memory-efficient f32 precision for large datasets
* ⚡ **Scalable**: Uses randomized SVD (RSVD) and memory-efficient f32 precision for large datasets
* 🔧 **Highly Configurable**: Extensive tuning parameters for different dataset characteristics
* 📊 **Multi-Stage Algorithm**: Local eigenSNP basis learning → condensed features → global PCA → refinement
* 🔍 **Diagnostics**: Optional detailed diagnostics for algorithm analysis (with feature flag)
Expand Down
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
#![feature(portable_simd)]
#![cfg_attr(feature = "eigensnp", feature(portable_simd))]
#![doc = include_str!("../README.md")] // Crate-level documentation

pub mod diagnostics;
pub mod eigensnp;
pub mod linalg_backends; // Consolidated module
pub mod pca;

#[cfg(feature = "eigensnp")]
pub mod eigensnp;

#[cfg(feature = "enable-eigensnp-diagnostics")]
pub mod eigensnp_tests;

pub use pca::PCA;

// Re-export key items from the eigensnp module for users of the EigenSNP functionality.
#[cfg(feature = "eigensnp")]
pub use eigensnp::{
CondensedFeatureId, EigenSNPCoreAlgorithm, EigenSNPCoreAlgorithmConfig, EigenSNPCoreOutput,
LdBlockListId, LdBlockSpecification, PcaReadyGenotypeAccessor, PcaSnpId, PrincipalComponentId,
Expand Down
Loading