I got DEG data from Seurat scRNA-seq and really want to draw the GSEA plot on Rstudio. I found the easiest method (https://bioinformaticsbreakdown.com/how-to-gsea/).
Here is the code I used.
tmp = read.csv("/Directory/DEG.csv", header = TRUE) %>% filter(Gene.Symbol !="")
> GO_file = "/Directory/c5.bp.v6.2.symbols.gmt" # I got this from http://www.gsea-msigdb.org/gsea/msigdb/collections.jsp > gene_list = tmp$avg_log2FC > names(gene_list) = tmp$Gene.Symbol > gene_list = sort(gene_list, decreasing = TRUE) > gene_list = gene_list[!duplicated(names(gene_list))] > head(gene_list) > res = GSEA(gene_list, GO_file, pval = 0.05)
The very last step caused an error as follow.
> Error in build_Anno(TERM2GENE, TERM2NAME) : argument "TERM2GENE" is missing, with no default
Do you guys figure out what's going on here? Could you add the code for me to complete this work?