Question: DESeq2 condition table
0
gravatar for riccardo
20 months ago by
riccardo70
riccardo70 wrote:

Hello, usually I load the condition table from a table in order to have a data frame with a column called condition that I put in the design formula:

dds = DESeqDataSetFromTximport(txi, cond, ~condition)

I do not create a factor of the column condition ad I usually use contrast in order to do choose the comparisons that I need.

Is it correct do in this way or it is mandatory to create a factor?

Thank you.

deseq2 • 504 views
ADD COMMENTlink modified 20 months ago by Michael Love21k • written 20 months ago by riccardo70

The condition table has this format:

                  condition

Sample1       A

Sample2       A

Sample3       B

Sample4       B

Sample5       C

Sample6       C

ADD REPLYlink written 20 months ago by riccardo70
Answer: DESeq2 condition table
0
gravatar for Michael Love
20 months ago by
Michael Love21k
United States
Michael Love21k wrote:

'condition' does need to be a factor but functions do this for you, either read.table() or DESeqDataSet*

ADD COMMENTlink written 20 months ago by Michael Love21k

Thank you very much!

ADD REPLYlink written 20 months ago by riccardo70

Hello,

I did again the same thing that I posted before but this time using the same approach but with different values in the condition table I got this message:

  it appears that the last variable in the design formula, 'condition',
  has a factor level, 'control', which is not the reference level. we recommend
  to use factor(...,levels=...) or relevel() to set this as the reference level
  before proceeding. for more information, please see the 'Note on factor levels'
  in vignette('DESeq2').

Can you help me?

 

ADD REPLYlink modified 7 months ago by Michael Love21k • written 7 months ago by riccardo70

Can you be more specific? What kind of help do you need? 

ADD REPLYlink written 7 months ago by Michael Love21k

I just realized that if I put "control" in the condition I get the message and checking the code I saw this:

controlSynonyms <- c("control", "Control", "CONTROL")

for (cSyn in controlSynonyms) {
        if (cSyn %in% lastDVLvls) {
          if (cSyn != lastDVLvls[1]) {
            message(paste0("it appears that the last variable in the design formula, '", 
                           designVars[lastDV], "',\n  has a factor level, '", 
                           cSyn, "', which is not the reference level. we recommend\n  to use factor(...,levels=...) or relevel() to set this as the reference level\n  before proceeding. for more information, please see the 'Note on factor levels'\n  in vignette('DESeq2')."))
          }
        }
      }

Why you do that?

If I use the contrast I will not have any problem to select the correct condition even with that message, right?

Thanks.

 

 

ADD REPLYlink written 7 months ago by riccardo70

It's just a message and can be ignored if you already know that control is not the reference level.

Having some users have to ignore messages is better than other users not knowing that they've accidentally put control / treated in their paper figures.

ADD REPLYlink written 7 months ago by Michael Love21k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 187 users visited in the last hour