Skip to content

PCA feature compression for organelle attribution - #10

Merged
ahillsley merged 44 commits into
mainfrom
pca_feature_compression
Mar 27, 2026
Merged

ahillsley merged 44 commits into
mainfrom
pca_feature_compression

Conversation

@gav-sturm

@gav-sturm gav-sturm commented Mar 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds per-channel and pooled (downsampled) PCA variance sweep pipeline (pca_optimization.py) to find the optimal number of PCs per biological signal using copairs mAP scoring
  • Outputs guide/gene-level h5ads at peak PCs with embeddings stored in obsm following scanpy convention (X_pca, X_umap, X_phate)
  • Adds DINO vs CellProfiler mAP comparison script (compare_dino_cp_map.py) with scatterplot + linear regression and discordant gene highlighting
  • Adds hconcat_by_perturbation and multi-level aggregation helpers to anndata_utils.py

Dependencies

Requires czbiohub-sf/ops_utils#4 to be merged to main first.

Test plan

  • Run --slurm --downsampled on DINO features, verify per-signal h5ads written to dino/per_signal/
  • Run --aggregate-only --downsampled, verify guide_pca_optimized.h5ad has obsm['X_pca'], obsm['X_umap'], obsm['X_phate']
  • Run python -m ops_utils.validation.embedding_convention guide_pca_optimized.h5ad — all checks pass
  • Run --cell-profiler --slurm --downsampled, verify outputs land in cellprofiler/
  • Run compare_dino_cp_map.py once both feature types complete

🤖 Generated with Claude Code

@gav-sturm
gav-sturm requested a review from ahillsley March 17, 2026 23:31
@ahillsley
ahillsley merged commit 57f3fca into main Mar 27, 2026
2 of 14 checks passed
@ahillsley
ahillsley deleted the pca_feature_compression branch March 27, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants