Commit d4177d63 authored by Philippe BORDRON's avatar Philippe BORDRON
Browse files

fix for #13

parent 1dd220f1
......@@ -7,6 +7,8 @@ cond2=args[3]
org=args[4]
corresFile=args[5]
eps <- 10e-14
library(GO.db)
library(GSEABase)
library(clusterProfiler)
......@@ -20,7 +22,7 @@ makeGeneList<-function(data,org){
logC=data[,"log2FoldChange"]
logC[logC<0] <- -1
logC[logC>=0] <- 1
data$InvPAdj=data$InvPAdj*logC
data$InvPAdj=data$InvPAdj*logC + eps*logC
geneID=bitr(data$Name, fromType="SYMBOL",toType=c("ENTREZID"),OrgDb=org)
doublons=which(duplicated(geneID$SYMBOL))
if(length(doublons)>0){geneID=geneID[-doublons,]}
......@@ -63,19 +65,11 @@ if(dim(data)[1]>10){
dataTot=read.csv(paste(paste(outputDir,comp,sep="/"),"DEseqRes.tsv",sep="/"), header=TRUE, sep="\t")
geneListTot=makeGeneList(dataTot,orgGO)
if(all(geneListTot == 0)){
# Empty enrichment table if all exp values equal 0
ego2Symbol <- read.csv(text="ID,Description,setSize,enrichmentScore,NES,pvalue,p.adjust,qvalues,rank,leading_edge,core_enrichment")
kk2Symbol <- read.csv(text="ID,Description,setSize,enrichmentScore,NES,pvalue,p.adjust,qvalues,rank,leading_edge,core_enrichment")
} else {
ego2=gseGO(geneList=geneListTot,OrgDb=orgGO,ont="ALL",nPerm=1000,minGSSize=20,maxGSSize=500,pvalueCutoff=1,verbose=FALSE)
ego2Symbol=setReadable(ego2,orgGO,keyType="ENTREZID")
kk2=gseKEGG(geneList=geneListTot,organism=as.character(orgKegg),nPerm=1000,minGSSize=2,pvalueCutoff=1,verbose=FALSE)
kk2Symbol=setReadable(kk2,orgGO,keyType="ENTREZID")
ego2=gseGO(geneList=geneListTot,OrgDb=orgGO,ont="ALL",nPerm=1000,minGSSize=20,maxGSSize=500,pvalueCutoff=1,verbose=FALSE)
ego2Symbol=setReadable(ego2,orgGO,keyType="ENTREZID")
}
kk2=gseKEGG(geneList=geneListTot,organism=as.character(orgKegg),nPerm=1000,minGSSize=2,pvalueCutoff=1,verbose=FALSE)
kk2Symbol=setReadable(kk2,orgGO,keyType="ENTREZID")
write.table(ego2Symbol,paste(paste(outputDir,comp,sep="/"),"gseGo.txt",sep="/"),sep="\t",row.names=F,quote=F)
write.table(kk2Symbol,paste(paste(outputDir,comp,sep="/"),"gseKegg.txt",sep="/"),sep="\t",row.names=F,quote=F)
......
Markdown is supported
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