I am using the clusterProfiler methods enrichGO and dotplot to do some downstream differential expression analysis. I invoke enrichGO with the following call:
formula_res = compareCluster(`EntrezGene ID~Direction+Treatment, data=filtered_data, fun="enrichGO", OrgDb="org.Hs.eg.db", ont="BP", qvalueCutoff= 0.2, readable=TRUE)
where filtered_data is a dataframe with the follwoing columns:
Gene, EntrezGene ID, Gene Stable ID, Name, Treatment, Direction
Then, plot via the call to dotplot:
p = dotplot(formula_res, showCategory=10, title="test", font.size=9, includeAll = TRUE)
I am surprised that if I have in my data frame 8 unique combinations of treatment and direction (Ex: four different treatments with both up and down regulated genes for each) my dotplot often outputs less groups. For instance, I often get a plot with six groups shown despite having eight "input groups" (as defined by unique combination of direction + treatment).
I have read the documentation and tried setting showCategory to NULL instead of 10, which the documentation says should force a return of all groups, but still not all treatments are included. Am I missing something obvious on this one? I want to verify my results are not erroneous.