Skip to content

Instantly share code, notes, and snippets.

@carushi
Last active April 9, 2018 05:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carushi/cc82d623af80d633539022aabbc32d2a to your computer and use it in GitHub Desktop.
Save carushi/cc82d623af80d633539022aabbc32d2a to your computer and use it in GitHub Desktop.
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)
fc_gene
attributes(fc_gene)
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