IsoGraph v0.1.5 — Residualization Safety and Stability Improvements
IsoGraph v0.1.5 corrects how residualized data are retained by the VAE backend, preventing covariates from being removed twice in downstream analyses. The release also adds residualization quality-control metrics and clearer warnings when requested covariates cannot be used.
Changed
-
Residualization is now a discovery-only setting for the
vaebackend. VAE embedding and Leiden clustering continue to use the residualized matrix, so module discovery is unchanged for a fixed covariate set. However,FitArtifacts.feature_scoresnow retains the raw, pre-residualization values fromswitch_matrix_raw.Previously,
feature_scorescontained residualized values. Downstream models that adjusted for the same covariates could therefore remove those effects a second time.Module eigengenes and
traits.parquetare now calculated from the raw feature values. The built-in trait test is not covariate-adjusted; covariates should be applied once in the user’s downstream association model.The
baseline,graph,latent, andwgcnabackends are unchanged and continue to retain the residualized matrix.
Added
-
Residualization quality control through
FitArtifacts.residualization_qc. For each feature, the VAE backend now reports:var_beforevar_aftervar_retained_fracconfound_r2_beforeconfound_r2_after
These metrics are joined to the available feature identifiers. A successful residualization should reduce
confound_r2_aftertoward zero, whilevar_retained_fracindicates how much feature variance was preserved.The table is generated by
residualization_qc()infeatures/residualize.pywhenever at least one usable covariate is resolved. It is available through the Python API but is not currently written to disk byisograph fit.
Fixed
-
Improved validation of residualization covariates.
build_design_matrixnow emits aRuntimeWarningwhen an entry inresidualize_covariates:- is missing from the sample table;
- contains a constant numeric value; or
- is a categorical variable with only one observed level.
Constant and single-level covariates are excluded from the design matrix rather than silently producing no adjustment or introducing rank-deficient columns.
-
Improved VAE stability, Leiden determinism, feature estimability, and loading calculations.
-
Fixed Leiden giant-component capping and collapse behavior.
-
Improved promotion of estimability from single latent representations.
-
Fixed trait-analysis
KeyErrorand sign-stability issues. -
Cleaned up
fit.yamland corrected the package__version__mismatch. -
Synchronized the documentation and Read the Docs content with the current release.
Pull Requests
- [#15](#15) VAE stability, Leiden determinism, and estimability/loading features
- [#16](#16) Fix Leiden collapse and giant-component cap behavior
- [#17](#17) Promote single-representation estimability
- [#18](#18) Fix trait
KeyErrorand sign stability - [#19](#19) Clean up
fit.yamland fix__version__mismatch - [#20](#20) Synchronize documentation and Read the Docs
Full Changelog: v0.1.4...v0.1.5