Constructs a simulated dataset of Negative Binomial data from different conditions. The fold changes between the conditions can be adjusted with the betaSD_condition and the betaSD_tissue arguments.

makeExampleDESeqDataSet_multifac(
  n = 1000,
  m = 12,
  betaSD_condition = 1,
  betaSD_tissue = 3,
  interceptMean = 4,
  interceptSD = 2,
  dispMeanRel = function(x) 4/x + 0.1,
  sizeFactors = rep(1, m)
)

Arguments

n

number of rows (genes)

m

number of columns (samples)

betaSD_condition

the standard deviation for condition betas, i.e. beta ~ N(0,betaSD)

betaSD_tissue

the standard deviation for tissue betas, i.e. beta ~ N(0,betaSD)

interceptMean

the mean of the intercept betas (log2 scale)

interceptSD

the standard deviation of the intercept betas (log2 scale)

dispMeanRel

a function specifying the relationship of the dispersions on 2^trueIntercept

sizeFactors

multiplicative factors for each sample

Value

a DESeqDataSet with true dispersion, intercept for two factors (condition and tissue) and beta values in the metadata columns. Note that the true betas are provided on the log2 scale.

Details

This function is designed and inspired following the proposal of makeExampleDESeqDataSet from the DESeq2 package. Credits are given to Mike Love for the nice initial implementation

Examples

dds <- makeExampleDESeqDataSet_multifac(betaSD_condition = 3, betaSD_tissue = 1)
dds
#> class: DESeqDataSet 
#> dim: 1000 12 
#> metadata(1): version
#> assays(1): counts
#> rownames(1000): gene1 gene2 ... gene999 gene1000
#> rowData names(4): trueIntercept trueBeta_condition trueBeta_tissue
#>   trueDisp
#> colnames(12): sample1 sample2 ... sample11 sample12
#> colData names(2): condition tissue
dds2 <- makeExampleDESeqDataSet_multifac(betaSD_condition = 1, betaSD_tissue = 4)
dds2
#> class: DESeqDataSet 
#> dim: 1000 12 
#> metadata(1): version
#> assays(1): counts
#> rownames(1000): gene1 gene2 ... gene999 gene1000
#> rowData names(4): trueIntercept trueBeta_condition trueBeta_tissue
#>   trueDisp
#> colnames(12): sample1 sample2 ... sample11 sample12
#> colData names(2): condition tissue