satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.24k stars 902 forks source link

BuildNicheAssay #7902

Closed KoichiHashikawa closed 2 months ago

KoichiHashikawa commented 11 months ago

Hello Satija group,

Thanks so much for adding many exciting functionalities in the new V5.

I have a few questions around "BuildNicheAssay". I appreciate if you can share your insights when you have a chance.

  1. how are niches computed? Is the computation flow as the following?

    • neighborhood graph is generated by searching for k near neighbor cells of each cell in space. Is this based on euclidean distance or delaunay network? This is stored as obj@assays$niche@counts.
    • obj@assays$niche@counts or obj@assays$niche@scale.data is used as inputs for clustering
    • dimensionality reduction using PCA or using all features as inputs?
    • k-mean clustering, using the user defined number of clusters, k
  2. how to find optimal number of near neighbor, k? Default seems 30. Is this a good number to stick to or should we change it depending on the number of cell types in space (e.g. more cell types, higher k)?

  3. how to find optimal number of clusters, k? I feel that this is the most critical point that may make significant differences in the final analytical results. If k-mean clustering is used, do you recommend silhouette method to identify optimal k? I tried silhouette method to find optimal number, but the scale of the spatial data is too large and it could easily crash the computational environment (my guess is dist(df) may be the cause). Or do you have any other ways (including empirical suggestions; XX number of niches are good for YY number of cell types) to define the number of niches?

Thank you! best, Koichi

Shikari666 commented 10 months ago

Hey Satija lab,

With BuildNicheAssay , we have multi mode but not clear explanation was given when running RCTD, and also have confusion with the fov object as can't we use spatial coordinates there?

KoichiHashikawa commented 7 months ago

@saketkc @samuel-marsh Could you help sharing your insights, regarding concerns around niche analysis? Especially, I wonder if you can add functions/documentations describing 1. how to determine optimal k (number of niches) in k-mean clustering, 2. difference between BuildNicheAssay (it seems using euclidean distance) and Delaunay network and 3. to add statistical measure to compute differential niches between conditions (e.g. disease enriched niche; odds ratio etc) and 4. to add functionality to learn interacting cells in niches and 5. to add functionality to learn L-R interactions per neighborhood.

Thanks.

KoichiHashikawa commented 7 months ago

adding @Gesmira as well.

igrabski commented 2 months ago

Hi, we have new vignettes and functionality for analyzing spatial data as of the last Seurat release -- please see if those address your questions. If not, please feel free to open a new issue with your questions!

KoichiHashikawa commented 2 months ago

@igrabski I have seen the new vignettes, but I do not think it addresses my questions. I will open a new issue.

odunola26 commented 2 months ago

Hello,

Please , i am trying to run "BuildNicheAssay" on my 10x visium data, but I am having error with the Fov, please can you guide me on how i can access this from my seurat object. here is my code :

Extract spatial coordinates from the centroids object coords <- sample39_obj@images$slice1@boundaries$centroids@coords coords

Ensure the coordinates matrix has proper row names rownames(coords) <- sample39_obj@images$slice1@boundaries$centroids@cells

Create the FOV list with the correct format fov <- list(FOV = coords)

Run BuildNicheAssay sample39_obj <- BuildNicheAssay( object = sample39_obj, fov = fov, group.by = "predicted.celltype", assay = "niche", cluster.name = "niches", neighbors.k = 30, niches.k = 5 )

Thank you. Odunola

pauelito commented 1 month ago

It would be great to get some insights to the questions raised above. Thank you!

igrabski commented 3 weeks ago

Hi @odunola26, it looks like this is a separate issue from the one initially raised here -- if you are still experiencing your error, please open a new issue with your question.