Skip to content

Commit d00cd97

Browse files
committed
Clarify design formula and blind dispersion estimation
1 parent b59f27f commit d00cd97

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

bin/deseq2_qc.r

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ if (decompose) {
9292
DDSFile <- paste(opt$outprefix,".dds.RData",sep="")
9393

9494
counts <- count.table[,samples.vec,drop=FALSE]
95-
dds <- DESeqDataSetFromMatrix(countData=round(counts), colData=coldata, design=~ 1)
95+
# `design=~1` creates intercept-only model, equivalent to setting `blind=TRUE` for transformation.
96+
dds <- DESeqDataSetFromMatrix(countData=round(counts), colData=coldata, design=~1)
9697
dds <- estimateSizeFactors(dds)
9798
if (min(dim(count.table))<=1) { # No point if only one sample, or one gene
9899
save(dds,file=DDSFile)
@@ -102,10 +103,10 @@ if (min(dim(count.table))<=1) { # No point if only one sample, or one gene
102103
}
103104
if (!opt$vst) {
104105
vst_name <- "rlog"
105-
rld <- rlog(dds)
106+
rld <- rlog(dds, blind=TRUE) # blind=TRUE is the default and already implied by design=~1
106107
} else {
107108
vst_name <- "vst"
108-
rld <- varianceStabilizingTransformation(dds)
109+
rld <- varianceStabilizingTransformation(dds, blind=TRUE)
109110
}
110111

111112
assay(dds, vst_name) <- assay(rld)

docs/output.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,8 @@ The script included in the pipeline uses DESeq2 to normalise read counts across
642642

643643
By default, the pipeline uses the `vst` transformation which is more suited to larger experiments. You can set the parameter `--deseq2_vst false` if you wish to use the DESeq2 native `rlog` option. See [DESeq2 docs](http://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#data-transformations-and-visualization) for a more detailed explanation.
644644

645+
Both types of transformation are performed blind, i.e. using across-all-samples variability, without using any prior information on experimental groups (equivalent to using an intercept-only design), as recommended by the [DESeq2 docs](https://www.bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#blind-dispersion-estimation).
646+
645647
The PCA plots are generated based alternately on the top five hundred most variable genes, or all genes. The former is the conventional approach that is more likely to pick up strong effects (ie the biological signal) and the latter, when different, is picking up a weaker but consistent effect that is synchronised across many transcripts. We project both of these onto the first two PCs (shown in the top row of the figure below), which is the best two dimensional representation of the variation between samples.
646648

647649
We also explore higher components in terms of experimental factors inferred from sample names. If your sample naming convention follows a strict policy of using underscores to delimit values of experimental factors (for example `WT_UNTREATED_REP1`) and all names have the same number of underscores (so excluding `WT_TREATED_10ml_REP1` from being compatible with the previous label), then any of these factors that are informative (ie label some but not all samples the same) then we individually plot upto the first five PCs, per experimental level, for each of the experimental factors.

0 commit comments

Comments
 (0)