Hello, Dears, I have questions and I want your kind help?
I did gene filtering as below in edgeR which is exactly the same with my filtered genes in DESeq2 which I did before and I like that because I had a thought I may get different numbers of genes. Maybe you could comment to me here.
## edgeR
y2 <- DGEList(counts = count, group = factor(Sample_data[,2]))
keep <- rowSums(y2$counts >= 50) >= 59
y2 <- y2[keep, , keep.lib.sizes=FALSE]
nrow(y2) # 10685
## DESeq2
dds <- DESeqDataSetFromMatrix(countData = countMatrix, colData = colData, design = ~gender)
keep <- rowSums(counts(dds) >= 50) >= 59
dds <- dds[keep,]
nrow(dds) # 10685
My question here are two:
how to do normalization in edger? I mean, Is it enough using the function (
y2 <- calcNormFactors(y2, method = “TMM”)) or still, I have to convert this to CPM? or Just using CPM is enough without prior use of calcNormFactor ()?How to export significant genes as a CSV file plus how to extract significant and normalized genes for heatmap visualization?
Thank you so much?
2 answers
just use calcNormFactor after y2 <- y2[keep, , keep.lib.sizes=FALSE]
y <- calcNormFactors(y)
You can use the top DE genes to save a csv file, something like this:
et <- exactTest(y, pair=c("Group_1", "Group_2"))
topet <- topTags(et, n=Inf, adjust.method="BH", sort.by="PValue", p.value=1)
write.csv(as.data.frame(topet), file="path/to/results_EdgeR.csv")
Hope it helps
- Just use
calcNormFactors(). CPMs are never used for statistics. - You can write data frames to a text file with
write.csv(). There are hundreds of ways to make heatmaps, see the edgeR vignette or google around for examples.
Log in to answer this question.
Hello wolideamare!
It appears that your post has been cross-posted to another site: https://support.bioconductor.org/p/129842/
This is typically not recommended as it runs the risk of annoying people in both communities.
Hi, I am sorry. I will not do it in the future!
To sum this up you have now two users here saying "follow the manual" and the edgeR senior author over at Bio saying "follow the manual", so this should be the way to go ;-)