[BioC] hyperGTest html report

James W. MacDonald jmacdon at med.umich.edu
Fri Jan 11 15:11:20 CET 2008



Sebastien Gerega wrote:
> 
>> 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?

Of course. This is just HTML. All you have to do is wrap the Entrez Gene 
IDs in

<a 
href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=gene&cmd=Retrieve&dopt=Graphics&list_uids=XXXXX">XXXXXXX</a>

where XXXXX is the Entrez Gene ID.

Best,

Jim


> cheers,
> Sebastien

-- 
James W. MacDonald, M.S.
Biostatistician
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623



More information about the Bioconductor mailing list