compareCluster error: On clusterProfiler DEGs enrichments analysis
1
0
Entering edit mode
4.5 years ago
tpm ▴ 30

I am working on Clusterprofiler. I am comparing 4 gene sets. I encountered an error, and I am trying to figure out what could be the problem when I run the compareCluster function. I do not know how I can solve this issue.

> lapply(LISTcutoff5, head)
$EC11WT
[1] "947315" "944895" "947758" "947761" "946796" "948517"

$EC12WT
[1] "947315" "944895" "947758" "947761" "946796" "948517"

$EC17WT
[1] "947315" "944895" "947758" "947761" "946796" "948517"

$EC17WT
[1] "947315" "944895" "947758" "947761" "946796" "948517"

When I run this code:

 ckk50 <- compareCluster(geneCluster = LISTcutoff5, fun = "enrichGO", OrgDb = "org.EcK12.eg.db",ont="BP")

I get this error:

Error in `levels<-`(`*tmp*`, value = as.character(levels)) : 
  factor level [4] is duplicated
clusterProfiler Bioconductor R DEGs • 1.3k views
ADD COMMENT
0
Entering edit mode
4.5 years ago
tpm ▴ 30

I realized the mistake, which was here 'EC17WT' as I have identical names. I had to change one of them: So not like this

$EC17WT
[1] "947315" "944895" "947758" "947761" "946796" "948517"

$EC17WT
[1] "947315" "944895" "947758" "947761" "946796" "948517"

but like this:

    $EC17WT
    [1] "947315" "944895" "947758" "947761" "946796" "948517"

    $EC18WT
    [1] "947315" "944895" "947758" "947761" "946796" "948517"

Being new on R has lots of challenges and embarrassingly, it can be a mere typo.

Thanks in advance.

ADD COMMENT
1
Entering edit mode

Happens to the best of us. Often taking the time to create a reproducible example for the question will help you answer it yourself.

I've moved your comment to an answer (and accepted it), since you answered your own question. Which is fine to do in good faith.

ADD REPLY

Login before adding your answer.

Traffic: 2697 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6