Hey,
Most importantly, you have not shown your DESeq2 code; however, I will answer as best as I can.
If, in your metadata that is supplied to DESeq2, 'control
' is set as the reference level in your 'sampleCondition
' column, then DESeq2 will use control
as the denominator for determining fold-changes. Then, you'll see a situation like this: http://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#quick-start
In this case, a log2 value of +3 would indicate that the gene in question is more highly expressed (8 times on the linear scale) in 'condition
' (or 'treated
', for you) when compared to 'untreated
' ('control
' for you).
You can also manually set the order of comparison like this: http://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#differential-expression-analysis, i.e..:
res <- results(dds, contrast=c("condition","treated","untreated"))
Here, the numerator is 'treated
'; while the denominator is 'untreated
'.
If in further doubt, just take a quick look via a box-and-whiskers:
boxplot(assay(vst)['VCAM1',] ~ colData(dds)[,'dex'])
Let's check the results table and do 'trt
' versus 'untrt
':
res <- results(dds,
contrast = c('dex','trt','untrt'))
res <- lfcShrink(dds,
contrast = c('dex','trt','untrt'), res=res, type = 'normal')
res['VCAM1',]
log2 fold change (MAP): dex trt vs untrt
Wald test p-value: dex trt vs untrt
DataFrame with 1 row and 6 columns
baseMean log2FoldChange lfcSE stat pvalue padj
<numeric> <numeric> <numeric> <numeric> <numeric> <numeric>
VCAM1 509.995 -3.45198 0.177923 -19.307 4.69235e-83 4.72958e-80
Looks good.
Kevin
Dear Kevin, Thank you for your help. I was using this to determine the baseline:
I have tried also:
but it did not seem to work (might be my lack of experience, though)
I will use your suggestion to check using box-and-whiskers make sure
Here is my full code:
Hi, I think that you need to change this line:
...to:
Or, you could change this line:
...to:
Another problem may be where you are running the results() function. You seem to be running it 'blindly'. Can you take a look at the example in the vignette, and also the extra related function lfcShrink()? - see http://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#quick-start
If still in doubt, after you have run all of the code above, what is the output of:
?
Hi,
Thanks for the reply!
I changed the line:
I don't seem to have lfcShrink function in my R version...
Also, here is what I get when I run str(colData(dds))
You must be using an old version of DESeq2 if
lfcShrink()
is not available. Why would you be using an old version? Which R version are you using? If you runsessioninfo()
, you should see this information.This following line indicates that your variable is already ordered correctly, i.e., with 'cntrl' as the reference level:
So, there should be no problem.
Thank you so much! I will update my DESeq2 :)