why DEseq2 does not care about the condition?
1
0
Entering edit mode
6.4 years ago
Learner ▴ 280

I just came across a very serious problem with very known package. Either I am mistake or there is something going on with this package.

You can test it on any sample you have . I tested it on a count value of two of my transcriptome data

First

condition <- factor(c(rep("Normal", 10),rep("Tumor", 11)))​​
dds <- DESeqDataSetFromMatrix(dfm, DataFrame(condition), ~ condition)​
keep <- rowSums(counts(dds)) >= 1
dds <- dds[keep,]
dds <- DESeq(dds)​

Second way to do

condition <- factor(c(rep("Tumor", 11),rep("Normal", 10)))​​
dds <- DESeqDataSetFromMatrix(dfm, DataFrame(condition), ~ condition)​
keep <- rowSums(counts(dds)) >= 1
dds <- dds[keep,]
dds <- DESeq(dds)​

Both will give you the same LogFold change, This is not correct , am I mistaken in any way?

ensembl_gene_id           baseMean log2FoldChange      lfcSE
1 ENSG00000000003              3796.1249    -0.53555500 0.08317700
2 ENSG00000000005              488.0348    -4.05982089 0.24879251
3 ENSG00000000419              1955.4115     0.38420490 0.05960030
4 ENSG00000000457              1714.8072     0.46568839 0.06396953
5 ENSG00000000460             561.7435     1.34575314 0.07998034
6 ENSG00000000938             737.0033    -0.07637925 0.13679817
         stat       pvalue         padj
1  -6.4387389 1.204703e-10 4.953873e-10
2 -16.3180992 7.338521e-60 4.064709e-58
3   6.4463581 1.145698e-10 4.721174e-10
4   7.2798468 3.341996e-13 1.659606e-12
5  16.8260485 1.572530e-63 1.044359e-61
6  -0.5583353 5.766154e-01 6.495767e-01
Genomics DESeq2 • 2.2k views
ADD COMMENT
0
Entering edit mode

Is there a factor of -1?

ADD REPLY
0
Entering edit mode

@russhh can you explian what you mean with -1?

ADD REPLY
0
Entering edit mode

Surely you see that the simplest explanation is that you have something wrong, but you need to show us the first few lines of your input and output for us to see what it is.

ADD REPLY
0
Entering edit mode

@swbarnes2 look at above please

ADD REPLY
0
Entering edit mode

I don't think you've made the colData part right, so I think both of your scripts are really running with design ~ 1

ADD REPLY
0
Entering edit mode

@swbarnes2 can you please tell me how to make that then?

ADD REPLY
0
Entering edit mode

In general, you need to figure that people will spend about 1/10th the time answering your question as you demonstrate you have put into trying to solve it. How much time do you think your responses here make it look like you've spent?

ADD REPLY
0
Entering edit mode

@swbarnes2 can you please be specific? I cannot understand your point? do you mean that I don't spend enough time on solving the issue myself? if so and if I knew how to solve it why then should I bother and post it here ?

ADD REPLY
0
Entering edit mode
ADD REPLY
0
Entering edit mode

This is not an answer - should be a comment as it is asking for clarification and not answering the question.

ADD REPLY
3
Entering edit mode
6.4 years ago
condition  <- factor(c(rep("Normal", 10),rep("Tumor", 11)))
condition2 <- factor(c(rep("Tumor", 11),rep("Normal", 10)))
levels(condition)
[1] "Normal" "Tumor" 
levels(condition2)
[1] "Normal" "Tumor"

The levels of your factor variable are the same (alphabetical unless absolutely specified), therefore when you're testing your model, it'll create the same contrast by default.

ADD COMMENT
0
Entering edit mode

@andrew.j.skelton73 how would you do it differently ?

ADD REPLY
0
Entering edit mode

relevel? @learner

ADD REPLY
0
Entering edit mode

@cpad0112 got it , thanks , I am testing to see if the problem solve and I will accept your answer . Thanks

ADD REPLY
1
Entering edit mode

you can set reference levels before hand:

> condition  <- factor(c(rep("Normal", 10),rep("Tumor", 11)),levels=c("Tumor","Normal"))
> levels(condition)
[1] "Tumor"  "Normal"
> condition1  <- factor(c(rep("Normal", 10),rep("Tumor", 11)),levels=c("Normal","Tumor"))
> levels(condition1)
[1] "Normal" "Tumor" 
> condition
 [1] Normal Normal Normal Normal Normal Normal Normal Normal Normal Normal Tumor  Tumor  Tumor 
[14] Tumor  Tumor  Tumor  Tumor  Tumor  Tumor  Tumor  Tumor 
Levels: Tumor Normal
> condition1
 [1] Normal Normal Normal Normal Normal Normal Normal Normal Normal Normal Tumor  Tumor  Tumor 
[14] Tumor  Tumor  Tumor  Tumor  Tumor  Tumor  Tumor  Tumor 
Levels: Normal Tumor
ADD REPLY
0
Entering edit mode

You could keep everything as is, and just specify the contrast you're interested in. Check out ?results

> results1 <- results(dds, contrast=c("condition","Tumor","Normal"))
> results2 <- results(dds, contrast=c("condition","Normal","Tumor"))
ADD REPLY
0
Entering edit mode

@andrew.j.skelton73 Thanks Andrew, I like the way you answer my question, it helped me alot THANKS

ADD REPLY

Login before adding your answer.

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