This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem with AverageExpression() in Seurat

Hi, I am trying to calculate the average expression using the given command:

cluster.averages <- AverageExpression(test)

and referring RNA values to export its raw counts but getting "Inf" as its value for most of the genes.

Example:

cluster.averages$RNA['EGFR','Tumor Cells'] 
[1] Inf 

cluster.averages$RNA['SEC61G','macrophage'] 
[1] Inf 

cluster.averages$RNA['SPP1', ] 
T cell macrophage microglia Oligodendrocyte Tumor Cells   
SPP1 Inf Inf Inf Inf Inf

Does any of you encounter this issue or can explain why I am getting this instead of an average read count?

Thanks in advance!

seurat scrna seq averageexpression clusters

What is the command you're using?

Can you show the standard summary() result for the expression values of any one of those genes, e.g. EGFR? My suspicion is that it probably has to do with log-transforming 0 or the like.

Hi Friederike, Just to clarify, I have data from 9 different samples. These were first merged and this how the GetAssayData() looks like:

GetAssayData(test)['EGFR',][1:5] 

STR_AAACCCACAGGCTTGC STR_AAACCCAGTCGTCTCT STR_AAACCCAGTGGAACCA STR_AAACCCATCAAGCCGC STR_AAACCCATCGTGGAAG 

   29                   93                    0                    52                    0

Later, SCTransform was performed on this integrated data set and now the GetAssayData() gives:

GetAssayData(test_sct)['EGFR',][1:5] 

STR_AAACCCACAGGCTTGC STR_AAACCCAGTCGTCTCT STR_AAACCCAGTGGAACCA STR_AAACCCATCAAGCCGC STR_AAACCCATCGTGGAAG

 0.8267158           10.6388044           -3.5413747             8.0322584           -3.7594018

Can you please guide how can I rectify this?

what does GetAssayData(test_sct)['EGFR',] %>% summary return?

@Friederike, It is

GetAssayData(test_sct)['EGFR',] %>% summary

 Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 

-13.4363  -1.7349   0.3935   1.5173   4.1848  21.8560

Note: This summary is from the whole dataset. But I want this for each of the cluster or cell type identified thus used AverageExpression().

Well, I'm out. Sorry.

the only way I'm getting -Inf is with log-transformation:

head(AverageExpression(object = pbmc_small))$RNA %>% as.matrix %>% log

I suggest you approach the Seurat authors on their github page and raise an issue/ask for a clarification.

Sure,Thanks for your help.

0 answers

No answers yet.

Log in to answer this question.