Search
Question: DESeq2 condition table
0
gravatar for riccardo
17 months ago by
riccardo50
riccardo50 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.

ADD COMMENTlink modified 17 months ago by Michael Love20k • written 17 months ago by riccardo50

The condition table has this format:

                  condition

Sample1       A

Sample2       A

Sample3       B

Sample4       B

Sample5       C

Sample6       C

ADD REPLYlink written 17 months ago by riccardo50
0
gravatar for Michael Love
17 months ago by
Michael Love20k
United States
Michael Love20k wrote:

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

ADD COMMENTlink written 17 months ago by Michael Love20k

Thank you very much!

ADD REPLYlink written 17 months ago by riccardo50

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 5 months ago by Michael Love20k • written 5 months ago by riccardo50

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

ADD REPLYlink written 5 months ago by Michael Love20k

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 5 months ago by riccardo50

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 5 months ago by Michael Love20k
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 2.2.0
Traffic: 401 users visited in the last hour