Open ppdpg opened 7 months ago
@huerqiang
Without showing any code it is impossible to give some help, but maybe this post (from huerqiang) is of relevance: https://github.com/YuLab-SMU/enrichplot/issues/268#issuecomment-1916709290
Here is the code for the dotplot p1<- dotplot(upkegg,x = "GeneRatio",color="qvalue",font.size=10, showCategory = 20, label_format = 40,orderBy="qvalue",decreasing = F, title = 'KEGG Pathway enrichment of up-regulated EmuH-liver vs EmuL-liver')+ theme(plot.title = element_text(hjust = 0.5))
p2<- dotplot(downkegg2,x = "GeneRatio",color="qvalue",font.size=10, showCategory = 20,label_format = 40,orderBy="qvalue",decreasing = F, title = 'KEGG Pathway enrichment of down-regulated EmuH-liver vs EmuL-liver')+ theme(plot.title = element_text(hjust = 0.5))
keggall<- cowplot::plot_grid(p1, p2, labels=c("A", "B"), rel_widths=c(1, 1))
I can reproduce your problem, but unfortunately I don't have a solution for it. It seems it is being caused by the function plot_grid
.... Maybe, when calling plot_grid
, some additional arguments could be given to prevent this change from happening?
> library(clusterProfiler)
> library(enrichplot)
>
> ## load example data
> data(geneList, package="DOSE")
>
> genes.up <- names(geneList)[abs(geneList) > 2]
> genes.down <- names(geneList)[abs(geneList) < 2]
>
>
> upkegg <- enrichKEGG(gene = genes.up,
+ organism = 'hsa',
+ pvalueCutoff = 0.05)
>
> downkegg <- enrichKEGG(gene = genes.down,
+ organism = 'hsa',
+ pvalueCutoff = 0.05)
>
> library(ggplot2)
>
> ## note: showCategory limited to 5
> p1 <- dotplot(upkegg, x = "GeneRatio",color="qvalue",font.size=10,
+ showCategory = 5, label_format = 40,orderBy="qvalue",decreasing = FALSE,
+ title = 'KEGG Pathway enrichment of up-regulated EmuH-liver vs EmuL-liver') +
+ theme(plot.title = element_text(hjust = 0.5))
>
> p2 <- dotplot(downkegg, x = "GeneRatio",color="qvalue",font.size=10,
+ showCategory = 5,label_format = 40,orderBy="qvalue",decreasing = FALSE,
+ title = 'KEGG Pathway enrichment of down-regulated EmuH-liver vs EmuL-liver') +
+ theme(plot.title = element_text(hjust = 0.5))
>
>
> #Put p1 and p2 into one figure
> keggall <- cowplot::plot_grid(p1, p2, labels=c("A", "B"), rel_widths=c(1, 1))
>
>
> print(p1)
>
> print(p2)
>
> print(keggall)
>
p1
:
p2
:
keggall
:
When I combine two dotplot figures of the KEGG pathway and GO enrichment results (p1 and p2) into one figure using both patchwork and cowplot::plot_grid, the shape of the point changed from hollow to solid (p3) in the legend of the combined figure.