enrichplot
enrichplot copied to clipboard
Coloring according to FoldChange not working in cnetplot & heatplot
Hello,
The coloring according to foldChange does not work anymore in enrichplot v1.17.0.992. colorEdge
works, & colors the edges according to the GO-term.
Does anyone have a solution for this?
Code used for the plots:
ego: object obtained after enrichGo:
ego <- enrichGO(
gene = significant_genes_subset$X,
universe = lfcShrink$X,
OrgDb = "org.Hs.eg.db",
ont = ontology,
pAdjustMethod = "BH",
pvalueCutoff = 0.01,
qvalueCutoff = 0.05,
keyType = "SYMBOL",
readable = TRUE
Ranks: list of all genes, ranked according to log2FC:
# Get the log2FC's
ranks <- lfcShrink$log2FoldChange
names(ranks) <- lfcShrink$X
# order
ranks <- sort(ranks, decreasing = TRUE)
> head(ranks)
GeneA GeneB GeneC GeneD GeneE GeneF
5.984348 4.246991 4.026583 3.911474 3.537489 3.524291
> tail(ranks)
GeneT GeneU GeneV GeneW GeneX GeneY
-7.802852 -8.205668 -8.446749 -8.636785 -9.270933 -9.693169
p1 <- cnetplot( ego, foldChange = ranks, colorEdge = TRUE)
p1 <- heatplot(ego, showCategory = 5, foldChange = ranks)