[BioC] affycoretools()

James W. MacDonald jmacdon at uw.edu
Wed Nov 21 17:19:03 CET 2012


On 11/21/2012 10:34 AM, Guest [guest] wrote:
> The legend is not plotting for the 3d PCA plot in affycoretools(). From the documentation it says the legend boolean defaults to TRUE, but no legend prints even after I explicitly set the legend boolean to TRUE.
>
> Any suggestions on getting the legend to print?

You can't with a 3d plot. Hypothetically one could use mtext3d to create 
a legend outside the plotting region, but I haven't done so, because I 
never use the 3D plots for anything but interactive peering at the data.

>
> I have installed and loaded rgl().
>
> Also, the addtext parameter is not working either. It does not add the sample names as I have specified.

Yep, that doesn't work with rgl either. This would be less work to add, 
as it is just a call to text3d(). But then again, it is easy enough for 
you to add as well. See below.

>
> Here is my command:
>
> plotPCA(expset, pcs=c(1,2,3), plot3d=TRUE, addtext=sampleNames(eset), group = eset$GroupNumber, groupnames=levels(treatment.factors), legend=TRUE)

After the above call to plotPCA(), you can

pca <- prcomp(t(exprs(expset)))
cnst <- 1
text3d(pca$x[,1]+cnst, pca$x[,2]+cnst, pca$x[,3]+cnst, sampleNames(eset))

You may need to play around with the constant to get the text off the 
boxes, but you see the idea.

Best,

Jim


>
>
>   -- output of sessionInfo():
>
>> sessionInfo()
> R version 2.15.1 (2012-06-22)
> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
>
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] grid      stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
>   [1] rgl_0.92.894                         affycoretools_1.30.0                 KEGG.db_2.8.0
>   [4] GO.db_2.8.0                          gplots_2.11.0                        MASS_7.3-22
>   [7] KernSmooth_2.23-8                    caTools_1.13                         bitops_1.0-4.2
> [10] gdata_2.12.0                         gtools_2.7.0                         VennDiagram_1.5.1
> [13] hugene10sttranscriptcluster.db_8.0.1 org.Hs.eg.db_2.8.0                   BiocInstaller_1.8.3
> [16] mogene10sttranscriptcluster.db_8.0.1 org.Mm.eg.db_2.8.0                   RSQLite_0.11.2
> [19] DBI_0.2-5                            limma_3.14.1                         hugene10stv1cdf_2.11.0
> [22] AnnotationDbi_1.20.3                 affy_1.36.0                          Biobase_2.18.0
> [25] BiocGenerics_0.4.0
>
> loaded via a namespace (and not attached):
>   [1] affyio_1.26.0         annaffy_1.30.0        annotate_1.36.0       AnnotationForge_1.0.2 biomaRt_2.14.0
>   [6] Biostrings_2.26.2     Category_2.24.0       gcrma_2.30.0          genefilter_1.40.0     GOstats_2.24.0
> [11] graph_1.36.1          GSEABase_1.20.0       IRanges_1.16.4        lattice_0.20-10       parallel_2.15.1
> [16] preprocessCore_1.20.0 RBGL_1.34.0           RCurl_1.95-3          splines_2.15.1        stats4_2.15.1
> [21] survival_2.36-14      tools_2.15.1          XML_3.95-0.1          xtable_1.7-0          zlibbioc_1.4.0
> --
> Sent via the guest posting facility at bioconductor.org.
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> 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
University of Washington
Environmental and Occupational Health Sciences
4225 Roosevelt Way NE, # 100
Seattle WA 98105-6099



More information about the Bioconductor mailing list