[BioC] x,y-probe locations and the AffyBatch

Laurent Gautier laurent@cbs.dtu.dk
Sat, 1 Mar 2003 05:05:34 +0100

On Fri, Feb 28, 2003 at 03:39:26PM -0500, Wolfgang Huber wrote:
> Hi,
> what is the relationship between the (x,y) coordinates of the cels on
> the chip, and the integer index j for the row in AffyBatch@exprs?

Currently, the relation is the same as dropping the dimension attribute
of the intensity matrix of a Cel object. (?Cel for fews lines about
the slot intensity in Cel, read.affybatch.R to see how an AffyBatch is
built from several Cel objects).
## let int.cel be the intensity slot of a Cel
int.cel <- matrix(1:100, 10, 10)

indice.j <- c(int.cel)

## with a real dataset
cel <- Dilution[[1]]

m.indices.j <- matrix(seq(along=intensity(cel)), nr=nrow(intensity(cel)), nc=ncol(intensity(cel)))

my.x <- 10
my.y <- 25

m.indices.j[my.x, my.y]
# answer is 15370

intensity(cel)[my.x, my.y]
# answer is 111 

intensity(Dilution)[15370, 1] # 1 because cel from the first chip
# answer is 111

> The vignettes say:
> (Textual description of makecdfenv): j = x*nrow + y + 1 
> (Textual description of affy, p.26): j = x*nrow y + 1    (sic!)

Thanks for pointing things out (different individual work on the pack 
& we do not always find the time to read ourselves). You corrections
are always appreciated, and the source code can easily be checked if
you have any dout (rtfsc somehow...).

> What coordinate system do the names "x" and "y" refer to? 

The 'X' and 'Y' in the .CEL file + 1 (because the indexing in R starts
at 1, not at zero... I remember we had a thread about that some time ago).

> When looking at comparisons of chips of different types with common
> probes (e.g. MGU74A, MGU74Av2), and using Probe.X and Probe.Y as given
> in the CHIPNAME_probe_tab files from the netaffx website, it appears
> that the right mapping should be

If your mapping is right (compared to the other), you should proceed.
I find useful to remind you that the indexing of probe according to
the probeset thay belong to is done from the CDF file in the first place.
You may find useful to look at one of the function added to makeMatchAffy.

>   j   = Probe.Y * nrow + Probe.X + 1    (for the perfect match)
>   jmm = Probe.Y * nrow + Probe.X + 2    (for the mismatch)

I have been doing some cross-checkings lately with those files lately.
 We can discuss longer about that off-list if you want.
(and I would feel more relaxed, I always sweat a bit when the indexing
system is questioned ... the stuff is mad enough, and mistakes easy to
make (ach ! why did I start all this... ;) )...).
> Is this correct?

Now you should be able to tell... 



> Best regards
>  	Wolfgang
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@stat.math.ethz.ch
> http://www.stat.math.ethz.ch/mailman/listinfo/bioconductor

currently at the National Yang-Ming University in Taipei, Taiwan
Laurent Gautier			CBS, Building 208, DTU
PhD. Student			DK-2800 Lyngby,Denmark	
tel: +45 45 25 24 89		http://www.cbs.dtu.dk/laurent