lazappi / clustree

Visualise Clusterings at Different Resolutions
https://lazappi.github.io/clustree/
GNU General Public License v3.0
218 stars 15 forks source link

Unconnected nodes without edges #62

Closed anos-s closed 4 years ago

anos-s commented 4 years ago

I recently got an unusual cluster output shown below: img1

Clusters 3 and 4, for instances, at resolution 0.1 have no track of what happens to these cells at higher resolution clustering. I am not using any filtering step so I don't expect the cells to be lost during clustering.

I just perform iterative clustering on the batch corrected Seurat object using the following code:

iterative_clus_by_res<-function(obj, res='',dims_use,verbose=FALSE) { if(verbose) {cat("Performing iterative clustering by resolution for PCs 1:",max(dims_use),'\n')} if(res=='') {res<-seq(0.1,1.2,by=0.1)} obj<-ScaleData(obj) obj<-RunPCA(obj, npcs=50) obj<-FindNeighbors(obj,dims=dims_use) for(i in 1:length(res)) { s.obj<-FindClusters(obj, res=res[i]) } return(obj) }

I then use clustree() on the returned object which has all the clustering info for the specified resolution in its meta.data

How do I resolve this issue? Is there a possible explanation for this clustree?

lazappi commented 4 years ago

By default the prop_filter argument in clustree() is set to 0.1. This means that edges containing less than 10% of the samples in the higher resolution cluster won't be shown. If you set prop_filter = 0 you should see all the edges including those connected to clusters 3 and 4. You will probably get a bunch of other non-interesting edges as well so you might need to play around a bit to find a value that gives you what you want.

anos-s commented 4 years ago

Thanks, it makes sense.