About the function of CreateScRank
Hello, this is a very good software, but I encountered a problem when using it. I hope to answer it: Within the same single-cell dataset, when the drug and target are substituted with entirely distinct and unrelated entities, the identical ranked cell type emerges. Here's my codes:
###1 obj <- CreateScRank( seuratObj, cell_type = "celltype", species = "human", drug = "REGORAFENIB", target = "FRK", type = "antagonist" )
Constr_net( obj, select_ratio = 0.5, n_selection = 10, cut_ratio = 0.95, keep_ratio = 0.25, min_cells = 25, n.core = 4, n.core_cp = 4, use_py = F, env = "base" )
obj <- rank_celltype(obj) plot_dim(obj)
###2 obj <- CreateScRank( seuratObj, cell_type = "celltype", species = "human", drug = "FULVESTRANT", target = "FGFR2", type = "antagonist" )
Constr_net( obj, select_ratio = 0.5, n_selection = 10, cut_ratio = 0.95, keep_ratio = 0.25, min_cells = 25, n.core = 4, n.core_cp = 4, use_py = F, env = "base" )
obj <- rank_celltype(obj) plot_dim(obj)
The same results appeared when running ###1 and ###2 different drugs and targets
Hi @baiger1 , thanks for reporting this issue and for providing clear examples.
I’ve checked the case and confirmed that the behavior is caused by a bug in CreateScRank(). The internal step that looks up the drug target based on the provided drug name used an incorrect filtering logic, which caused any input drug to return the same target "ALDH2". This explains why different settings ended up producing identical ranked cell types.
To help you quickly resolve this issue, I recommend the following adjustments to your workflow:
-
Avoid supplying the drug name in CreateScRank()
For reproducibility and precise control, it’s better to specify the target gene(s) directly:
obj <- CreateScRank( seuratObj, cell_type = "celltype", species = "human", type = "antagonist", target = "FRK" # or c("FGFR2", "FRK") if you want to test multiple targets later )This ensures the target(s) are correctly included during network construction.
-
Specify the target at the ranking step
You can then evaluate different targets without rebuilding the network:
obj_FRK <- rank_celltype(obj, perturbed_target = "FRK") obj_FGFR2 <- rank_celltype(obj, perturbed_target = "FGFR2")
Thank you very much for your reply. I will continue to perform my analysis according to your suggestions.
你好,感谢你报告这个问题并提供了清晰的例子。
我检查了案例,确认该行为是由 中的一个错误引起的。基于药物名称查找药物靶点的内部步骤使用了错误的过滤逻辑,导致任何输入药物都返回了相同的目标“ALDH2”。这解释了为什么不同设置最终产生了相同的排名细胞类型。
CreateScRank()为了帮助你快速解决这个问题,我建议你对工作流程进行以下调整:
避免在 CreateScRank() 中提供药品名称 为了提高重复性和精确控制,最好直接指定目标基因: obj <- CreateScRank( seuratObj, cell_type = "celltype", species = "human", type = "antagonist", target = "FRK" # or c("FGFR2", "FRK") if you want to test multiple targets later )
这确保了在网络建设过程中正确包含目标。
在排名步骤指定目标 然后你可以在不重建网络的情况下评估不同的目标: obj_FRK <- rank_celltype(obj, perturbed_target = "FRK") obj_FGFR2 <- rank_celltype(obj, perturbed_target = "FGFR2")
Thank you very much for your reply. I will continue to perform my analysis according to your suggestions.