ccAFv2分析cell cycle status

Tips:

Tip1. 當(dāng)前ccAFv2已經(jīng)有Python和R版本,本文是R版本的安裝和使用;

Tip2.ccAFv2依賴tensorflow 2.12.0,而tensorflow 2.12.0依賴python 3.9(可能3.8也可以,但3.11不行)。python 3.11會默認安裝2.19版本,ccAFv2使用時會報錯;

Tip3. ThresholdPlot() 函數(shù)得出的結(jié)果,值越大,可信度一般越高。后續(xù)如果沒指定,默認為0.5。

1. tensorflow安裝

python3.9 -m pip install tensorflow==2.12.0
install_tensorflow(
method = "auto",
version = "2.12.1",
conda_python_version = "3.9",
extra_packages = c("matplotlib", "numpy", "pandas", "scikit-learn")
)

2. ccAFv2安裝

remotes::install_github('plaisier-lab/ccafv2_R/ccAFv2')

3. ccAFv2 running

3.1 Without Neural G0

Predict cell cycle states

seurat_obj = PredictCellCycle(seurat_obj,gene_id = "symbol",assay='RNA')  ##注意參數(shù)的設(shè)置

Plot DimPlot colorized by cell cycle states

pdf('ccAFv2_DimPlot.pdf')
DimPlot.ccAFv2(seurat_obj)
dev.off()

Plot DimPlot colorized by cell cycle states

pdf('ccAFv2_ThresholdPlot.pdf')
ThresholdPlot(seurat_obj)
dev.off()

Adjust ccAFv2 threshold to 0.9

seurat_obj = AdjustCellCycleThreshold(seurat_obj, threshold=0.9)

Plot DimPlot colorized by cell cycle states

pdf('ccAFv2_DimPlot_T_0.9.pdf')
DimPlot.ccAFv2(seurat_obj)
dev.off()

Adjust ccAFv2 threshold back to 0.5

seurat_obj = AdjustCellCycleThreshold(seurat_obj, threshold=0.5)

Plot DimPlot colorized by cell cycle states

pdf('ccAFv2_DimPlot_T_0.5.pdf')
DimPlot.ccAFv2(seurat_obj)
dev.off()

3.2 With Neural G0

Predict cell cycle states

seurat_obj = PredictCellCycle(seurat_obj, include_g0=TRUE)

Plot DimPlot colorized by cell cycle states

pdf('ccAFv2_DimPlot_wNeuralG0.pdf')
DimPlot.ccAFv2(seurat_obj)
dev.off()

Plot DimPlot colorized by cell cycle states

pdf('ccAFv2_ThresholdPlot_wNeuralG0.pdf')
ThresholdPlot(seurat_obj)
dev.off()

Adjust ccAFv2 threshold to 0.9

seurat_obj = AdjustCellCycleThreshold(seurat_obj, threshold=0.9, include_g0=TRUE)

Plot DimPlot colorized by cell cycle states

pdf('ccAFv2_DimPlot_T_0.9_wNeuralG0.pdf')
DimPlot.ccAFv2(seurat_obj)
dev.off()

Adjust ccAFv2 threshold back to 0.5

seurat_obj = AdjustCellCycleThreshold(seurat_obj, threshold=0.5, include_g0=TRUE)

Plot DimPlot colorized by cell cycle states

pdf('ccAFv2_DimPlot_T_0.5_wNeuralG0.pdf')
DimPlot.ccAFv2(seurat_obj)
dev.off()

3.3 Cell cycle regression

Regress out cell cycle

seurat_obj = PrepareForCellCycleRegression(seurat_obj)
seurat_obj = SCTransform(seurat_obj, vars.to.regress = c("Late.G1_exprs1", "S_exprs2", "S.G2_exprs3", "G2.M_exprs4", "M.Early.G1_exprs5"))

Plot cell cycle regressed UMAP

seurat_obj = RunPCA(seurat_obj)
seurat_obj = RunUMAP(seurat_obj, dims=1:10)
pdf('ccAFv2_DimPlot_regressed.pdf')
DimPlot.ccAFv2(seurat_obj)
dev.off()
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容