soumelis-lab / ICELLNET

19 stars 8 forks source link

difference between sc.data.cleaning() and AverageExpression() #16

Closed mdidish closed 9 months ago

mdidish commented 11 months ago

Hello

When I run

average.clean= sc.data.cleaning(object = seurat, db = db, filter.perc = filter.perc, save_file = T, path="./ICELL/", force.file = F)

I obtained a dataframe with only 0 and 1 values. At first, I told myself that the ligands and receptors in the database were very weakly expressed in my dataset

But if I run

average.clean.seurat <- AverageExpression(object = seurat, assays = "RNA")
average.clean.seurat <- average.clean.seurat[average.clean$Symbol,]

I obtain values until 410, for genes which have only 1 or 0 values in average.clean.

Why this difference?

Best,

lmassenet-regad commented 11 months ago

Hi, I need more context to be able to help.

What is the value of filter.perc you are using ? I advice you to start with filter.perc=0 at first to see if it comes from the data itself of the script. I don't understand what you mean by "I obtain values until 410, for genes which have only 1 or 0 values in average.clean.", is it possible to have an exemple, such as the first rows of average.clean and average.clean.seurat ?

Also, the Seurat function AverageExpression uses non log normalised data to compute the average and does not return logged data. You can find additional details here: https://github.com/satijalab/seurat/issues/4090 https://github.com/satijalab/seurat/issues/3536