CompareCluster with your own gene set
Hello,
Great package! I was glad to find the compareCluster capability since I have numerous samples that I want to compare. Found that I can use the predefined gene sets in clusterProfiler, as gseGO, but I cant figure out how to do the analysis with my own gene set. What do I put in fun= to make it work? Tried enricher function but cant get it to work. Grateful for an example. Best Henrik
You can use fun = GSEA or fun = enricher in compareCluster, TERM2GENE should be a data.frame of 2 column with term and gene:
compareCluster(fun = GSEA, TERM2GENE = Your_gene_set, ...)
Hello,
I also want to compare GSEA results for multiple samples with own gene sets. From what I understood, the geneClusters argument takes a list of the geneLists of each sample. But what about the TERM2GENE argument? I tried giving it a list of the individual TERM2GENE data frames of each sample, but I got the error:
> geneClustersList <- list(C325_geneList_chr, CF13_geneList_chr, H53_geneList_chr, J57_geneList_chr, K147_geneList_chr)
> t2g_list <- list(C325_t2g_chr_BP, CF13_t2g_chr_BP, H53_t2g_chr_BP, J57_t2g_chr_BP, K147_t2g_chr_BP)
> compareCluster(geneClustersList, fun=GSEA, TERM2GENE=t2g_list)
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, :
arguments imply differing number of rows: 4632, 3522, 3075, 3074, 3088
Does it have to be a single data frame with all the individual data frames concatenated? In this case, since GeneIDs are not unique between samples, how should we indicate to which sample corresponds each row in the TERM2GENE table?
Thanks!