GSEA analysis requires a ranked gene list, which contains three features:
numeric vector: fold change or other type of numerical variable
named vector: every number has a name, the corresponding gene ID
sorted vector: number should be sorted in decreasing order
If you import your data from a csv file, the file should contains two columns, one for gene ID (no duplicated ID allowed) and another one for fold change. You can prepare your own geneList via the following command:
d=read.csv(your_csv_file)## assume 1st column is ID## 2nd column is FC## feature 1: numeric vectorgeneList=d[,2]## feature 2: named vectornames(geneList)=as.character(d[,1])## feature 3: decreasing ordegeneList=sort(geneList, decreasing =TRUE)
By default, all the visualization methods provided by enrichplot display most significant pathways. If users are interested to show some specific pathways (e.g. excluding some unimportant pathways among the top categories), users can pass a vector of selected pathways to the showCategory parameter in dotplot(), barplot(), treeplot(), cnetplot() and emapplot() etc.
(ref:selectedPathsscap) Showing specific pathways.
(ref:selectedPathscap) Showing specific pathways. Top ten most significant pathways (A), selected ten pathways (B).
library(DOSE)library(enrichplot)data(geneList)de<-names(geneList)[1:100]x<-enrichDO(de)## show top 10 most significant pathways and want to exclude the second one## dotplot(x, showCategory = x$Description[1:10][-2])set.seed(2020-10-27)selected_pathways<-sample(x$Description, 10)selected_pathways
Most of the functions in enrichplot can automatically split long labels across multiple lines. Users can passed a line width to the label_format parameter (default is 30). It also supports user defined function to format label strings.
(ref:formatLabelscap) Wrap long axis labels.
(ref:formatLabelcap) Wrap long axis labels. Passing a numeric value to specify string width (A), a user specifiable labeller function (B).