# [BioC] Subtraction with NA values

A.J. Rossini rossini at blindglobe.net
Wed Feb 11 05:28:40 MET 2004

```Gordon --

Is it really standard?  Mathematically, I understand it, but
statistically/scientifically, how does that jibe for trusting the
order of calls with/without those genes?   We've been seeing some
really interesting dye effects, though it isn't clear how much is
background and cross-hyb vs. low-copy results (2-channel agilent
chips).   Of course, restricting to the genes above median expression,
or some slightly more advanced filtering, seems to solve this
problem, but I'm still worrying about the use of averaging for dye
effects.

best,
-tony

Gordon Smyth <smyth at wehi.edu.au> writes:

> This is pretty standard analysis with linear models (limma package):
>
> dat <- cbind(M', M)
> fit <- lmFit(dat, design=c(1,-1))
>
> Then fit\$coef contains the combined log-ratios you want.
>
> Gordon
>
> At 02:54 PM 11/02/2004, A.J. Rossini wrote:
>>"Daniel F. Simola" <simola at mail.med.upenn.edu> writes:
>>
>> > Hello,
>> >
>> > I have a microarray experiment using dye-swapped slides. I am trying
>> > to combine (average) the intensities of a gene from a slide and its
>> > dye-swapped pair, but just discovered that the subtraction operator in
>> > R does not work the way I would like it to for missing (NA) values.
>> >
>> > I am doing: ( M - M' ) / 2, where M is an array of intensities for
>> > genes, and M' is the same, except dye-swapped.
>> >
>> > Say I want the result of " 5 - NA ", where 5 is the intensity of one
>> > spot and NA is that of the same spot on the dye-swapped slide, then I
>> > get NA for an answer. Because I want to average the values ( 5 - NA /
>> > 2 ), then I would like my average value to be 5, instead of NA. Thus
>> > it's better to make use of the available data than disregard a gene
>> > completely.
>> >
>> > So, does anyone know either of a workaround for this, or of a function
>> > that I can use to perform element-wise subtraction over a matrix that
>> > will work how I want (or that will let me define my own function to be
>> > applied on an element wise basis)?
>>
>>
>>1. you could impute 5 by replacing the missing values with the values
>>from the other slide.  Judicious application of is.na and assignment
>>will help with this.
>>
>>2. Do you really want to do this?  The end result will be some
>>dye-corrected genes, and some dye-non-corrected genes (don't get me
>>started on whether this is a reasonable thing to do, I still think the
>>jury is out).  and then you want to compare how extreme they are
>>(so you've got some genes with more inherent variance in the measure,
>>not being averages, and if there is a gene by dye effect...
>>
>>Now, I wish I had a positive suggestion, and would appreciate hearing
>>any (rather than the negative one I have above!).
>>
>>best,
>>-tony
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://www.stat.math.ethz.ch/mailman/listinfo/bioconductor
>

--
rossini at u.washington.edu            http://www.analytics.washington.edu/
Biomedical and Health Informatics   University of Washington
Biostatistics, SCHARP/HVTN          Fred Hutchinson Cancer Research Center
UW (Tu/Th/F): 206-616-7630 FAX=206-543-3461 | Voicemail is unreliable
FHCRC  (M/W): 206-667-7025 FAX=206-667-4812 | use Email

CONFIDENTIALITY NOTICE: This e-mail message and any attachme...{{dropped}}

```