Skip to content

Instantly share code, notes, and snippets.

@jnhutchinson
Created July 27, 2017 18:54
Show Gist options
  • Save jnhutchinson/9e50e22a7ca2899c08a3cb30ede42f42 to your computer and use it in GitHub Desktop.
Save jnhutchinson/9e50e22a7ca2899c08a3cb30ede42f42 to your computer and use it in GitHub Desktop.
Custom GSEA
# run clusterprofiler
all.results.gsea <- all.results[[1]]$stats.eset # these are all the statistical results from running DESeq2
lfcs <- all.results.gsea$log2FoldChange # the log fold changes from the comparison
names(lfcs) <- all.results.gsea$entrezID # I previously annotated the stats results with the entrezids using biomart
lfcs <- sort(lfcs, decreasing=TRUE)
results = GSEA(lfcs, TERM2GENE=set2gene, minGSSize=200, maxGSSize=1700) # my set2gene was just a two column dataframe with the geneset id in the first column and the entrez gene ids in the second
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment