find fold change in DESeq2 results
1
0
Entering edit mode
ribioinfo ▴ 100
@ribioinfo-9434
Last seen 3.7 years ago

Hi, maybe I am doing something wrong but I cannot find a log2FoldChange inside the results of DESeq2:

res = results(dds, contrast=c("cond", test, control))
dRes = as.data.frame(res)

dRes$log2FoldChange[1]

[1] 12.62795

dRes[dRes$log2FoldChange == 12.62795,]

[1] baseMean       log2FoldChange lfcSE          stat           pvalue        

[6] padj          

<0 rows> (or 0-length row.names)

dRes[dRes$log2FoldChange >= 12.62795,]

                baseMean log2FoldChange     lfcSE    stat        pvalue

                 8602.244       12.62795 0.5325757 23.7111 2.770195e-124

          padj
          3.928413e-120


Same result using directly res without the conversion in data frame.

while:

d = data.frame(a=c(1.2, 1.3), b = c(2.1, 2.2))

d[d$a==1.2,]
    a   b
1 1.2 2.1

 

Could you please tell if I am filtering the table in the wrong way?

Thank you.

deseq2 • 1.1k views
ADD COMMENT
1
Entering edit mode
@mikelove
Last seen 7 hours ago
United States

You are looking for a fold change based on a printed value, but R doesn't print all the digits it knows, it prints only 7 digits by default. See here:

https://stat.ethz.ch/R-manual/R-devel/library/base/html/options.html

For example

 > 1/3
 [1] 0.3333333
!> 1/3 == 0.3333333
 [1] FALSE
ADD COMMENT
0
Entering edit mode

Thank you to all for the information.

ADD REPLY

Login before adding your answer.

Traffic: 842 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