Commit 57c59da7 authored by Beatrice Tan's avatar Beatrice Tan

Fixed problem with GO enrichment analysis.

parent 153ad922
......@@ -4,10 +4,10 @@ rule do_GO_analysis:
gene_list="Reports/Genes_{tool}.txt"
output:
table="GO/Enriched_GOs_{tool}.txt", #Add gene names to table
plot="GO/Enriched_GOs_{tool}.png"
#plot="GO/Enriched_GOs_{tool}.png"
params:
organism="hsapiens", #default is human
ontology="BP", #MF, BP, CC or all
ontology="all", #MF, BP, CC or all
gene_ID_to_GO=os.path.join(workflow.basedir, config["ID_to_GO"]) if config["ID_to_GO"].startswith("input_files") else config["ID_to_GO"]
benchmark:
"Benchmarks/topGO." + str(datetime.datetime.now()).replace(" ", "_") + ".txt"
......
......@@ -40,21 +40,20 @@ test.stat <- new("weightCount", testStatistic = GOFisherTest, name = "Fisher tes
resultWeight <- getSigGroups(GOdata, test.stat)
#Make table with results
allRes <- GenTable(GOdata, classic = resultFisher,
#KS = resultKS,
allRes <- GenTable(GOdata, classic = resultFisher, #KS = resultKS,
weight = resultWeight,
orderBy = "weight", ranksOf = "classic") #, topNodes = 50)
orderBy = "weight", ranksOf = "classic", topNodes = 50)
write.table(allRes, file=snakemake@output[[1]], quote=FALSE, sep="\t", eol = "\n")
#Visualize GO term relationships
png(snakemake@output[[1]])
#png(snakemake@output[[2]])
#showSigOfNodes(GOdata, score(resultFisher), firstSigNodes = 5, useInfo ='all')
printGraph(GOdata, resultFisher, firstSigNodes = 10, fn.prefix = "tGO", useInfo = "all", pdfSW = TRUE)
dev.off()
#printGraph(GOdata, resultFisher, firstSigNodes = 10, fn.prefix = "tGO", useInfo = "all", pdfSW = TRUE)
#dev.off()
#Print most significant genes
ann.genes <- genesInTerm(GOdata)
str(ann.genes)
fisher.go <- names(score(resultFisher))[1:5]
fisher.ann.genes <- genesInTerm(sampleGOdata, whichGO=fisher.go)
print(fisher.ann.genes)
#ann.genes <- genesInTerm(GOdata)
#str(ann.genes)
#fisher.go <- names(score(resultFisher))[1:5]
#fisher.ann.genes <- genesInTerm(GOdata, whichGO=fisher.go)
#print(fisher.ann.genes)
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