This is a test version of Biostars. For the public version, visit https://www.biostars.org.
RNA seq normalization(TMM)

i have htseq-count data now i want to normalize it using TMM for diffrential expression analysis .can anybody tell me how to do this Thanking in anticipation

rna-seq r gene

1 answer

The edgeR User Guide is an excellent read, and has the answer to this question, and probably the answer to some questions you will have in the near future.

can you please guide me in the form of code because i am new with R

library(edgeR)
#TMM Normalisation
lib.size <- sum(d$sample1)
scale.factors <- calcNormFactors(TMM$sample1, method = "TMM")
norm.data <- t(t(TMM$sample1)/(scale.factors*lib.size))
write.csv(norm.data,"/home/TMM.csv")

lib.size <- sum(d$sample1) is it calculating library size of just one sample??? d is the name of file object that contain counts??

Read the edgeR User Guide, it has plenty of code examples to guide you through the whole analysis, from the very beginning to the very end. Then, if /when you have difficulties, show us how is your data (ideally, with a small example), tell us what you did (the code), and the error you got.

The Similar Posts links to the right are also a great resource, and indeed I found one link with code and explanations about TMM normalization which would probably be very helpful to you.

i have run this code but no file is created even after the program is executed successfully and no error message appears

library(edgeR)
seqdata <- read.delim("C:\\Users\\hp folio\\Desktop\\TCGA-DLBC.htseq_counts.tsv")
scale.factors <- calcNormFactors(seqdata,lib.size=NULL method = "TMM")
norm.data <- t(t(seqdata)/(scale.factors*lib.size))
write.csv(norm.data,"C:\\Users\\hp folio\\Desktop\\TMM.csv")

I suspect that you have a problem on write.csv line. Check your path is correct or not.

if path is incorrect at least it must show some error... and i checked there is no problem in path

if path is incorrect at least it must show some error... and i checked there is no problem in path

Log in to answer this question.