I tried to normalize my data in edgeR as instructed in the respective vignette. I calculated CalcNormFactors and then proceeded with estimating the dispersion as usual. However, when I visualized my data in a boxplot, they still look the same as the unnormalized. My dataset was a single factor experiment with 4 different levels. So, my question is: does CalcNormFactors simply calculate the size factors to be applied to the different libraries or does it actually normalize them? I therefore wondered whether one should apply a cpm or another method on top or not.
We don't know what you mean by "visualized my data". Until you tell us what you did in more detail, we can't answer your question. Obviously, calcNormFactors does not change the raw data so, if you're just looking at that, you won't see any change.
By "visualised the data" I mean plotting boxplots of the stacked gene values of all my samples. Below is the code I used for the "visualisation" of the unnormalised data:
Read the posting guide and give us some code.
We don't know what you mean by "visualized my data". Until you tell us what you did in more detail, we can't answer your question. Obviously, calcNormFactors does not change the raw data so, if you're just looking at that, you won't see any change.
By "visualised the data" I mean plotting boxplots of the stacked gene values of all my samples. Below is the code I used for the "visualisation" of the unnormalised data:
unnorm.data<-stack(as.data.frame(log2(data.dge.removed$counts+1)))
colnames(unnorm.data)<-c("Reads",'Sample')
unnorm.data$Condition<-sample_info$condition[unnorm.data$Sample]
ggplot(unnorm.data, aes(x=Sample,y=Reads, fill=Condition))+
geom_boxplot()+
labs(title="Unnormalized reads")+
theme(panel.background = element_rect(fill=NA, color = "black"),
plot.background = element_blank(),
aspect.ratio = 0.5,
legend.background = element_blank(),
plot.title = element_text(face = "bold", hjust = 0.5),
strip.background = element_rect(fill = NA, color = "black"),
axis.text.x = element_text(angle = 270, vjust=0.5),
axis.line = element_line(colour = "black", size = 1),
axis.text = element_text(colour = "black", size = 10, face = "bold"),
axis.ticks = element_line(color = "black",size = 1),
axis.title.x = element_blank(),
axis.title.y = element_text(colour = "black", size = 10, face = "bold"),
legend.key = element_rect(fill = "white"))