I have an rna-seq expression matrix and I used Deseq2 to compare gene expression between two groups of in my dataset. I then wanted to to sort the genes I got from Deseq2 according to their levels of expression, and I used the varianceStabilizingTransformation (vsd) to get the normalized expression data.
The problem I had is the following:
When I changed one of the groups (omitted few samples), and applied again the vsd function, I saw that the expression levels of some genes actually changed for samples that were not removed from the dataset. That is, the expression values for the samples that remained in the dataset were changed just by omitting other samples from the dataset.
Is there a way to get a normalized matrix with expression values for each sample that does not depend on other samples?
This is my code:
ep<-read.table("expression.txt",header = TRUE, row.names = 1) cp<-read.csv("metadata.csv") dds <-DESeqDataSetFromMatrix(countData = ep,colData = cp,design =~Group) dds <- estimateSizeFactors(dds) vsd <- varianceStabilizingTransformation(dds)