Hi all-

Apologies if this question has been asked before, but I couldn't find anything on biostars or elsewhere which quite captured what I am trying to do.

I have two sets of ChIP-seq peaks (WT and KO) that I have assigned to the nearest genes. So, I now have three lists of genes: one list for the genes which have a peak in both datasets, one list of genes that only appears in the WT dataset, and one list of genes that only appears in the KO dataset. What I would like to do now is perform some kind of differential gene ontology analysis between the peaks that appear only in the WT or only in the KO. In other words, my desired output would look something like "genes with peaks associated only in the WT sample are associated with GO term X, while genes associated with peaks only in the KO sample are associated with GO term Y, indicating that the KO sample loses peaks associated with term X and gains peaks associated with term Y." Can someone point me in the right direction?

Thanks!
You could give clusterProfiler a shot using `compareCluster()`. You'd need to prepare a data frame where each column is a gene list and then do something like:

    require(clusterProfiler)
    require(enrichplot)
    require(org.Hs.eg.db)

    cluster <- compareCluster(geneClusters = df, fun = "enrichGO", keyType = "YOUR_GENE_IDENTIFIER_TYPE", org = org.Hs.eg.db)

   

     dotplot(cluster)
You'd need to swap out org.Hs.eg.db for another organism database if not human.

Vignette for clusterProfiler here: https://yulab-smu.github.io/clusterProfiler-book/chapter11.html
