Hi, I really like scClustViz' principle of using biologically relevant parameters to help select 'best' resolution - many thanks for developing and publishing clustViz!
I'm trying to adapt the Iterative Clustering workflow code (from README.md) to an object created with Seurat v4.4
It seems there are some differences in the (default) meta.data column names in the Seurat v4 object vs the Seurat version used in the published workflow (v2?) that create problems
Changing all occurrences of your_seurat_obj@ident to your_seurat_obj@active.ident works fine for the first iteration of the while{} loop. However the following code block (not executed on the first iteration) returns an error on the second iteration:
if (length(sCVdata_list) >= 1) {
temp_cl <- length(levels(Clusters(sCVdata_list[[length(sCVdata_list)]])))
if (temp_cl == length(levels(seurat_resolution@active.ident))) { ## throws ERROR
temp_cli <- length(levels(interaction(
Clusters(sCVdata_list[[length(sCVdata_list)]]),
seurat_resolution@active.ident,
drop=T
)))
if (temp_cli == length(levels(seurat_resolution@active.ident))) {
next
}
}
At the point the error is thrown, the Seurat object's metadata slot contains:
SCT_snn_res.0.2 (resolution=0.2, created in the 1st iteration: 14 clusters in my example)
SCT_snn_res.0.4 (resolution=0.4, created in the 2nd iteration: 17 clusters in my example)
In the second line of the 'offending' codeblock (copied above), I do not understand what seurat_resolution@active.ident refers to (its original version is seurat_resolution@ident, which is similarly unclear to me)
Would you be so kind to explain the logic of the two if conditions in the code block so that I can try to find the appropriate data from the Seurat object? Or ideally, let us now which Seurat v4 data should be used ;-)
Many thanks in advance!
Hi, I really like scClustViz' principle of using biologically relevant parameters to help select 'best' resolution - many thanks for developing and publishing clustViz!
I'm trying to adapt the Iterative Clustering workflow code (from README.md) to an object created with Seurat v4.4
It seems there are some differences in the (default)
meta.datacolumn names in the Seurat v4 object vs the Seurat version used in the published workflow (v2?) that create problemsChanging all occurrences of
your_seurat_obj@identtoyour_seurat_obj@active.identworks fine for the first iteration of thewhile{}loop. However the following code block (not executed on the first iteration) returns an error on the second iteration:At the point the error is thrown, the Seurat object's metadata slot contains:
SCT_snn_res.0.2(resolution=0.2, created in the 1st iteration: 14 clusters in my example)SCT_snn_res.0.4(resolution=0.4, created in the 2nd iteration: 17 clusters in my example)In the second line of the 'offending' codeblock (copied above), I do not understand what
seurat_resolution@active.identrefers to (its original version isseurat_resolution@ident, which is similarly unclear to me)Would you be so kind to explain the logic of the two
ifconditions in the code block so that I can try to find the appropriate data from the Seurat object? Or ideally, let us now which Seurat v4 data should be used ;-)Many thanks in advance!