Commit 30c3015b authored by Eric CHARPENTIER's avatar Eric CHARPENTIER 🐍
Browse files

fixed bug that crashed the creation of the enrichment plot if no enrichment was found

parent ced81cf7
......@@ -56,14 +56,18 @@ if(dim(data)[1]>10){
gene=names(geneList)
ego=enrichGO(gene=gene,OrgDb=orgGO,ont="ALL",pAdjustMethod = "BH",pvalueCutoff = 0.01,qvalueCutoff = 0.05,readable = TRUE)
png(paste(paste(OUTDIR,comp,sep="/"),"dotplotGO.png",sep="/"),width=1000,height=600)
print(clusterProfiler::dotplot(ego))
if(dim(ego)[1] != 0){
print(clusterProfiler::dotplot(ego))
}
dev.off()
write.table(ego,paste(paste(OUTDIR,comp,sep="/"),"annotGo.tsv",sep="/"),sep="\t",row.names=F,quote=F)
ekegg=enrichKEGG(gene, organism = as.character(orgKegg), keyType = "kegg", pvalueCutoff = 0.05,pAdjustMethod = "BH", minGSSize = 10, maxGSSize = 500,qvalueCutoff = 0.2, use_internal_data = FALSE)
eKeggSymbol=setReadable(ekegg,orgGO,keyType="ENTREZID")
png(paste(paste(OUTDIR,comp,sep="/"),"dotplotKEGG.png",sep="/"),width=1000,height=600)
print(clusterProfiler::dotplot(eKeggSymbol))
if(dim(eKeggSymbol)[1] != 0){
print(clusterProfiler::dotplot(eKeggSymbol))
}
dev.off()
write.table(eKeggSymbol,paste(paste(OUTDIR,comp,sep="/"),"annotKegg.tsv",sep="/"),sep="\t",row.names=F,quote=F)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment