Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Beatrice Tan
CNAprioritization
Commits
57c59da7
Commit
57c59da7
authored
Feb 19, 2018
by
Beatrice Tan
Browse files
Fixed problem with GO enrichment analysis.
parent
153ad922
Changes
2
Hide whitespace changes
Inline
Side-by-side
rules/GenePrioritization.smk
View file @
57c59da7
...
...
@@ -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"
...
...
wrappers/topgo/wrapper.R
View file @
57c59da7
...
...
@@ -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
(
sample
GOdata
,
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)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment