DESEQ2 - Correctly altering log2foldchange when switching comparison direction (HELP GREATLY APPRECIATED)
1
0
Entering edit mode
sk • 0
@fa435831
Last seen 19 minutes ago
Canada

I have 4 conditions being compared; 2 experimental conditions (KD1 and KD2), 1 control condition (SCR), and 1 wild-type condition (WT).

I need to perform the differential analysis by comparing KD1 vs SCR and KD2 vs SCR, but then SCR vs WT.

I have created my DESeq2 condition vector as follows, so that SCR is used as the baseline for the comparisons.

metadata$Condition <- factor(metadata_40S$Condition, levels = c("SCR", "KD1", "KD2", "WT"))

dds <- DESeqDataSetFromMatrix(
  countData = counts,
  colData = metadata,
  design = ~ Condition
)

This gives me log2fc for WTvsSCR, but I need SCRvsWT comparison values.

To convert log2fc WTvsSCR to SCRvsWT, is it correct to use the opposite sign of the WTvsSCR log2fc values to represent the SCRvsWT log2fc? (Negative/Positive WTvsSCR to Positive/Negative SCRvsWT log2fc respectively).

I saw in another discussion post that the calculation in DESeq2 is more complex than manual calculation, and am not sure if my method is correct.

I would greatly appreciate feedback, advice, and/or links to relevant discussions/tutorials that detail the DESeq2 log2foldchange calculation process.

Thank you.

DESeq2 • 938 views
ADD COMMENT
0
Entering edit mode
swbarnes2 ★ 1.4k
@swbarnes2-14086
Last seen 1 day ago
San Diego

Use contrasts to specify what sub group to compare to what.

ADD COMMENT
0
Entering edit mode

I have two brief questions:

Question 1:

I am primarily using the apeglm comparison output, but I am required to provide a 'coef' value; I get an error message if I specify the contrast manually, and the prompt says that apeglm will only accept the coef value. From the dds object, I have the Condition_WT_vs_SCR coef.

Once I get the output of resLFC_ape_control, can I later manually use the opposite sign of apeglm WTvsSCR log2fc values to obtain apeglm SCRvsWT log2fc values?

resLFC_ape_control <- lfcShrink(dds, coef="Condition_WT_vs_SCR", type ="apeglm")

Question 2:

If SCR is used as the baseline when first running the DESeq2 analysis, would it be correct to use this code to get the basic counts comparison for SCR versus WT?

results_Condition_SCR_vs_WT <- results(dds, contrast = c("Condition", "SCR", "WT"))

Or, should I use the comparison as below (because SCR is the specified baseline when creating the DESeq2 object), and then later manually use the opposite sign of WTvsSCR log2fc values to obtain SCRvsWT log2fc values?

results_Condition_WT_vs_SCR <- results(dds, contrast = c("Condition", "WT", "SCR"))
ADD REPLY
0
Entering edit mode

You can factor to reorder the groupings, so that it generates the coef that you want.

ADD REPLY
0
Entering edit mode

If I use factor to create the Condition_SCR_vs_WT coef, then the other chefs would be Condition_KD1_vs_WT and Condition_KD2_vs_WT, but I need those to be Condition_KD1_vs_SCR and Condition_KD2_vs_SCR.

How do I use factor to keep the KD conditions compared to SCR, but the SCR compared to WT?

Thank you!

ADD REPLY

Login before adding your answer.

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