**YGC » R**, and kindly contributed to R-bloggers)

To simplify enriched GO result, we can use slim version of GO and use *enricher* function to analyze.

Another strategy is to use GOSemSim to calculate similarity of GO terms and remove those highly similar terms by keeping one representative term. To make this feature available to clusterProfiler users, I develop a *simplify* method to reduce redundant GO terms from output of *enrichGO* function.

^{?}View Code RSPLUS

1 2 3 4 5 |
require(clusterProfiler) data(geneList, package="DOSE") de <- names(geneList)[abs(geneList) > 2] bp <- enrichGO(de, ont="BP") enrichMap(bp) |

The *enrichMap* doesn’t display the whole picture as we use the default value *n=50* to only show 50 highly significant terms. In the *enrichMap*, we can found that there are many redundant terms form a highly condense network.

Now with the *simplify* method, we can remove redundant terms.

^{?}View Code RSPLUS

The *simplify* method apply *‘select_fun’* (which can be a user defined function) to feature ‘*by*‘ to select one representative terms from redundant terms (which have similarity higher than ‘*cutoff*‘).

The simplified version of enriched result is more clear and give us a more comprehensive view of the whole story.

*enrichGO* test the whole GO corpus and enriched result may contains very general terms. *clusterProfiler* contains a *dropGO* function to remove specific GO terms or GO level, see the issue. With *simplify* and *dropGO*, enriched result can be more specific and more easy to interpret. Both of these functions work fine with outputs obtained from both *enrichGO* and *compareCluster*.

#### Related Posts

**leave a comment**for the author, please follow the link and comment on their blog:

**YGC » R**.

R-bloggers.com offers

**daily e-mail updates**about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...