I want to see how the gene expression differs in breast cancer between three species, and I am using DESeqDataSetFromMatrix on my count table.

dds <- DESeqDataSetFromMatrix(countData = whole_data, colData = whole_col_data, design = ~ species)
dds$species <- factor(dds$species, levels=c("human","canine","mouse"))
dds$species <- relevel(dds$species, ref = "human") 
dds <- DESeq(dds)

Although I specified my levels for all three species my results are still as follows and only compare between two species:

log2 fold change (MLE): species **mouse vs human** 
Wald test p-value: species **mouse vs human** 
DataFrame with 13556 rows and 6 columns
        baseMean log2FoldChange     lfcSE      stat      pvalue       

Can someone please explain to me why that is happening?


1 Answer 1


If you don't tell DESeq what contrast to make, it just does the default contrast. Which is your reference versus the last other one alphabetically.

  • $\begingroup$ Oh understood, Thanks! I thought I was doing that with the factor command, can you please let me know ow should I do that, is there a tutorial you recommend for it? $\endgroup$
    – ToTheMoon
    Feb 20 at 17:17
  • $\begingroup$ You need results(dds, contrast = c("species", "human", "canine")) if you're looking to compare human vs canine. Three params, first is the variable (column) name, 2 and 3 are the conditions you're comparing. See: bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/… $\endgroup$
    – Ram RS
    Feb 20 at 17:44
  • $\begingroup$ Thank you Ram RS. $\endgroup$
    – ToTheMoon
    Feb 20 at 17:49
  • $\begingroup$ I just noticed that in contrast there are juts humans and canines still, I want the three species to be there, human, canine, and mouse. Since I have three different species and want to compare the expression among them. I added the mouse to the contrast but I got an error "contrast', as a character vector of length 3, should have the form: contrast = c('factorName','numeratorLevel','denominatorLevel'), see the manual page of ?results for more information" is it even possible to do this for more than two categories? $\endgroup$
    – ToTheMoon
    Feb 20 at 19:02
  • $\begingroup$ You can only compare two conditions. You can of course run the results multiple times with different pairs of conditions but you cannot compare 3 groups using a 2-group statistical test. $\endgroup$
    – Ram RS
    Feb 20 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.