clusterProfiler and enrichplot: visualising groupGO results with individual genes and their fold changes
2
0
Entering edit mode
3.7 years 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,
                       readable = TRUE)

        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.

Thanks in advance, Ali

clusterProfiler enrichplot • 5.5k views
ADD COMMENT
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.

ADD REPLY
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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
2
Entering edit mode
3.7 years 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,
                       readable = TRUE)

#Plot your results
cnetplot(ggo, showCategory=5,
                      categorySize="pvalue",
                      foldChange=geneList,
                      order=TRUE)

Best regards!

Rodo

ADD COMMENT
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 )

ADD REPLY
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!

ADD REPLY
0
Entering edit mode
3.3 years ago
Guangchuang Yu ★ 2.6k

should works with groupGO output exactly like using enrichGO output.

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

ADD COMMENT

Login before adding your answer.

Traffic: 1915 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6