[BioC] DESeq2, problems using list argument to extract results from DESeq

Simon Anders anders at embl.de
Fri Jul 11 11:40:45 CEST 2014


Hi Jon

On 11/07/14 10:36, Jon Bråte [guest] wrote:
> I have gene expression from several embryogenesis stages as well as non-reproductive stages. I have done DESeq on my DESeqDataSet and want to extract the results from all the embryogenesis stages vs non-reproductive.
>
> Heres the error I get:
>
>> resNonReprVsAll = results(dds, contrast=list(c("Early vitellogenesis", "Late vitellogenesis", "Fertilization", "Early cleavage", "Late cleavage", "Early preinversion", "Late preinversion", "Early postinversion", "Late postinversion"), "Non reproductive"))
> Error in cleanContrast(object, contrast, expanded = isExpanded, listValues = listValues) :
>    all elements of the contrast as a list of length 2 should be elements of 'resultsNames(object)'

The 'results' function gives you a results table for _one_ contrast. If 
you want several contrasts, you have to call 'results' several times.

Also note that 'results' now supports two ways of specifying contrasts: 
For main effects, we suggest that you use the new format of passing a 
vector with three strings, namely the factor which you want to contrast 
and then the two levels you want to compare, e.g.,

results( dds, contrast = c( "condition",
    "Fertilization", "Non reproductive" ) )
# (or perhaps "Non.reproductive", depending how your level is
# actually names)

The old way of specifying _two_ elements from 'resultsNames' needs to be 
used only for more complicated contrasts, e.g., those involving 
interactions.

If this is unclear, ask again, and explain the biology of your 
experiment and what contrasts you are actually interested in.

   Simon



More information about the Bioconductor mailing list