omnideconv / immunedeconv

A unified interface to immune deconvolution methods (CIBERSORT, EPIC, quanTIseq, TIMER, xCell, MCPcounter) and mouse deconvolution methods
https://omnideconv.org/immunedeconv/index.html
Other
458 stars 101 forks source link

[Please-fix-this] Annotation discrepancies in the <immunedeconv::cell_type_map> #156

Open jinhys opened 12 months ago

jinhys commented 12 months ago

Brief description of the problem

Hi, I've been using this package well for my studies. However, I found out that some of the annotations in the [cell_type] column of the embedded immunedeconv::cell_type_map data frame/tibble have minor discrepancies (as described in the Supporting details section below) - Could you please fix this? And if possible, would you be able to double-check for the rest of the annotations too?

Also, could you please update this XLSX file (which is linked to the HTML page):

Besides, since the immunedeconv::deconvolute() function seems to include the [cell_type] column for each estimation output, I was wondering whether this correction would affect the output of this function if they're linked within the package.

Please let me know if you need further details regarding the issues. Thank you in advance for your help!


Supporting details

## load the [cell_type_map] embedded in the [immunedeconv] package
df <- as.data.frame(immunedeconv::cell_type_map)

## check the [cell_type] column
subset(df, method_dataset=="cibersort")
#   method_dataset             method_cell_type                        cell_type
# 19      cibersort           Mast cells resting              Mast cell activated
# 20      cibersort         Mast cells activated                Mast cell resting
subset(df, method_dataset=="cibersort_abs")
#   method_dataset             method_cell_type                        cell_type
# 41  cibersort_abs           Mast cells resting              Mast cell activated
# 42  cibersort_abs         Mast cells activated                Mast cell resting

Mast cells resting / Mast cell activated -> Mast cells resting / Mast cell resting Mast cells activated / Mast cell resting -> Mast cells activated / Mast cell activated

Versions

R version 4.2.1 (2022-06-23)
immunedeconv_2.1.0
LorenzoMerotto commented 12 months ago

Hello @jinhys ! Thank you for your sharp eye! We will fix this bug in the next release.

In immunedeconv you can either use the deconvolute() and deconvolute_mouse() functions, or you can use the method specific ones, i.e. deconvolute_cibersort() or `deconvolute_quantiseq()´. The main difference between the two is the output. The methods specific functions always return a matrix with the cell type fractions/scores as they are returned by the method, with their oiginal annotation. On the other hand, the general function returns the scores/fractions using the cell types in the uniform notation specified in the Excel file you linked. This is done to make the results easier to compare.

In your case, you will notice that if you compute the cell fractions with the deconvolute_cibersort function and with the deconvolute(method='cibersort') the values of mast cells resting and activated will be swapped.

jinhys commented 12 months ago

Hi @LorenzoMerotto, thanks for your reply!

I see, I understand the unified cell type annotations are included in the output of the deconvolute() and I do appreciate them. Anyway, I should double-check whether the "Mast cells" have the right annotations as you recommended.

Thanks again for your help! And looking forward to using the next version :)

jinhys commented 11 months ago

Hi @LorenzoMerotto,

Using immunedeconv_2.1.0, I checked the output values of the Mast cells activated from the individual run of the CIBERSORT (both relative and absolute modes). It turns out that these values are equal to the output values labelled with cell_type=="Mast cell resting" (instead of the "Mast cell activated") from the immunedeconv::deconvolute() function, and vice versa. So, it does affect the downstream analyses if we are not aware of these swapped labels.

Besides, I was having errors with using the earlier version (i.e., v1.0.2) of the CIBERSORT.R. Thankfully I could solve them with reference to #137! - Maybe you and your team would already be aware of this, but I just wanted to let you know: I think one of the main causes was that the earlier version did not have the absolute and abs_method parameters included in the CIBERSORT() function to assign the results variable in the R code:

[ from v1.0.2 ] results <- CIBERSORT('sig_matrix_file.txt','mixture_file.txt', perm, QN) [ from v1.0.4 ] results <- CIBERSORT('sig_matrix_file.txt','mixture_file.txt', perm, QN, absolute, abs_method)

Hope this will be helpful in improving your package and thanks for your work!

LorenzoMerotto commented 11 months ago

Hello @jinhys

As I mentioned in my comment before the two cell types were inverted in the remapping sheet. We will fix this in the latest version which will be released shortly. In the meantime, you can access the correct CIBERSORT output with the deconvolute_cibersort function

jinhys commented 11 months ago

Hi @LorenzoMerotto, thanks for your reply. Yes, I did use the way you suggested - I just wanted to let you know as a follow-up!

Looking forward to seeing the next version :)