xchrom.tl.crosssamples_aucprc
- xchrom.tl.crosssamples_aucprc(cell_embedding_ad: str | Path | AnnData, input_folder: str | Path = './test_data', output_path: str | Path = './eval_out', model_path: str | Path = './train_out/E1000best_model.h5', cellembed_raw: str = 'X_pca_harmony', save_pred: bool = False, scatter_plot: bool = False) dict[source]
Evaluate the performance in cross-samples scenario, calculate auROC & auPRC for overall, per-cell and per-peak.
- Parameters:
cell_embedding_ad (str or Path or anndata.AnnData) – Path to the cell embedding adata file. provide cell input embedding for XChrom model prediction.
input_folder (str or Path) – Path to the test data folder. Should generate by XChrom_preprocess.py. Must contain ‘splits.h5’, ‘ad.h5ad’, ‘all_seqs.h5’.
output_path (str or Path) – Path to the output folder.
model_path (str or Path) – Path to the trained model.
cellembed_raw (str) – Key of the raw cell input embedding in the cell embedding adata,to generate model input.
save_pred (bool) – Whether to save the prediction matrix with npy format.
scatter_plot (bool) – Whether to plot the UMAP of the test cells.
- Returns:
metrics – Dictionary containing overall auROC, per-cell auROC, per-peak auROC, overall auPRC, per-cell auPRC, per-peak auPRC.
- Return type:
dict
Examples
>>> import xchrom as xc metrics1 = xc.tl.crosssamples_aucprc( cell_embedding_ad='./data/2_cross_samples/test_rna_harmony.h5ad', input_folder='./data/2_cross_samples/test_data', model_path='./data/2_cross_samples/train_out/E1000best_model.h5', output_path='./data/2_cross_samples/eval_out', cellembed_raw='X_pca_harmony', save_pred=True, scatter_plot=True )