[BioC] hyperGTest html report

Sebastien Gerega seb at gerega.net
Fri Jan 11 05:58:00 CET 2008


> This is the part where I said you have to wrap the Entrez Gene IDs in 
> <P>EGID</P> so you can a.)have a vector of the correct length, and b.) 
> create a table that will be readable.
>
> Something like this should suffice:
>
> rg.out <- sapply(reportGenes, function(x)
>  paste("<P>", paste(x, collapse="</P><P>"), "</P>", sep=""))
>
> then use rg.out in lieu of reportGenes when making the data.frame.
>
> Best,
>
> Jim
Great, thanks you very much for that. I am using the following code:

report = summary(hgOver, htmlLinks=TRUE)
cats = sigCategories(hgOver)
reportGenes = vector()
for(i in 1:length(cats)){
    reportGenes = append(reportGenes, geneIdsByCategory(hgOver, cats[i]))
}
reportGenes = sapply(reportGenes, function(x) paste(x, collapse=", "))
report = data.frame(report, Genes=reportGenes)
xtab = xtable(report, caption="Gene to GO MF test for over-representation")
print(xtab, type="html", file="p2007_0031_T47D_48h_GO_MF.html", 
caption.placement="top", sanitize.text.function=function(x) x, 
include.rownames=FALSE)

That way everything gets put in one line and it is a bit more compact. I 
don't suppose there is an easy way to make the gene IDs link to the 
Entrez website?
cheers,
Sebastien



More information about the Bioconductor mailing list