diff --git a/Makerere_Course_Materials/04_DE_analysis_with_DESeq2.Rmd b/Makerere_Course_Materials/04_DE_analysis_with_DESeq2.Rmd index 82bc0ac..339bb3a 100644 --- a/Makerere_Course_Materials/04_DE_analysis_with_DESeq2.Rmd +++ b/Makerere_Course_Materials/04_DE_analysis_with_DESeq2.Rmd @@ -36,6 +36,13 @@ txi <- readRDS("RObjects/txi.rds") sampleinfo <- read_tsv("data/samplesheet_corrected.tsv", col_types = "cccc") ``` +First check the metadata. + +```{r} +sampleinfo +``` + + It is important to be sure that the order of the samples in rows in the sample meta data table matches the order of the columns in the data matrix - `DESeq2` will **not** check this. If the order does not match you will not be running the @@ -261,14 +268,13 @@ The default significance level for independent filtering is `0.1`, however, you should set this to the FDR cut off you are planning to use. We will use `0.05` - this was the purpose of the `alpha` argument in the previous command. -Remember -in Session 7 we said that there is no need to pre-filter the genes as DESeq2 -will do this through a process it calls 'independent filtering'. The genes -with `NA` are the ones `DESeq2` has filtered out. +Earlier we said that there it is not necessary to carefully to pre-filter the +genes as DESeq2 will do this through a process it calls 'independent filtering'. +The genes with `NA` are the ones `DESeq2` has filtered out. ## Fitting an additive model -So far we have fitted a simple model considering just "Status", but in reality +So far we have fit a simple model considering just "Status", but in reality we want to model the effects of both "Status" and "Time Point". Let's start with the model with only main effects - an additive model with no @@ -288,6 +294,13 @@ results.additive <- results(ddsObj, alpha = 0.05) ### The default contrast of `results` +Let's look at the results. + +```{r} +results.additive +``` + + The `results` function has returned the results for the contrast "Infected vs Uninfected". Let's have a look at the model matrix to understand why `DESeq2` has given us this particular contrast. @@ -332,7 +345,7 @@ resultsNames(ddsObj) ```{r} results.d33vd11 <- results(ddsObj, name = "TimePoint_d33_vs_d11", alpha = 0.05) - +results.d33vd11 sum(results.d33vd11$padj < 0.05, na.rm = TRUE) ``` diff --git a/Makerere_Course_Materials/04_DE_analysis_with_DESeq2.html b/Makerere_Course_Materials/04_DE_analysis_with_DESeq2.html index 383ee74..c690b08 100644 --- a/Makerere_Course_Materials/04_DE_analysis_with_DESeq2.html +++ b/Makerere_Course_Materials/04_DE_analysis_with_DESeq2.html @@ -13,34 +13,228 @@ Introduction to Bulk RNAseq data analysis - - + + - - - - + + + + - - +h1.title {font-size: 38px;} +h2 {font-size: 30px;} +h3 {font-size: 24px;} +h4 {font-size: 18px;} +h5 {font-size: 16px;} +h6 {font-size: 12px;} +code {color: inherit; background-color: rgba(0, 0, 0, 0.04);} +pre:not([class]) { background-color: white } + + +code{white-space: pre-wrap;} +span.smallcaps{font-variant: small-caps;} +span.underline{text-decoration: underline;} +div.column{display: inline-block; vertical-align: top; width: 50%;} +div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} +ul.task-list{list-style: none;} +