CytoTRACE:细胞轨迹重建和推理#
CytoTRACE是一种用于从单细胞转录组学数据推断细胞分化状态的计算方法。它不需要先前的细胞轨迹信息,而是仅从基因表达数据推断细胞状态的有序排序。
import omicverse as ovov.plot_set()
____ _ _ __
/ __ \____ ___ (_)___| | / /__ _____________
/ / / / __ `__ \/ / ___/ | / / _ \/ ___/ ___/ _ \
/ /_/ / / / / / / / /__ | |/ / __/ / (__ ) __/
\____/_/ /_/ /_/_/\___/ |___/\___/_/ /____/\___/
Version: 1.6.3, Tutorials: https://omicverse.readthedocs.io/
CytoTRACE简介#
CytoTRACE代表细胞轨迹重建评估和聚类。它基于这样的观察:分化过程中的细胞显示出一种特征性的基因表达模式变化。
import scvelo as scvadata=scv.datasets.dentategyrus()adata
AnnData object with n_obs × n_vars = 2930 × 13913
obs: 'clusters', 'age(days)', 'clusters_enlarged'
uns: 'clusters_colors'
obsm: 'X_umap'
layers: 'ambiguous', 'spliced', 'unspliced'
%%timeadata=ov.pp.preprocess(adata,mode='shiftlog|pearson',n_HVGs=2000,)adata
Begin robust gene identification
After filtration, 13264/13913 genes are kept. Among 13264 genes, 13189 genes are robust.
End of robust gene identification.
Begin size normalization: shiftlog and HVGs selection pearson
normalizing counts per cell. The following highly-expressed genes are not considered during normalization factor computation:
['Hba-a1', 'Malat1', 'Ptgds', 'Hbb-bt']
finished (0:00:00)
extracting highly variable genes
--> added
'highly_variable', boolean vector (adata.var)
'highly_variable_rank', float vector (adata.var)
'highly_variable_nbatches', int vector (adata.var)
'highly_variable_intersection', boolean vector (adata.var)
'means', float vector (adata.var)
'variances', float vector (adata.var)
'residual_variances', float vector (adata.var)
Time to analyze data in cpu: 1.5829088687896729 seconds.
End of size normalization: shiftlog and HVGs selection pearson
CPU times: user 2.18 s, sys: 142 ms, total: 2.33 s
Wall time: 1.71 s
AnnData object with n_obs × n_vars = 2930 × 13189
obs: 'clusters', 'age(days)', 'clusters_enlarged'
var: 'n_cells', 'percent_cells', 'robust', 'mean', 'var', 'residual_variances', 'highly_variable_rank', 'highly_variable_features'
uns: 'clusters_colors', 'log1p', 'hvg'
obsm: 'X_umap'
layers: 'ambiguous', 'spliced', 'unspliced', 'counts'
使用OmicVerse进行CytoTRACE分析#
在OmicVerse中,我们提供了CytoTRACE的简化实现。
results = ov.single.cytotrace2(adata, use_model_dir="cymodels/5_models_weights", species="mouse", batch_size = 10000, smooth_batch_size = 1000, disable_parallelization = False, max_cores = None, max_pcs = 200, seed = 14, output_dir = 'cytotrace2_results')
cytotrace2: Input parameters
Species: mouse
Parallelization enabled: True
User-provided limit for number of cores to use: None
Batch size: 10000
Smoothing batch size: 1000
Max PCs: 200
Seed: 14
Output directory: cytotrace2_results
cytotrace2: Dataset characteristics
Number of input genes: 13189
Number of input cells: 2930
cytotrace2: The passed batch_size is greater than the number of cells in the subsample.
Now setting batch_size to 2930.
cytotrace2: Preprocessing
cytotrace2: 12 cores detected
cytotrace2: Running 1 prediction batch(es) in parallel using 10 cores for smoothing per batch.
cytotrace2: Initiated processing batch 1/1 with 2930 cells
11276 input genes are present in the model features.
computing PCA
with n_comps=200
finished (0:00:04)
cytotrace2: Results saved to adata.obs
CytoTRACE2_Score: CytoTRACE2 score
CytoTRACE2_Potency: CytoTRACE2 potency
CytoTRACE2_Relative: CytoTRACE2 relative score
preKNN_CytoTRACE2_Score: CytoTRACE2 score before kNN smoothing
preKNN_CytoTRACE2_Potency: CytoTRACE2 potency before kNN smoothing
cytotrace2: Finished.
解释CytoTRACE分数#
CytoTRACE为每个细胞分配一个分数,反映其在分化轨迹上的位置。
可视化CytoTRACE结果#
我们可以在多种降维方法中可视化CytoTRACE分数。
CytoTRACE在不同细胞类型中的应用#
CytoTRACE已成功应用于各种细胞类型和组织的分析。