[BioC] snpMatrix - Creating a 1-column snp.matrix by subsetting a larger snp.matrix

Richard Pearson richard.pearson at postgrad.manchester.ac.uk
Wed Jun 4 22:17:42 CEST 2008


Is there any way of subsetting a snp.matrix on just one column, and ending up with a snp.matrix object (rather than a snp object)? Put another way, is there a way of coercing a snp object to be a snp.matrix object? The following example might illustrate the sort of thing I'm trying to do:

> library(snpMatrix)
> data(testdata)
> subsets <- list("none" = NULL, "one" = 1, "two" = 1:2)
> sapply(subsets, function(x) class(Autosomes[,x]))
        none          one          two 
"snp.matrix"        "snp" "snp.matrix" 

I couldn't find anything in the documentation, and am struggling figuring out how to do this by coercing to a regular matrix and then back.

Thanks

Richard

-- 
Richard D. Pearson             richard.pearson at postgrad.manchester.ac.uk
School of Computer Science,    http://www.cs.man.ac.uk/~pearsonr
University of Manchester,      Tel: +44 161 275 6178
Oxford Road,                   Mob: +44 7971 221181
Manchester M13 9PL, UK.        Fax: +44 161 275 6204



More information about the Bioconductor mailing list