Thank you Anthony. As you have mentioned and as the information on the website I tried using the Deseq2 normalised counts for GSEA however no matter what I do I'm unable to get any data in FDR 25% section using the permutation phenotype.
I have removed the gene rows with less expression. This is also with a particular condition called stable (12 samples with replicates of clones) and not with the other condition named unstable (10 samples with replicate of clone data).
For more context, I have labelled the clone data I have as stable or unstable based on a parameter and then I'm trying to run GSEA. I have RNASeq salmon files for these clones which are in replicates.
Please do help or suggest me something that can help improve my data.
This is the code I'm currently using to normalise the data.
#libraries
install_if_missing <- function(packages) {
if (length(setdiff(packages, rownames(installed.packages()))) >0) {
install.packages(setdiff(packages, rownames(install.packages())))
}
}
#libraries
library(tximport)
library(dplyr)
library(ggplot2)
library(DESeq2)
library(readxl)
library(readr)
files <- list.files(path = "path", pattern = ".sf", full.names = TRUE, recursive = TRUE)
sample_names <- basename(files) %>% gsub(".sf", "", .)
input_path <- "path"
tx2gene <- read_excel(input_path)
head(tx2gene)
txi <- tximport(
files,
type = "salmon",
tx2gene = tx2gene,
)
#creating metadata and condition data
meta<- data.frame(condition = c("unstable","unstable", "unstable", "unstable", "stable", "stable", "stable", "stable",
"unstable", "unstable", "unstable", "unstable", "unstable", "unstable", "unstable", "unstable",
"unstable", "unstable", "unstable", "unstable", "stable", "stable", "unstable", "unstable", "unstable", "unstable"
))
colnames(txi$counts) <- sample_names
rownames(meta)<- colnames(txi$counts)
meta
#creating normalised counts using deseq2
dds <- DESeqDataSetFromTximport(txi, colData = meta, design = ~ condition)
#perform DESeq2 analysis (this normalises the data)
dds <- DESeq(dds)
#Get the normalised counts
normalized_counts <- counts(dds, normalized = TRUE)
colnames(normalized_counts) <- sample_names
# Now view it
head(normalized_counts)
print(normalized_counts)
write.csv(normalized_counts, file = "normalized_counts.csv", row.names = TRUE)