Appariement multimodal et prédiction de la réponse aux perturbations avec le transport optimal de Gromov-Wasserstein étiqueté.
├── .gitignore
├── README.md
├── perturbot
│ ├── cv # Cross-validation experiments
│ └── perturbot
│ ├── match
│ │ ├── ot_labels.py # Label-constrained Entropic Optimal Transport
│ │ ├── ott_egwl.py # Label-constrained Entropic Gromov-Wasserstein
│ │ ├── cot_labels.py # Label-constrained Co-OT (Redko et al., 2020)
│ │ └── cot_feature.py # Feature-feature OT based on Co-OT concept
│ ├── predict
│ └── eval
├── scvi-tools # forked `scvi-tools` with label adaptation
└── ott # forked `ott` with label adaptation
perturbot/
utilise les sous-modules scvi-tools
et ott
modifiés qui peuvent être installés avec pip install
.
cd scvi-tools/
pip install .
cd ../ott/
pip install .
cd ../perturbot
pip install .
import numpy as np
from sklearn . decomposition import PCA
from perturbot . match import (
get_coupling_cotl ,
get_coupling_cotl_sinkhorn ,
get_coupling_egw_labels_ott ,
get_coupling_egw_all_ott ,
get_coupling_eot_ott ,
get_coupling_leot_ott ,
get_coupling_egw_ott ,
get_coupling_cot ,
get_coupling_cot_sinkhorn ,
get_coupling_gw_labels ,
get_coupling_fot ,
)
from perturbot . predict import train_mlp
# Generate data
n_samples = 300
labels = [ 0 , 1 , 2 , 3 ]
X_dict = { k : np . random . rand ( n_samples , 1000 ) for k in labels }
Y_dict = { k : np . random . rand ( n_samples , 2000 ) for k in labels }
pca = PCA ( n_components = 50 )
X_reduced = { k : pca . fit_transform ( X_dict [ k ]) for k in labels }
Y_reduced = { k : pca . fit_transform ( Y_dict [ k ]) for k in labels }
# Learn matching in the latent space
T_dict , log = get_coupling_egw_labels_ott (( X_reduced , Y_reduced )) # Other get_coupling_X methods be used
# Train MLP based on matching
model , pred_log = train_mlp (( X_dict , Y_dict ), T_dict )
# Learn feature-feature matching
T_feature , fm_log = get_coupling_fot (( X_dict , Y_dict ), T_dict )
Voir la documentation et le manuscrit pour plus de détails.
Veuillez soumettre vos problèmes ou contacter [email protected].
Jayoung Ryu, Romain Lopez et Charlotte Bunne
Si vous avez utilisé Perturb-OT pour votre travail, veuillez citer :
@misc{ryu2024crossmodality,
title={Cross-modality Matching and Prediction of Perturbation Responses with Labeled Gromov-Wasserstein Optimal Transport},
author={Jayoung Ryu and Romain Lopez and Charlotte Bunne and Aviv Regev},
year={2024},
eprint={2405.00838},
archivePrefix={arXiv},
primaryClass={q-bio.GN}
}