When running pairwise_termsim on a compareClusterResult object, duplicated term descriptions for unique IDs are not properly handled in the fortify method. This can result in an error in rare cases where there are two significant terms with unique IDs with identical descriptions, e.g:
ID Description
144 R-HSA-9694676 Translation of Replicase and Assembly of the Replication Transcription Complex
161 R-HSA-9679504 Translation of Replicase and Assembly of the Replication Transcription Complex
The error:
Error in `levels<-`(`*tmp*`, value = as.character(levels)) :
factor level [260] is duplicated
When running
pairwise_termsim
on acompareClusterResult
object, duplicated term descriptions for unique IDs are not properly handled in thefortify
method. This can result in an error in rare cases where there are two significant terms with unique IDs with identical descriptions, e.g:The error:
The other fortify methods already handle this scenario gracefully, and it can be fixed for this instance easily by adding an additional
unique
call to thelevels
parameter in https://github.com/YuLab-SMU/enrichplot/blob/devel/R/method-fortify.R#L214I will submit a PR addressing this shortly.