This is a test version of Biostars. For the public version, visit https://www.biostars.org.
RNA-seq: Change conditions for comparison

Hi,

I have 8 samples in 3 replicates. WT, NTC (non targeting control), NF2-PTEN DKO, PTEN-TP53 DKO, NF2-TP53 DKO, NF2 SKO, PTEN SKO and TP53 SKO

After LFCShrink, resLFC <- lfcShrink(dds, coef = 2, type="apeglm"), I get

[1] "Intercept"                         "Knockout_NF2.PTEN.DKO_vs_NF2.SKO" 
[3] "Knockout_NF2.TP53.DKO_vs_NF2.SKO"  "Knockout_NTC_vs_NF2.SKO"          
[5] "Knockout_PTEN.SKO_vs_NF2.SKO"      "Knockout_PTEN.TP53.DKO_vs_NF2.SKO"
[7] "Knockout_TP53.SKO_vs_NF2.SKO"      "Knockout_WT_vs_NF2.SKO" 

when I use resultsNames argument.

I want to compare the samples to NTC instead of NF2.SKO. How do I do that? I tried:

cond <- factor(rep(1:8, each=3));
dds$cond = relevel(cond, 3);
resultsNames(DESeq(dds)) 

But whatever number I try in the relevel argument, it gives me the same result for resultsNames. i.,e all my samples are compared to NF2.SKO.

Please help. Thanks!

rna-seq

1 answer

If you want everything compared to NTC, you need to convert Knockout to a factor and set NTC as the first level.

dds$Knockout <- factor(dds$Knockout)
dds$Knockout <- relevel(dds$Knockout, "NTC")

And then run your differential expression and lfcShrink code as usual.

Hi rpolicastro ,

Thanks for the response. I tried the code you mentioned:

dds <- DESeq(ddsTxi2)
dds
dds$Knockout <- factor(dds$Knockout)
dds$Knockout <- relevel(dds$Knockout, "NTC")
resultsNames(dds)

and still getting the same result:

[1] "Intercept"                         "Knockout_NF2.PTEN.DKO_vs_NF2.SKO"
[3] "Knockout_NF2.TP53.DKO_vs_NF2.SKO"  "Knockout_NTC_vs_NF2.SKO"
[5] "Knockout_PTEN.SKO_vs_NF2.SKO"      "Knockout_PTEN.TP53.DKO_vs_NF2.SKO"
[7] "Knockout_TP53.SKO_vs_NF2.SKO"      "Knockout_WT_vs_NF2.SKO"

You need to set the factor levels before you run the DESeq function.

Log in to answer this question.