Question: How to use FindSubCluster in Seurat?
0
gravatar for Pancreas Pratik
7 days ago by
University of Connecticut
Pancreas Pratik110 wrote:

I just found the FindSubCluster tool within Seurat, and am super excited to use it. Just not sure exactly how!

The usage is here:

FindSubCluster(
  object,
  cluster,
  graph.name,
  subcluster.name = "sub.cluster",
  resolution = 0.5,
  algorithm = 1
)

I receive an error when using it.

> test <- FindSubCluster(scfp, 7, scfp, subcluster.name = "test",  resolution = 3, algorithm = 1)
Error in match(x, table, nomatch = 0L) : 
  'match' requires vector arguments
> test <- FindSubCluster(scfp, 7, scfjjd, subcluster.name = "test",  resolution = 3, algorithm = 1)
Error in `[[.Seurat`(object, graph.name) : object 'scfjjd' not found
> test <- FindSubCluster(scfp, 7, RNA, subcluster.name = "test",  resolution = 3, algorithm = 1)
Error in `[[.Seurat`(object, graph.name) : object 'RNA' not found

My object name is scfp. I have done FindClusters already. The cluster I wish to subcluster is 7.

I think my trouble is with the graph.name argument.

I tried this:

> test <- FindSubCluster(scfp, "7", "scfp", subcluster.name = "test",  resolution = 3, algorithm = 1)
Error: Cannot find 'scfp' in this Seurat object

Still no success yet...

Any help would really be appreciated!

seurat single cell rna-seq R • 101 views
ADD COMMENTlink modified 6 days ago • written 7 days ago by Pancreas Pratik110
1

I have never used that function, so I could be completely off, but have a look at FindMultiModalNeighbors. It could be similar to AddModuleScore, which computes the score and add a column (score name) to your metadata.

ADD REPLYlink modified 7 days ago • written 7 days ago by fracarb8100

Thank you @fracarb8. So I got the command to go through after this:

I went to: https://satijalab.org/seurat/articles/multimodal_reference_mapping.html

and Ctrl+F: graph.name

Turns out graph.name is an argument in FindNeighbors. So I just use the FindNeighbors command choosing graph.name as some arbitrary name (test). and then reran FindSubCluster and it worked, partially.

So it looks something like this:

scfp <- FindNeighbors(scfp, graph.name = "test", dims = 1:100)
scfp <- FindClusters(scfp, graph.name = "test", resolution = 4, algorithm = 1, verbose = TRUE)
scfp <- FindSubCluster(scfp, "5", "test", subcluster.name = "blood",  resolution = 2, algorithm = 1)
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck

Number of nodes: 93
Number of edges: 758

Running Louvain algorithm...
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Maximum modularity in 10 random starts: 0.2673
Number of communities: 8
Elapsed time: 0 seconds
1 singletons identified. 7 final clusters.

However, no success in visualizing the results via tSNE or UMAP. I tried rerunning RunTSNE, and then seeing the plot, but still no success.

ADD REPLYlink modified 6 days ago • written 6 days ago by Pancreas Pratik110
1
gravatar for Pancreas Pratik
6 days ago by
University of Connecticut
Pancreas Pratik110 wrote:

Okay so I got it... I think. I explored the Seurat object a litle bit more and found that the cluster assignments were saved. I was able to visualize using the group.by argument so here is the process:

scfp <- FindNeighbors(scfp, graph.name = "test", dims = 1:100)
scfp <- FindClusters(scfp, graph.name = "test", resolution = 2, algorithm = 1, verbose = TRUE)
scfp <- RunTSNE(scfp, dims = 1:100)
DimPlot(scfp, reduction = "tsne", label = TRUE, label.size = 6 )

enter image description here And then after doing this:

scfp <- FindSubCluster(scfp, "6", "test", subcluster.name = "blood",  resolution = 2, algorithm = 1)
DimPlot(scfp, reduction = "tsne", group.by = "blood", label = TRUE, label.size = 6)

This is the resulting tSNE:

enter image description here

Of course going to play around to optimize cluster numbers...

Thank you @fracarb8. You got me going!

ADD COMMENTlink written 6 days ago by Pancreas Pratik110
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1971 users visited in the last hour
_