Created
June 27, 2022 09:14
-
-
Save dBenedek/ce94653f21cb581c9acbe17032da8ec3 to your computer and use it in GitHub Desktop.
[DE DESeq2] Basic differential expression with DESeq2 #DE #DESeq2 #R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("tidyverse") | |
library("DESeq2") | |
# Create DESeq2 object: | |
dds <- DESeqDataSetFromMatrix(count_data, | |
colData = col_data, | |
design = ~ group) | |
# Run DE: | |
dds <- DESeq(dds) | |
res <- results(dds, contrast=c("group","1","2")) # group 1 compared to group 2 | |
# Reformat: | |
res <- res %>% | |
as.data.frame() %>% | |
rownames_to_column("gene") %>% | |
arrange(padj) %>% | |
column_to_rownames("gene") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment