報錯:Error in ans[ypos] <- rep(yes, length.out = len)[ypos] : replacement has length zero


運行以下命令時:

ego.down <- enrichGO(gene = down$newid,
                   universe = bg.list$newid,
                   OrgDb = org.Hs.eg.db,
                   keyType       = 'ENSEMBL',
                   ont = "BP", # biological process, change this to "MF" for molecular function, or "CC" for cellular components
                   pAdjustMethod = "BH",
                   pvalueCutoff = 0.01,
                   qvalueCutoff = 0.05,
                   readable = TRUE)

dotplot(ego.down,showCategory=20,x="GeneRatio",font.size=13) + ggtitle("GO (BP) terms of down-regulated genes")+
scale_y_discrete(labels=function(x) str_wrap(x,width = 40))  +
  theme(plot.title = element_text(size=16,face = "bold",hjust = .5),
        legend.title = element_text(size=15),
        legend.text = element_text(size=14))

出現報錯:

Error in ans[ypos] <- rep(yes, length.out = len)[ypos] : replacement has length zero

檢查了一下,發現是閾值設的太高,把閾值調低即可:

pvalueCutoff = 0.01,
qvalueCutoff = 0.05,

把上面的改為:

pvalueCutoff = 0.2,
qvalueCutoff = 0.2,


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM