Question: Normalisation in edgeR
0
gravatar for tkapell
20 months ago by
tkapell0
University of Bonn, Germany
tkapell0 wrote:

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.

Thanks,

Theo
 

ADD COMMENTlink modified 20 months ago by Gordon Smyth39k • written 20 months ago by tkapell0

Read the posting guide and give us some code.

ADD REPLYlink modified 20 months ago • written 20 months ago by Aaron Lun25k

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.

ADD REPLYlink written 20 months ago by Gordon Smyth39k

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"))

 

ADD REPLYlink written 20 months ago by tkapell0
Answer: Normalisation in edgeR
3
gravatar for Gordon Smyth
20 months ago by
Gordon Smyth39k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth39k wrote:

does CalcNormFactors simply calculate the size factors to be applied to the different libraries

Yes, that is exactly what it does. It does what the documentation says it does!

or does it actually normalize them?

There is no such thing as a "normalized count", as I have said many times on this help forum. The edgeR User's Guide tells you that:

"Note that normalization in edgeR is model-based, and the original read counts are not themselves transformed."

I therefore wondered whether one should apply a cpm or another method on top or not.

Yes, certainly you need to use cpm() or rpkm() if you want to see normalization effects. Just follow the documentation and examples.

 

ADD COMMENTlink modified 20 months ago • written 20 months ago by Gordon Smyth39k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 236 users visited in the last hour