clusterProfiler and enrichplot: visualising groupGO results with individual genes and their fold changes
2
0
Entering edit mode
7 months ago
Ali May • 0

Hi,

I'm using the groupGO command in clusterProfiler to group a subset of (e.g. significantly DE) genes under GO terms. I would like to visualise the results where the relationship between the GO terms, the genes, and their fold changes are shown. To this end, I'm trying to use the cnetplot function, but the plot I get is incorrect (contains nonsensical terms/nodes). I believe this is because the input to cnetplot is supposed to be an enrichment result object, not a groupGO object.

Is there a way to achieve this, i.e. visualising results from groupGO where individual genes and their fold changes etc. are displayed with their ontology terms? The appoach I'm taking which gives non-sensical cnetplots plots is the following:

        ggo <- groupGO(gene     = filt_gene_fc_entrezid,
OrgDb    = org.EcK12.eg.db,
ont      = 'BP',
level    = 3,

cnetplot(ggo, showCategory=5,
categorySize="pvalue",
foldChange=geneList,
order=TRUE)


filt_gene_fc_entrezid is a vector of gene names that are filtered for a certain log2 fold change value. geneList is an object that has the fold change information for genes in filt_gene_fc_entrezid.

clusterProfiler enrichplot • 964 views
0
Entering edit mode

the documentation says: "gene - a vector of entrez gene id.", while you supply fold-changes, so my suggestion to to supply a vector of genes.

0
Entering edit mode

filt_gene_fc_entrezid is a vector of genes but apparently also a badly chosen variable name. It's a vector of genes that are filtered for a certain log2 fold change value. I edited the OP

0
Entering edit mode

I think your original post was saying vector of foldchanges, but ok

1
Entering edit mode
7 months ago

Hi Ali,

Take a look at this page which gives a great explanation about analysis with clusterProfiler (focused on ORA analysis) and visualization of results. You can use the next code to perform your analysis and save lines of code for generating results

#Generate a named vector containing log2FC values and entrezid
x <- my_list_of_log2_filt_genes
filt_gene_fc_entrezid <- x$log2FC names(filt_gene_fc_entrezid) <- x$entrezid

#Run groupGO using the names of the vector
ggo <- groupGO(gene     = names(filt_gene_fc_entrezid),
OrgDb    = org.EcK12.eg.db,
ont      = 'BP',
level    = 3,

cnetplot(ggo, showCategory=5,
categorySize="pvalue",
foldChange=geneList,
order=TRUE)


Best regards!

Rodo

0
Entering edit mode

Hi Rodo,

Thanks for your input. But in this case I am only interested in grouping a selection of genes under the GO terms they belong to and plotting the result including the fold-changes, not performing an enrichment or an over-representation analysis. That's why I would like to plot the output of groupGO, not enrichGO (by the way your reply mentions over-represetntation analysis (enrichGO) but the function in your code is groupGO )

0
Entering edit mode

Hi Ali,

You are right, those are different analysis (Now is corrected in the proposed code). It looks like that cnetplot is dedicated to work only on the output of enrichment results... Reviewing the manual of clusterProfiler the output of groupGO should be plotted with the plot function.

Best regards!

0
Entering edit mode
11 weeks ago
Guangchuang Yu ★ 2.5k

should works with groupGO output exactly like using enrichGO output.

If not, pls post a reproducible example to the github repo