Instantly share code, notes, and snippets.

What would you like to do?
To resolve an error when running ReactomePA (Error in levels <- ... factor level is duplicated Calls: ... fortify.enrichResult -> fortify.internal -> factor
fc_gene <- enrichPathway(gene=unique(names(fc)), pvalueCutoff=0.1, organism = "mouse", readable=T)
index <- sapply(seq(1, length(fc_gene$Description)), function(x){return(which(fc_gene$Description == fc_gene$Description[x])[1] == x)})
attr(fc_gene, "result") <- attr(fc_gene, "result")[index,]
dotplot(fc_gene, showCategory=15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment