enrichplot icon indicating copy to clipboard operation
enrichplot copied to clipboard

Coloring according to FoldChange not working in cnetplot & heatplot

Open DCarbonez opened this issue 1 year ago • 2 comments

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)

image

p1 <- heatplot(ego, showCategory = 5, foldChange = ranks) image

DCarbonez avatar Feb 02 '23 14:02 DCarbonez