Entering edit mode
Hi community,
I would like to compute Kolmogorov-Smirnov like tests. I built a
TopGOobject with custom annotations and predefined list of interesting
genes
(those having logFC larger than a chosen threshold).
Could you please suggest me how to add logFC values to my TopGO
object?
Here is the code I have so far. I've been able to run FisherTest and
want
to try now Kolmogorov-Smirnov and compare outputs:
Thanks, Bernardo
#################cellular
component###################################################
library(topGO)
geneID2GO <- readMappings(file =
"annot_wego_20131028_1232_HPNK_3.txt", sep= "\t",
IDsep = ",")
str(head(geneID2GO))
geneNames <- names(geneID2GO)
head(geneNames)
x <- read.csv("DEG", header = TRUE)
myInterestingGenes <- as.vector(x$genes)
geneList <- factor(as.integer(geneNames %in% myInterestingGenes))
names(geneList) <- geneNames
str(geneList)
GOdata <- new("topGOdata", ontology = "CC", allGenes = geneList, annot
=
annFUN.gene2GO, gene2GO = geneID2GO)
GOdata
test.stat <- new("classicCount", testStatistic = GOFisherTest, name =
"Fisher test")
resultFisher <- getSigGroups(GOdata, test.stat)
resultFisher
resultFis <- runTest(GOdata, algorithm = "classic", statistic =
"fisher")
pvalFis <- score(resultFis)
head(pvalFis)
geneData(resultFis)
pvalFis <- score(resultFis)
hist(pvalFis, 50, xlab = "p-values")
dev.copy2pdf(file = "P-value_CC.pdf") #Save as .pdf
allRes <- GenTable(GOdata, classic = resultFis, orderBy = "classic",
ranksOf= "classic",
topNodes = 100)
allRes
write.table(allRes, "Fisher_CC.txt", sep="\t")
--
*Bernardo Bello OrtÃ*
PhD student
CReSA-IRTA
Campus de Bellaterra-Universitat Autònoma de Barcelona
Edifici CReSA
08193 Bellaterra (Barcelona, Spain)
Tel.: 647 42 52 63 *www.cresa.es *
*
*
[[alternative HTML version deleted]]