Coder Social home page Coder Social logo

Comments (4)

hongruhu avatar hongruhu commented on June 14, 2024

I have a similar question. It was written in the document that "the returned ad_ge is a spot-by-gene AnnData, similar to spatial data ad_sp, but where gene expression has been projected from the single cells.", but if we assume the spot is "bulk", then why wouldn't the ad_ge return the number of cell type by spot by gene?

Is there a way to get cell-type specific spot-by-gene AnnData? Thanks

from tangram.

Hejin0701 avatar Hejin0701 commented on June 14, 2024

hi @kguion1 Thank you for using Tangram and raising the issue. Below are the comments questions:

The project_gene gives the spot-by-gene Anndata. The gene at each spot gives the summation of gene expression of all cells times the probability of each cell being mapped to that spot. In your example, if there were two cells mapped to one spot with probability p1 and p2, one cell had expression of a marker gene g1 and the other cell had the expression of the same gene g2, the project_genes return a weighted sum of the expression of that particular gene (p1g1+p2g2).

It seems that for this specific gene, Tangram does not give a good prediction based on the figure as the predicted location of gene expression is different from the measured one. Normally we look at how well the prediction is compared to the measured gene expression when doing project_gene_sc. If the measured gene distribution is sparse while Tangram gives a prediction of uniform gene expression, sometimes it means Tangram helps to correct the low quality genes because Visium can suffer from measurement dropout. In your case, however, since the measured gene distribution is not sparse, and Tangram predicted result does not show good alignment, it is probable that the accuracy is predicted result is not great. You may want to change the training genes or denoise the single-cell/spatial data to see whether it helps to improve the prediction.

Cell-cell communication is also something we would like to investigate and add the function to Tangram. We are still developing the function to learn the colocalization relationship. For current Tangram version, if you have Visium data, Tangram will only give ad_map, where each row contains the probability of a cell mapped to each spot. You can do a dot product of two rows which will give you a colocalization score between two cells, which helps to quantifies how probable the two cells colocalize in the same spot. Then from the colocalization matrix between all the cell you should be able do some cell-cell interaction analysis.

Hope that helps!

from tangram.

Hejin0701 avatar Hejin0701 commented on June 14, 2024

Hi @Hongru-Hu ,

Do you mean that you would like to have a 3D matrix which is spots by cell type by gene? We don't have a function to return that matrix directly in Tangram.

The ad_map returned from map_cell_to_space returns the cells by spots. If you want the cell type by spot, you can simply sums all the rows belonging to the same cell type and obtain the cell type by spots distribution. Furthermore, the ad_ge is actually obtained by multiplying transpose of ad_map with the ad_sc (single cell data: cell by genes). If you would like to obtain the the gene expression contributed by the specific cell type in every spot, you can extract a certain cell type in ad_map, take transpose and multiplying it with the gene expression of that cell type in ad_sc (extract the rows that belongs to the cell type for both ad_map and ad_sc).

Let me know if you have any further questions. Thank you!

from tangram.

hongruhu avatar hongruhu commented on June 14, 2024

@Hejin0701 I followed the steps and the results look pretty good! thanks for your reply.

from tangram.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.