ZxZhou4150 / Redeconve

Deconvolution of spatial transcriptomics at single-cell resolution
MIT License
14 stars 0 forks source link

Feedback and Suggestions for Package Development #8

Open ZheyouCai opened 2 months ago

ZheyouCai commented 2 months ago

Hello,

I want to express my gratitude for the work you’ve put into developing this package. It’s a fantastic tool and I’m really enjoying using it.

I’ve encountered a couple of issues that I’d like to bring to your attention:

  1. When extracting sc[['annotations']] from Seurat, I found that the output is neither a matrix nor a data frame. This format issue is preventing the seamless integration with subsequent functions such as get.refcell.sampling, and sc2type.

  2. Additionally, I’ve had difficulty extracting st[["coords"]] using the extract.seurat.st function for spatial transcriptomics data.

I also have a couple of suggestions that could enhance the package:

  1. Consider using the ggraph package for visualizations instead of the base plot function. ggraph offers a more aesthetic and customizable approach, being based on the ggplot2 framework.

  2. The tutorial could be improved by including guidance on the necessary parameter adjustments for the sc2type function after using get.ref and cell.sampling.

I’ve documented these issues and suggestions on my blog as well, which can be found at this link.

Thank you for considering these points. I’m looking forward to seeing the continued evolution of this package.

Best regards

ZxZhou4150 commented 2 months ago

Hi Zheyou,

Thanks for your suggestions to "Seurat interface" part and we really appreciate your efforts to the promotion of our works! I have made changes to the two Seurat interface functions, but for I was not in charge of this part before, I can't make sure that everything works fine. Please point out if there's still any issue after the change. Once we can make sure that everything's working, I plan to make a increment to the package version.

  1. extract.seurat.sc: The function is re-written and now it extracts "idents" slot from the seurat object with Seurat::Idents. Also, the format is fixed to satisfy the requirement of get.ref, cell.sampling and sc2type. Please make sure you have set the desired ident to active.
  2. extract.seurat.st: The function now extracts coordinates with Seurat::GetTissueCoordinates. Also, the colnames are set as "x" adnd "y" to satisfy the requirement of plotting functions like spatial.piechart.

For your other suggestions:

  1. Thank you for your suggestions on improving the aesthetics of the plots. I'll take a look at ggraph and try to make better-looking figures. But unfortunately I can't guarantee that in the near future.
  2. sc2type: The instruction after downsampling has been added. However, you don't need to run this function if you used get.ref, for this function is to merge single-cell level results to cell-type level, while the results using reference generated by get.ref are already cell-type level.

Thanks again for your efforts. Feel free to reply if there's still any issue!

Zixiang

ZheyouCai commented 1 month ago

Hello,

Thank you for acknowledging my suggestions and issues. I appreciate your attention to these matters.

I would like to propose an additional enhancement: it would be fantastic if the spatial.cell.number and spatial.piechart functions could be modified to include the option of adding histological images as backgrounds for spatial transcriptomics data. This feature would greatly enhance the visualization and context of the data.

Thank you for considering this suggestion.

Best regards

ZxZhou4150 commented 1 month ago

Please help us try out the updated function spatial.cell.number, spatial.gene and spatial.piechart. Sample codes:

library(Redeconve)
library(Seurat)
library(ggplot2)
library(grid)

image <- Images(seurat_obj)[[1]]  # Extract an image from the Seurat object
tissue_image <- as.raster(image)

spatial.cell.number(res.ctmerge, cell.names = "T cells & NK cells", coords = coords, size = 4, img.background = T, img = image,  pdfout = F)
spatial.gene = (res.ctmerge, gene.list = "CD3", coords = coords, size = 4, img.background = T, img = image,  pdfout = F)
spatial.piechart(res.ctmerge, coords, img.background = T, img = image)