[Bioc-devel] Sample names on NChannelSet

Benilton Carvalho bcarvalh at jhsph.edu
Mon Mar 23 17:32:57 CET 2009


(apologies in case this is a duplicated message - the first email was  
returned with an error)

NChannelSet accepts the elements of assayData to have different  
colnames. For example:

setClass("myClass", contains="NChannelSet")
x <- y <- matrix(0, 5, 5)
colnames(x) <- paste("x", 1:5, sep="")
colnames(y) <- paste("y", 1:5, sep="")
(zz1 <- new("myClass", x=x, y=y))
(zz2 <- new("myClass", x=x, y=x))

Note that the show method suggests that the sample names for zz1 is  
x1, ..., x5 (identical for zz2).

Also, sampleNames() returns a list:

 > sampleNames(zz1)
$x
[1] "x1" "x2" "x3" "x4" "x5"

$y
[1] "y1" "y2" "y3" "y4" "y5"

 > sampleNames(zz2)
$x
[1] "x1" "x2" "x3" "x4" "x5"

$y
[1] "x1" "x2" "x3" "x4" "x5"

The fact that NChannelSet accepts different sampleNames also affects  
subsetting:

cols <- c("x1", "x4")
(zz1[, cols])  ## Error: subscript out of bounds
(zz2[, cols])

Is this an intended behavior? I'd expect sample names to be the same  
across elements of AssayData and sampleNames() to return a vector  
(instead of a list - side-effect of eapply).

Thank you,

benilton



More information about the Bioc-devel mailing list