This function convert [phyloseq::phyloseq-class] to [DESeq2::DESeqDataSet-class], which can then be tested using [DESeq2::DESeq()`].

phyloseq2DESeq2(ps, design, ...)

Arguments

ps

the [phyloseq::phyloseq-class] object to convert, which must have a [phyloseq::sample_data()`] component.

design

a formula or matrix, the formula expresses how the counts for each gene depend on the variables in colData. Many R formula are valid, including designs with multiple variables, e.g., ~ group + condition. This argument is passed to DESeq2::DESeqDataSetFromMatrix().

...

additional arguments passed to DESeq2::DESeqDataSetFromMatrix(), Most users will not need to pass any additional arguments here.

Value

a DESeq2::DESeqDataSet object.

Examples

data(caporaso)
phyloseq2DESeq2(caporaso, ~SampleType)
#> converting counts to integer mode
#> Warning: some variables in design formula are characters, converting to factors
#>   Note: levels of factors in the design contain characters other than
#>   letters, numbers, '_' and '.'. It is recommended (but not required) to use
#>   only letters, numbers, and delimiters '_' or '.', as these are safe characters
#>   for column names in R. [This is a message, not a warning or an error]
#> class: DESeqDataSet 
#> dim: 3426 34 
#> metadata(1): version
#> assays(1): counts
#> rownames(3426): New.CleanUp.ReferenceOTU647 14030 ... 189548 3769033
#> rowData names(0):
#> colnames(34): L1S140 L1S208 ... L3S313 L2S240
#> colData names(8): SampleType Year ... DaysSinceExperimentStart
#>   Description