Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

May I ask for the code used to generate Figure S3? #10

Open
levinhein opened this issue Feb 8, 2021 · 1 comment
Open

May I ask for the code used to generate Figure S3? #10

levinhein opened this issue Feb 8, 2021 · 1 comment

Comments

@levinhein
Copy link

May I ask for the code used to generate Figure S3? Thank you!

@miaozhun
Copy link
Owner

miaozhun commented Apr 22, 2021

Sure.

library(gplots)
library(RColorBrewer)

sampleNum_1 <- sum(group == 1)
sampleNum_2 <- sum(group == 2)

results.DEs <- results.sig[results.sig$Type == "DEs", ]
results.DEa <- results.sig[results.sig$Type == "DEa", ]
results.DEg <- results.sig[results.sig$Type == "DEg", ]

counts_norm.DEs <- counts_norm[row.names(results.DEs)[1:500],]
counts_norm.DEa <- counts_norm[row.names(results.DEa)[1:500],]
counts_norm.DEg <- counts_norm[row.names(results.DEg)[1:500],]

counts_norm.three <- rbind(counts_norm.DEs, counts_norm.DEa, counts_norm.DEg)
counts_norm.three_log <- log(counts_norm.three + 1)
mainText <- "Top 500 of each of the 3 types DE genes"
heatmap.2(counts_norm.three_log, col = c("blue", rev(heat.colors(255))), lhei = c(1,5.7), RowSideColors = c(rep("green", nrow(counts_norm.DEs)), rep("yellow", nrow(counts_norm.DEa)), rep("purple", nrow(counts_norm.DEg))), ColSideColors = c(rep("red", sampleNum_1), rep("darkblue", sampleNum_2)), dendrogram = "row", Colv = F, scale = "none", labRow = NA, labCol = NA, trace="none", main = mainText)
legend(0.32, 1.04, legend = c("E3", "E4", "DEs", "DEa", "DEg"), horiz = T, col = c("red", "darkblue", "green", "yellow", "purple"), pch = 15, pt.cex=2, xpd=TRUE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants