Coder Social home page Coder Social logo

Comments (5)

lewlin avatar lewlin commented on August 23, 2024

Ciao edward and apologizes for the delay in responding (holidays and such).

project_cell_annotation simply transfers any annotation from the scRNAseq data to space. Most times, we use it to transfer to the cell type probabilities stored in tangram_ct_pred. These values are useful on a relative scale, not absolute. As you notice, when we plot them, the plotting function standardizes to 0-1 scale irrespective of the scale of each annotation (cell types). We wanted Tangram to do that.

The meaning of plotting tangram_ct_pred in space is to tell you where your cell type is likely to be within the ROI,

from tangram.

Nh-Zhu avatar Nh-Zhu commented on August 23, 2024

Hello, how do I get the most likely cell type for each voxel from tangram_ct_pred. Thanks!

from tangram.

lewlin avatar lewlin commented on August 23, 2024

The simplest way is to fetch the most probable cell for each voxel (which assumes one cell per voxel).

To get a more accurate histogram, you can sample one cell from the probability distribution of each voxels: in this way, you do not get only the most probable cell, as you sample proportionally to the cell probability.

from tangram.

cuicathy avatar cuicathy commented on August 23, 2024

The simplest way is to fetch the most probable cell for each voxel (which assumes one cell per voxel).

Thanks for your clarification. If each voxel only has one cell, do you mean that we can use np.argmax(adata_MxIF.obsm["tangram_ct_pred"].values, axis=-1) to assign a label for each voxel with the class with the largest probability? Thanks!

from tangram.

lewlin avatar lewlin commented on August 23, 2024

Short answer: yes.
Long answer: yes but be careful.

Let's say that you have 4 voxels (containing 1 cell each), each of them is 75% prob. of being a cancer cell and 25% of being an immune cell.

How many immune cell do you expect? I would say 1 - but using argmax will give you all cancer cells.

Despite the above argument, we still use argmax to do assignment. But if you asked us to build an histogram of cell types, we would instead draw a random binary label with 75%/25% probability to get a more accurate estimate. We don't do this for deconvolution b/c we have no way to know "which" of the four is an immune cell. For more advanced cases, we compute cell type statistics by argmax vs by random sampling from probability, and compare that to estimate Tangram uncertainty in deconvolution.

The "right" way of doing is to have a more robust method for deconvolution, which perhaps even works w/o using segmentation. Well - that's Tangram2 which we are currently building :)

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.