Set-up DESeq2 analysis - Answer Key
Exercise 1
Take a look at the results table
propres
. Which celltypes show a significant change in composition between TN and cold7?Does this line up with what we observed in the counts table?
Will Gammerdinger, Noor Sohail
September 5, 2025
Take a look at the results table propres
. Which celltypes show a significant change in composition between TN and cold7?
Does this line up with what we observed in the counts table?
---
title: "Set-up DESeq2 analysis - Answer Key"
authors: "Will Gammerdinger, Noor Sohail"
date: "Friday, September 5, 2025"
editor_options:
markdown:
wrap: 72
---
```{r}
#| label: load_data_libraries
#| echo: false
# Load libraries
library(Seurat)
library(DT)
library(tidyverse)
library(speckle)
library(sccomp)
seurat <- readRDS("data/BAT_GSE160585_final.rds")
seurat_sub <- subset(seurat, subset = (condition %in% c("TN", "cold7")))
# Create metadata df and factor celltype
meta_sub <- seurat_sub@meta.data
meta_sub$celltype <- factor(meta_sub$celltype)
meta_sub$condition_sample <- paste0(meta_sub$condition, "_", meta_sub$sample)
# Run differential proportion analysis
propres <- propeller(seurat_sub,
sample=seurat_sub$sample,
clusters = seurat_sub$celltype,
group = seurat_sub$condition)
props <- getTransformedProps(meta_sub$celltype,
meta_sub$condition_sample,
transform="logit")
props_df <- props$Proportions %>%
as.data.frame() %>%
mutate(condition = str_split_i(sample, "_", 1))
props_df_summary <- props_df %>%
group_by(clusters, condition) %>%
summarise(mean = mean(Freq), sd = sd(Freq))
```
# Exercise 1
1. Take a look at the results table `propres`. Which celltypes show a significant change in composition between TN and cold7?
2. Does this line up with what we observed in the counts table?