Skip to content

Commit

Permalink
UPdate path to .rds files on github
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-roux committed Jun 26, 2024
1 parent 632058f commit ef55769
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/hands_on_limma_webr.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hands-on/hands_on_DESeq2.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Today we will load directly the reprocessed data loaded from the [recount3 proje
## Load DESeqDataSet object
dds <- readRDS("DESeqDataSet.rds")
## Or load directly from Github
# dds <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/DESeqDataSet.rds"))
# dds <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/hands-on/DESeqDataSet.rds"))
## Apply count data transformation
vst <- varianceStabilizingTransformation(dds, blind = TRUE)
Expand Down
2 changes: 1 addition & 1 deletion hands-on/hands_on_DESeq2_lite.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Today we will load directly the reprocessed data loaded from the [recount3 proje
## Load DESeqDataSet object
dds <- readRDS("DESeqDataSet.rds")
## Or load directly from Github
# dds <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/DESeqDataSet.rds"))
# dds <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/hands-on/DESeqDataSet.rds"))
## Apply count data transformation
vst <- varianceStabilizingTransformation(dds, blind = TRUE)
Expand Down
2 changes: 1 addition & 1 deletion hands-on/hands_on_DESeq2_webr.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Today we will load directly the reprocessed data loaded from the [recount3 proje

```{webr-r}
## Load DESeqDataSet object directly from Github
dds <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/DESeqDataSet.rds"))
dds <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/hands-on/DESeqDataSet.rds"))
## Apply count data transformation
vst <- varianceStabilizingTransformation(dds, blind = TRUE)
Expand Down
2 changes: 1 addition & 1 deletion hands-on/hands_on_limma.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Today we will load directly the reprocessed data loaded from the [recount3 proje
## Load DESeqDataSet object
dge <- readRDS("DGEList.rds")
## Or load directly from Github
# dge <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/DGEList.rds"))
# dge <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/hands-on/DGEList.rds"))
## Visualize distribution before filtering (protein-coding genes only)
plotDensities(edgeR::cpm(dge, log = T)[dge$genes$gene_type %in% "protein_coding", ],
Expand Down
6 changes: 2 additions & 4 deletions hands-on/hands_on_limma_advanced.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Today's dataset is described in this paper ["Tamoxifen induction of Cre recombin

**This script presents a slightly more complex way -- but maybe better -- of analyzing the dataset. Use it if you are already familiar with DE analysis with the limma/edgeR packages**


# Loading data in R

```{r}
Expand Down Expand Up @@ -79,7 +78,7 @@ Today we will load directly the reprocessed data loaded from the [recount3 proje
## Load DESeqDataSet object
dge <- readRDS("DGEList.rds")
## Or load directly from Github
# dge <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/DGEList.rds"))
# dge <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/hands-on/DGEList.rds"))
## Visualize distribution before filtering (protein-coding genes only)
plotDensities(edgeR::cpm(dge, log = T)[dge$genes$gene_type %in% "protein_coding", ],
Expand Down Expand Up @@ -282,7 +281,6 @@ topTable(fit2, coef="Interaction_Retina", n=10, sort.by="P")

![](round-help-button.png) What does this tissue-by-tissue analysis reveals that was not so apparent in the `hands_on_limma.qmd` script (where tissue variation was absorbed by the model)?


```{r}
## Plot expression of top genes: choose one contrast
## For example: sex differences in Cortex, top 10 genes
Expand Down Expand Up @@ -315,7 +313,7 @@ top[top$gene_name %in% c("Egr2", "Fos", "Dusp1", "Nr4a1", "Sik1", "Arc", "Egr1",

## Interactions term

We will now look at the genes reacting differently to Tamoxifen treatment in male and female. The genes reaching signficiance in the different tissues are distinct
We will now look at the genes reacting differently to Tamoxifen treatment in male and female. The genes reaching signficiance in the different tissues are distinct

```{r}
## Genes significant wiht a relaxed FDR cutoff of 20%
Expand Down
2 changes: 1 addition & 1 deletion hands-on/hands_on_limma_lite.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Today we will load directly the reprocessed data loaded from the [recount3 proje
## Load DESeqDataSet object
dge <- readRDS("DGEList.rds")
## Or load directly from Github
# dge <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/DGEList.rds"))
# dge <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/hands-on/DGEList.rds"))
## Visualize distribution before filtering (protein-coding genes only)
plotDensities(cpm(dge, log = T)[dge$genes$gene_type %in% "protein_coding", ],
Expand Down
6 changes: 3 additions & 3 deletions hands-on/hands_on_limma_webr.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ Today we will load directly the reprocessed data loaded from the [recount3 proje

```{webr-r}
## Load DESeqDataSet object from Github
log2cpm <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/log2cpm.rds"))
colData <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/colData.rds"))
rowData <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/rowData.rds"))
log2cpm <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/hands-on/log2cpm.rds"))
colData <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/hands-on/colData.rds"))
rowData <- readRDS(url("https://raw.githubusercontent.com/julien-roux/SIB_days_2024_workshop_EDI/main/hands-on/rowData.rds"))
## Distribution of expression values
boxplot(log2cpm,
Expand Down
9 changes: 6 additions & 3 deletions hands-on/hands_on_recount3.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ In this hands-on session we would like to focus on a particular transcriptomic d

Today's dataset is described in this paper ["Tamoxifen induction of Cre recombinase does not cause long-lasting or sexually divergent responses in the CNS epigenome or transcriptome: implications for the design of aging studies"](https://link.springer.com/article/10.1007/s11357-019-00090-2), and focuses on the potential side effects of Tamoxifen treatment, widely used to induce CreERT2 activity in transgenic mouse systems. Tamoxifen acts as an antagonist of estrogen receptor (ER), which could cause differences in response across sexes.

![](Screenshot 2024-06-17 at 14.55.37.png)
![](Screenshot%202024-06-17%20at%2014.55.37.png)

# Loading data in R

Expand All @@ -54,15 +54,14 @@ saveRDS(devtools::session_info(), "session_info_recount3.rds")

# Read in data

Raw and processed data are available from GEO [(accession GSE135752)](GEO: https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE135752)
Raw and processed data are available from GEO [(accession GSE135752)](GEO:%20https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE135752)

Today we will load directly the reprocessed data from the [recount3 project](https://genomebiology.biomedcentral.com/articles/10.1186/s13059-021-02533-6), a project which reprocessed uniformly thousands of bulk RNA-seq datasets from human and mouse. A [Bioconductor package](https://bioconductor.org/packages/3.17/bioc/html/recount3.html) allows to easily retrieve this data in the form of standard Bioconductor classes objects, such as `RangedSummarizedExperiment`.

![](wrench-and-hammer.png) Connect to the [recount3 study explorer](https://jhubiostatistics.shinyapps.io/recount3-study-explorer/) Shiny app and search for our dataset (accession "SRP218156").

![](elemental-tip.png) Another database of reprocessed datasets is GREIN, which provides interesting QC figures that could be helpful: http://www.ilincs.org/apps/grein/?gse=GSE135752


```{r}
## retrieve data frame listing all available projects in mouse
all_projects <- available_projects(organism = "mouse")
Expand All @@ -73,6 +72,7 @@ rse_gene <- create_rse(project_info = selected)
```

# Examine RangedSummarizedExperiment object

```{r}
## The recount project records the sum of the base level coverage for each gene. These raw counts have to be transformed to "classical" read-counts to be processed by standard DE analysis tools
assayNames(rse_gene)
Expand Down Expand Up @@ -104,6 +104,7 @@ rse_gene <- aggregateAcrossCells(rse_gene,
```

# Add metadata columns

```{r}
## Simplify metadata columns of interest by parsing "sra.sample_attributes"
rse_gene$sex <- factor(strsplit2(rse_gene$sra.sample_attributes, split = "\\|")[,2])
Expand All @@ -130,12 +131,14 @@ table(rse_gene$sex, rse_gene$treatment, rse_gene$tissue)
```

# Convert to DGEList object

```{r}
dge <- SE2DGEList(rse_gene)
saveRDS(dge, "DGEList.rds")
```

# Convert to DESeqDataSet object

```{r}
dds <- DESeqDataSet(rse_gene, design = ~ 1)
saveRDS(dds, "DESeqDataSet.rds")
Expand Down

0 comments on commit ef55769

Please sign in to comment.