Getting the mean normalized expression values of mutants and controls in DESeq2 prior calculation of Log2FC
0
0
Entering edit mode
5 days ago
User000 ▴ 580

Hello, I would like to use mitoXplorer for my DE genes link and the required input format is like below.

Dataset ID+ Gene Identifier^    Control Mutant  Log2Fold*   p-value
dataset1    MT-CO2  5.14185 0.525591    -3.29027    0.04165
dataset1    EPHB2   21.6398 77.9794 1.84941 0.03615
dataset1    CD52    113979  24.01   -2.24706    0.14155
dataset1    MFSD2A  2671    16.7198 2.64611 0.0318

I did DE using DESeq2 and get a classical output like this:

gene    baseMean    log2FoldChange  lfcSE   stat    pvalue  padj
gene1   145,6   3,72051115683167    0,228357536526171   16,5624981658657    1,30079132918825E-61    9,5818528058662E-60
gene2   132,89  2,64563360440389    0,48507809031081    6,0969129994873 1,08136332656555E-09    7,23746649195554E-09
gene3   1200    3,47737947525206    0,371740409280336   9,80334240603984    1,08920561006602E-22    1,90277551472758E-21
gene4   12,3    4,36963212258223    0,156024000446566   28,181259678469 9,92432650971091E-175   4,24761174615627E-172

Now, what I am trying to do is to get the normalized counts of dds and calculate the mean normalized expression values of controls and mutants in order to get 3rd and 4th columns required to mitoXplorer:

normalized_counts_dfr <- as.data.frame(counts(dds, normalized=TRUE))
names(normalized_counts_dfr) <- c("mutant","mutant","mutant","control","control","control")
normalized_counts_dfr$mutant_mean <- apply(normalized_counts_dfr[c(1:3],1, mean)
normalized_counts_dfr$control_mean <- apply(normalized_counts_dfr[c(4:6)],1, mean)
newdata <- normalized_counts_dfr[-c(1:6)]
newdata$log <- log2(newdata$mutant_mean/newdata$control_mean)

However, the log2FC value I get using this calculation is slightly different from the log2FC value I get with DESeq2. I guess this is because DESeq2 uses a different algorithm? My question is then how can I get the mean normalized expression values of mutants and controls that were used in DESeq2 algorithm before calculating the log2FC? Since for other analysis I am using the log2FC value I got with DESeq2, I cannot use different log2FC for the mitoXplorer analysis.

DESeq2 RNAseq Log2FC • 203 views
ADD COMMENT

Login before adding your answer.

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