[Bioc-devel] AlignedRead should allow [i, drop=FALSE]

Martin Morgan mtmorgan at fhcrc.org
Wed Feb 23 05:39:18 CET 2011


On 02/22/2011 08:20 PM, Michael Lawrence wrote:
> AlignedRead complains when drop=FALSE is passed to [, but it seems like this
> should be allowed. This breaks things like putting an AlignedRead in a
> DataFrame.

Is this with

> packageDescription("ShortRead")$Version
[1] "1.9.14"

(which because of build system issues seems only to be in svn at the
moment)? I have

> example(readAligned)
> aln1[1, drop=TRUE]
class: AlignedRead
length: 1 reads; width: 35 cycles
chromosome: NA
position: 2652
strand: +
alignQuality: NumericQuality
alignData varLabels: nMatch nextBestAlignQuality

but also

> df = DataFrame(seq_len(length(aln1)))
> df[["aln"]] = aln1
> df1 = df[1:10,]
> df1[["aln"]]
class: AlignedRead
length: 10 reads; width: 35 cycles
chromosome: NA NA ... NA NA
position: 2652 2652 ... 353 1498
strand: + + ... + +
alignQuality: NumericQuality
alignData varLabels: nMatch nextBestAlignQuality
> df1
DataFrame with 1000 rows and 2 columns
Error in as.matrix(format(do.call(data.frame, lapply(object, function(x)
showAsCell(head(x,  :
  error in evaluating the argument 'x' in selecting a method for
function 'as.matrix'

and I wasn't sure what the rules were for making a class
DataFrame-compatible.

Martin


> 
> Michael
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel


-- 
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109

Location: M1-B861
Telephone: 206 667-2793



More information about the Bioc-devel mailing list