[BioC] probeSetSummary and named vector

James W. MacDonald jmacdon at med.umich.edu
Wed Nov 28 15:53:46 CET 2007


Hi Ingrid,

Ingrid H. G. Østensen wrote:
> Hi
> 
> I have found GO categorys in a data set and want to see which genes are in the different terms that are listed. Previously I have done the following:
> 
>   annoPk <- "illuminaHumanv2"
>   entrezPk <- illuminaHumanv2ENTREZID
>   pVerdi_GO = 0.01
> 
>   probe <- top2[,1] #top2 is a topTable object
>   
>   sigLL <- (unlist(mget(probe, env=entrezPk, ifnotfound=NA)))                    
>   sigLL <- sigLL[!is.na(sigLL)]                                                  
>   sigLL <- sigLL[!duplicated(sigLL)]                                             
>   
>   univ <- unique(getLL(ls(entrezPk), annoPk))                                  
> 
> 
>    params <- new("GOHyperGParams", geneIds= sigLL, universeGeneIds=univ, annotation=annoPk, ontology="BP", pvalueCutoff= pVerdi_GO, conditional=TRUE, testDirection="over")
>   hgOver <- hyperGTest(params)
>   res_filNavn <- paste(i, "_GO_summary_BP_over.html", sep = "")                        
>   htmlReport(hgOver,file=res_filNavn)
>   ps <- probeSetSummary(hgOver)
>   res_filNavn_gener <- paste(i, "_GO_prober_BP_over.txt")
>   for(j in 1:length(ps))
>   {
>     write.table(ps[j], file = res_filNavn_gener, append=TRUE, sep="")             
>   }  
> 
> This has worked fine. But now I am reading the topTable result as an .txt file (topTable files made previously and stored as a .txt file). I now have to use as.character to get the information into hyperGTest. 
> 
>   sigLL <- (unlist(mget(as.character(probe), env=entrezPk, ifnotfound=NA)))      
>   sigLL <- as.character(sigLL[!is.na(sigLL)])                                    
>   sigLL <- sigLL[!duplicated(sigLL)]                                               
>    
>   univ <- as.character(unique(getLL(ls(entrezPk), annoPk)))                      
> 
> Unfortenatly probeSetSummary does not like this:
> 
> 
>> ps <- probeSetSummary(hgOver)
> Warning message:
> The vector of geneIds used to create the GOHyperGParams object was not a named vector.
> If you want to know the probesets that contributed to this result
> you need to pass a named vector for geneIds. 
> 
> Is it possible to read a .txt file and get the probe ID into a named vector? Or get around this another way? I have tried on R 2.5.1 and 2.6.

Sure. Just read in the .txt file and then create another vector of names 
for the vector, and do

names(thevector) <- thenamevector

Of course this presupposes that you know the names for the vector... If 
not, I think you are stuck.

Best,

Jim


> 
>>   sessionInfo()
> R version 2.6.0 (2007-10-03) 
> i386-pc-mingw32 
> 
> locale:
> LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252
> 
> attached base packages:
> [1] splines   tools     stats     graphics  grDevices utils     datasets  methods   base     
> 
> other attached packages:
>  [1] illuminaHumanv2_1.4.0 GOstats_2.4.0         Category_2.4.0        genefilter_1.16.0     survival_2.34         RBGL_1.14.0           GO.db_2.0.2           graph_1.16.1         
>  [9] lumi_1.4.0            mgcv_1.3-28           affy_1.16.0           preprocessCore_1.0.0  affyio_1.6.1          annaffy_1.10.1        KEGG_2.0.1            GO_2.0.1             
> [17] annotate_1.16.1       AnnotationDbi_1.0.6   RSQLite_0.6-4         DBI_0.2-4             Biobase_1.16.1        xtable_1.5-2          RColorBrewer_1.0-2    limma_2.12.0         
> 
> loaded via a namespace (and not attached):
> [1] cluster_1.11.9
> 
> Regards,
> Ingrid
> 
> 
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor

-- 
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