Hi, I am performing differential expression (DEG) analysis using DESeq2. I have no replicates, and I understand that without replicates, it is useless to conduct this analysis. However, I have no other option. I have created an R script for cases with no replication. Could you please review it and provide your suggestions?
It will be great helpful for me to complete my work
Load required libraries
library(DESeq2)
Read in the count data
count_data <- read.csv("count.csv", header = TRUE, row.names = 1) head(count_data)
Filter low count genes
keep <- rowSums(count_data >= 10) > 0 count_data_filtered <- count_data[keep, ]
Create metadata
metaData <- data.frame("Condition" = c("COL", "COB")) metaData$Condition = factor(metaData$Condition, levels = c("COL", "COB")) rownames(metaData) = colnames(count_data)
Check metadata
head(metaData) all(rownames(metaData) == colnames(count_data))
Create DESeqDataSet object
dds = DESeqDataSetFromMatrix(countData = count_data_filtered, colData = metaData, design = ~Condition)
Estimate size factors
dds <- estimateSizeFactors(dds)
Set a fixed dispersion value
dispersions(dds) <- 0.1
Run DESeq without dispersion estimation
dds <- nbinomWaldTest(dds)
Get results
res <- results(dds)
Order results by adjusted p-value
resOrdered <- res[order(res$padj), ]
Summary of differential expression
summary(res)