Gromov-Wasserstein 최적 전송 으로 라벨링된 교란 반응의 교차 양식 일치 및 예측.
├── .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/
pip install
로 설치할 수 있는 수정된 scvi-tools
및 ott
하위 모듈을 사용합니다.
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 )
자세한 내용은 문서 및 원고를 참조하세요.
문제를 제출하거나 [email protected]로 문의하세요.
류자영, 로맹 로페즈, 샬롯 번
작업에 Perturb-OT를 사용한 경우 다음을 인용해 주세요.
@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}
}