YMa-lab / CARD

GNU General Public License v3.0
80 stars 20 forks source link

Question regarding the values in Proportion_CARD vs values seen in plot of CARD.visualize.prop #42

Closed LooLipin closed 1 year ago

LooLipin commented 1 year ago

Hi there,

I was just checking the values of the Proportion_CARD slot in CARD_obj and I find that a lot of the values are quite small (<0.01). However, the plots that are generated for the deconvoluted clusters are higher than that.

I went over the script for the CARD.visualize.prop function and I see there are a few lines for scaling and maybe this is why the values are different, specifically res_CARD_scale = as.data.frame(apply(res_CARD,2,function(x){ (x - min(x)) / (max(x) - min(x)) } ))

I am trying to subset a few spots based on the deconvolution result but since the values don't match up, I can't decide what would be a good cutoff.

Hence, I was wondering if there is a way for me to get the scaled values from the object? Or should I just extract the values and then redo scaling myself.

Thanks, Lipin

YingMa0107 commented 1 year ago

Hi @LooLipin,

We appreciate your interest in our package!

The Proportion_CARD slot contains a data frame with proportion values estimated by CARD. I rescaled it for visual purposes to enable us to examine the distribution of proportions for each cell type separately, particularly those with small proportions. It also allows us to identify locations with relatively higher proportions for a given cell type. If you need to select specific spots based on one cell type at a time, you can use the quantile cutoff (1%, 2%, ... 10%). The subset of spots obtained using the quantile cutoff should be consistent between the scaled and unscaled data. However, if you want to select spots based on all cell types, using the original proportion matrix would be more appropriate.

Best, Ying

LooLipin commented 1 year ago

Great Thanks!