Identifying common DEGs among multiple datasets
1
2
Entering edit mode
15 months ago
Shma ▴ 20

Hello everyone,

I desperately need help here. I have microarray and RNA-seq datasets on which I performed, individually, DEGs analysis using GEO2R. Now I need to find the common DEGs between all these datasets using R.

I am very lost and confused about the next steps, as the internet is overwhelmingly full of tutorials and most of them are for comparing only two datasets (not multiple)

I am a beginner and I really need help in this as my time is running out

Any guidance is highly appreciated

Thank you!

R DEG • 982 views
ADD COMMENT
0
Entering edit mode

If you already have DE results, you can merge your different DE results using merge function and find common DE genes-

# merge two DE data frames by gene_id
common12 <- merge(DE_set1, DE_set2 ,by="gene_id")
ADD REPLY
4
Entering edit mode
15 months ago
Barry Digby ★ 1.3k

Return a vector of common DEGs

dataset1 <- read.csv("dataset1.csv", header=T)
dataset2 <- read.csv("dataset2.csv", header=T)

head(dataset1)
    Gene     logFC  AveExpr         t      P.Value   adj.P.Val        B
1   MAOA -6.679361 6.726295 -32.72261 4.120941e-15 3.56476e-11 24.50716
2  PRKD1 -5.554521 6.771339 -31.54545 6.999959e-15 3.56476e-11 24.26388
3   KLK3 -4.327225 8.363903 -30.63718 1.067627e-14 3.56476e-11 24.10586

common_genes <- Reduce(intersect, list(dataset1$Gene, dataset2$Gene))

You might be interested in capturing DEGs that exhibit the same fold change direction across your experiments and averaging their logFC values

library(dplyr)
dataset1$experiment = "experiment1"
dataset2$experiment = "experiment2"

intersection = rbind(dataset1, dataset2)
# Adjust >=2 to the number of datasets you are merging
intersection = intersection %>% group_by(Gene) %>% filter(length(unique(experiment))>=2) %>% ungroup()
intersection = intersection %>% group_by(Gene) %>% filter(all(logFC>0) | all(logFC<0)) %>% ungroup()
intersection = intersection %>% group_by(Gene) %>% summarise(average_LFC = mean(logFC))
ADD COMMENT

Login before adding your answer.

Traffic: 1807 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6