[BioC] Reference individual array in abatch after changing pData

Paul Geeleher paulgeeleher at gmail.com
Mon Apr 7 13:49:31 CEST 2008


Dear Memebers,

I want to be able to reference individual arrays in an abatch like so
abatch[,1], abatch[,2] etc.

This seems to work fine using the original pData for the abatch after
using ReadAffy():

                  sample
N10S.CEL      1
N11S.CEL      2
N12S.CEL      3
N7S.CEL       4
N8S.CEL       5
N9S.CEL       6
P1S.CEL       7
P2S.CEL       8
P3S.CEL       9
P4S.CEL      10
P5S.CEL      11
P6S.CEL      12


But when I run these commands:

pd <- data.frame(population = c(1,1,1,1,1,1,2,2,2,2,2,2), replicate =
c(1,2,3,4,5,6,1,2,3,4,5,6), sample = c(1,2,3,4,5,6,7,8,9,10,11,12))
rownames(pd) <- sampleNames(abatch)
pData(abatch) <- pd

Which changes the pData for the abatch to this:

         population replicate sample
N10S.CEL          1         1      1
N11S.CEL          1         2      2
N12S.CEL          1         3      3
N7S.CEL           1         4      4
N8S.CEL           1         5      5
N9S.CEL           1         6      6
P1S.CEL           2         1      7
P2S.CEL           2         2      8
P3S.CEL           2         3      9
P4S.CEL           2         4     10
P5S.CEL           2         5     11
P6S.CEL           2         6     12

Referencing the arrays using "abatch[,1]" throws up the following error:

Error in `row.names<-.data.frame`(`*tmp*`, value = c("sample", "population",  :
        invalid 'row.names' length


How can I change the pData and still be able to reference the arrays
like "abatch[,1]"?

Thanks,
-Paul



More information about the Bioconductor mailing list