[BioC] simpleaffy question
James W. MacDonald
jmacdon at med.umich.edu
Sat Dec 9 15:40:22 CET 2006
J.delasHeras at ed.ac.uk wrote:
> Quoting "D.Enrique ESCOBAR ESPINOZA" <escobarebio at yahoo.com>:
>
>
>>HI ,
>>does someone know if there is a built-inn
>>function for adding a legend to the QC grph obtained
>>with :
>>data(Dilution)
>>plot(qc(Dilution))
>>or if there is an easy way to add a legend to this graph
>>thanks.
>
>
> In general I find that one or some of these functions help me annotate
> any plot in R:
>
> ?text
> ?mtext
> ?title
> ?legend
>
> I presume you probably were looking for 'legend'.
Unfortunately legend won't work in this case. The qc() plot is produced
after a call to layout(), which cuts the plotting device into four
sections. The last section to be plotted is the upper left hand, which
contains the names of the QC probesets. If you make a call to legend(),
it will put the legend in that very small section, most likely right on
top of the names of the QC probesets.
To see what I mean, try this code (which comes directly from this
plotting function):
m <- matrix(c(4, 2, 1, 3), nrow = 2, ncol = 2)
layout(m, c(1, 2), c(0.1, 1))
layout.show(4)
The plots will be added to each box in the order listed.
That said, if you want to hack the code it wouldn't be that difficult to
add a call to legend() right after the second call to plot() in the
function plot.qc.stats(). This will put a legend in the second layout
box, which currently only contains the chip names on the extreme right
edge. If you placed the legend "upperleft" and made the font size small
enough, it might fit.
Luckily, since simpleaffy doesn't use a namespace, you can simply
copy-paste the function into an editor, hack away, then source() back in
and go.
HTH,
Jim
>
> Jose
>
--
James W. MacDonald
University of Michigan
Affymetrix and cDNA Microarray Core
1500 E Medical Center Drive
Ann Arbor MI 48109
734-647-5623
**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.
More information about the Bioconductor
mailing list