An rbind() method or an rbind-like function for ExpressionSet objects would be useful. Any plans for such a function? At the moment, an ExpressionSet object can be subsetted by rows or columns. Column subsets can be put back together using combine(), but there's no way I think to put row subsets back together. BTW, the help page for the generic function combine() includes the idea of combining by rows, but this concept is not honoured by the combine method for the eSet class. Cheers Gordon
[Bioc-devel] rbind for ExpressionSet objects?
4 messages · Gordon K Smyth, Laurent Gautier, J.Oosting at lumc.nl +1 more
That would be useful. I have been in a situation where it would have been useful, and spent some time with combine as well before writing my own ad-hoc solution. Laurent 2008/4/4, Gordon K Smyth <smyth at wehi.edu.au>:
An rbind() method or an rbind-like function for ExpressionSet objects would be useful. Any plans for such a function? At the moment, an ExpressionSet object can be subsetted by rows or columns. Column subsets can be put back together using combine(), but there's no way I think to put row subsets back together. BTW, the help page for the generic function combine() includes the idea of combining by rows, but this concept is not honoured by the combine method for the eSet class. Cheers Gordon
_______________________________________________ Bioc-devel at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iEYEARECAAYFAkYgwJ4ACgkQB/w/MLoyRDeQlgCeMp8v69/Wy24Q4IaBVhoG1M5R 2h4AoIOTvKbrFpTklRDjV7u8tEOeSQqt =JPph -----END PGP SIGNATURE-----
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/bioc-devel/attachments/20080404/d13a01d5/attachment.pl
Thanks for the suggestion and examples.
I implemented this in Biobase 1.99.5. It is slightly different from the
version in the beadarraySNP package, in that the content of overlapping
regions of the exprs arrays have to be identical (beadarraySNP allows
NAs in the second matrix).
The functionality I implemented is consistent with the following tests
(hopefully self-explanatory).
data(sample.ExpressionSet)
obj <- sample.ExpressionSet
checkEquals(obj, combine(obj[1:250,], obj[251:500,]))
checkEquals(obj, combine(obj[,1:13], obj[,14:26]))
## overlapping
checkEquals(obj, combine(obj[1:300,], obj[250:500,]))
checkEquals(obj, combine(obj[,1:20], obj[,15:26]))
The implementation introduces a combine method for matricies, which is
consistent with these tests:
## dimnames
m <- matrix(1:20, nrow=5, dimnames=list(LETTERS[1:5], letters[1:4]))
checkEquals(m, combine(m, m))
checkEquals(m, combine(m[1:3,], m[4:5,]))
checkEquals(m, combine(m[,1:3], m[,4, drop=FALSE]))
## overlap
checkEquals(m, combine(m[1:3,], m[3:5,]))
checkEquals(m, combine(m[,1:3], m[,3:4]))
checkEquals(matrix(c(1:3, NA, NA, 6:8, NA, NA,
11:15, NA, NA, 18, NA, NA),
nrow=5,
dimnames=list(LETTERS[1:5], letters[1:4])),
combine(m[1:3,1:3], m[3:5, 3:4]))
## row reordering
checkEquals(m[c(1,3,5,2,4),], combine(m[c(1,3,5),], m[c(2,4),]))
## Exceptions
checkException(combine(m, matrix(0, nrow=5, ncol=4)),
silent=TRUE) # types differ
checkException(combine(m, matrix(0L, nrow=5, ncol=4)),
silent=TRUE) # attributes differ
m1 <- matrix(1:20, nrow=5)
checkException(combine(m, m1), silent=TRUE) # dimnames required
Please let me know if you had something else in mind, or if there are
problems with this.
Martin
Laurent Gautier wrote:
That would be useful. I have been in a situation where it would have been useful, and spent some time with combine as well before writing my own ad-hoc solution. Laurent 2008/4/4, Gordon K Smyth <smyth at wehi.edu.au>:
An rbind() method or an rbind-like function for ExpressionSet objects would be useful. Any plans for such a function? At the moment, an ExpressionSet object can be subsetted by rows or columns. Column subsets can be put back together using combine(), but there's no way I think to put row subsets back together. BTW, the help page for the generic function combine() includes the idea of combining by rows, but this concept is not honoured by the combine method for the eSet class. Cheers Gordon
_______________________________________________ Bioc-devel at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel
Martin Morgan Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M2 B169 Phone: (206) 667-2793