Problem with AverageExpression() in Seurat
0
0
Entering edit mode
3.7 years ago
Researcher ▴ 130

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 • 3.8k views
ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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?

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

@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().

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Sure,Thanks for your help.

ADD REPLY

Login before adding your answer.

Traffic: 1973 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6