๐ฆ Squidiff Reproducibility (Code + Processed Dataset)
English | ็ฎไฝไธญๆ
This repository is a comprehensive, ready-to-use replication bundle for Squidiff. It contains annotated replication Jupyter notebooks alongside all the heavily processed intermediate .h5ad matrices (approx 22.8 GB in total) required to seamlessly reproduce the figures and model results without wrestling with data wrangling.
Note: This repository is cloned and extended from the official Squidiff reproducibility repo. We provide critical bug fixes (e.g., filepath alignments in Fig 2), in-depth notebook annotations, a reimplemented
plot_util.py(missing from the original repo), and most importantly, the fully processed datasets bundled locally so that reviewers or researchers can achieve "plug-and-play" execution.
๐ Repository Structure
Notebooks are organized by figure/experiment into numbered directories:
Squidiff_reproducibility/
โโโ 01_fig2_differentiation/ # Fig 2: iPSC โ Endoderm differentiation
โ โโโ 01.1_preprocess_fig2_data.ipynb # Data preprocessing + UMAP
โ โโโ 01.2_prep_diff_data.ipynb # Differentiation data preparation
โ โโโ 01.3_squidiff_on_differentiation.ipynb # Squidiff prediction
โ โโโ 01.4_scgen_comparison.ipynb # scGen baseline comparison
โโโ 02_fig3_gene_perturbation/ # Fig 3a-c: K562 gene perturbation
โ โโโ 02.1_prep_pertb_data.ipynb # Data preprocessing
โ โโโ 02.2_squidiff_on_genepertb.ipynb# Squidiff prediction
โ โโโ pertb_2genes/ # Trained checkpoints
โโโ 03_fig4_drug_response/ # Fig 3d-i & Fig 4-6: Drug & BVO
โ โโโ 03.1_prep_drug_screen_data.ipynb# GBM drug screen preprocessing
โ โโโ 03.2_prep_sciplex_data.ipynb # sci-Plex3 preprocessing
โ โโโ 03.3_prep_double_drug_data.ipynb# Drug combination data preparation
โ โโโ 03.4_squidiff_on_sciplex.ipynb # Unseen drug prediction
โ โโโ 03.5_squidiff_on_combdrug.ipynb # Drug combination prediction
โ โโโ 03.6_fig4_VO_reproducibility.ipynb # BVO + Irradiation + G-CSF
โโโ 04_supplementary/ # Fig 1 & supplementary experiments
โ โโโ 04.1_prep_simu_data.ipynb # Splatter synthetic data
โ โโโ 04.2_squidiff_on_simulated_data.ipynb # Synthetic validation
โ โโโ 04.3_squidiff_on_gbm.ipynb # GBM drug response
โโโ data/ # Processed train/test h5ad (~24 MB)
โโโ datasets/ # Raw / downloaded datasets (~10 GB)
โโโ checkpoints/ # Trained model checkpoints
โโโ training_logs/ # Training logs & optimization states
โโโ results/ # Reproduced figures & metrics
โโโ scripts/ # Utility scripts
โ โโโ data_prep/ # Data conversion utilities
โ โโโ check_data_status.py # Data availability checker
โ โโโ convert_geo_to_h5ad.py # Multi-platform GEO converter
โ โโโ convert_series_matrix_to_h5ad.py # Single-file converter
โ โโโ convert_to_h5ad_v3.py # Manual regex-based parser
โ โโโ simple_geo_to_h5ad.py # Simplified pandas converter
โ โโโ README.md # Data prep guide
โโโ utils/ # Shared utilities
โ โโโ plot_util.py # Plotting functions (reimplemented)
โโโ assets/ # Original paper figures for reference
โโโ README.md # This file
โโโ CLAUDE.md # Development workflow guide
โโโ REPRODUCTION_OVERVIEW.md # Detailed reproduction guide (ไธญๆ)
๐ Dataset Overview per Figure
| Figure | Experiment Focus | Data Location | Notebooks |
|---|---|---|---|
| Fig 1 | Splatter Synthetic Data | Generated in notebook | 04_supplementary/04.1_prep_simu_data.ipynb โ 04_supplementary/04.2_squidiff_on_simulated_data.ipynb |
| Fig 2 | iPSCโEndoderm Differentiation | datasets/ipsc_diff/, data/processed/ |
01_fig2_differentiation/01.1_preprocess_fig2_data.ipynb โ 01_fig2_differentiation/01.3_squidiff_on_differentiation.ipynb |
| Fig 3a-c | K562 Gene Perturbations | datasets/gears_*.h5ad |
02_fig3_gene_perturbation/02.1_prep_pertb_data.ipynb โ 02_fig3_gene_perturbation/02.2_squidiff_on_genepertb.ipynb |
| Fig 3d-g | GBM Drug Screening | Preprocessed via notebook | 03_fig4_drug_response/03.1_prep_drug_screen_data.ipynb โ 04_supplementary/04.3_squidiff_on_gbm.ipynb |
| Fig 3h-i | sci-Plex Unseen Drug | Preprocessed via notebook | 03_fig4_drug_response/03.2_prep_sciplex_data.ipynb โ 03_fig4_drug_response/03.4_squidiff_on_sciplex.ipynb |
| Fig 4-6 | BVO Differentiation & Irradiation | Complex diff trajectories | 03_fig4_drug_response/03.6_fig4_VO_reproducibility.ipynb |
โญ Beyond the Official Repo: Baseline Comparisons
This repository goes beyond a simple replication โ we independently implemented and trained baseline models that the original authors compared against but did not include code for:
Fig 2 โ scGen Baseline (iPSC Differentiation)
The original paper shows Squidiff vs scGen in Fig 2g, but provides no scGen training code. We:
- Reimplemented the full scGen VAE in PyTorch (
scgen_baseline.py), faithfully matching the official architecture (Lotfollahi et al., 2019) - Trained scGen on the same iPSC differentiation data and generated comparable scatter plots + Pearson R metrics
- See
01_fig2_differentiation/01.4_scgen_comparison.ipynband output inresults/fig2/
Fig 3 โ GEARS & scGen Baselines (Gene Perturbation)
For the K562 gene perturbation task, we additionally trained:
- GEARS (Roohani et al., 2023) on the same Norman et al. dataset โ checkpoint in
02_fig3_gene_perturbation/gears/ - scGen with latent arithmetic for double-gene perturbation prediction โ checkpoint in
02_fig3_gene_perturbation/scgen_model_perturb_prediction.pt/ - All three models (Squidiff, GEARS, scGen) are compared on the same held-out test set within
02_fig3_gene_perturbation/02.2_squidiff_on_genepertb.ipynb
๐ How to Use This Repository
Option 1: Full Clone for Local Execution
Ensure you have git-lfs installed, then clone via the HuggingFace CLI:
# Clone the full repository (~22.8 GB) to your local server
git clone https://huggingface.co/datasets/zyzhou110/Squidiff_reproducibility
cd Squidiff_reproducibility
Once downloaded, activate your Conda environment and run the Jupyter notebooks in each numbered directory sequentially.
Data Preparation (if starting from raw GEO data)
If you need to download and convert raw GEO data:
# Check which datasets are available
python3 scripts/data_prep/check_data_status.py
# Convert downloaded GEO series matrix to AnnData format
python3 scripts/data_prep/convert_series_matrix_to_h5ad.py
See scripts/data_prep/README.md for detailed data conversion options and troubleshooting.
Option 2: Loading Data via Hugging Face datasets
from datasets import load_dataset
dataset = load_dataset("zyzhou110/Squidiff_reproducibility")
๐ Acknowledgements
Original model weights and raw sequencing codes were derived from the original authors (Squidiff). If you utilize this curated layout or the dataset, please cite the parent paper and reference this extended integration. For inquiries about the core algorithms, please check out the official Figshare.
- Downloads last month
- 272