Skip to content
Back to formatted view

Raw Message

Message-ID: <535AE87C.9040200@thompsonclan.org>
Date: 2014-04-25T22:58:04Z
From: Ryan
Subject: [Bioc-devel] Missing seqinfo method for BamFileList?

Hi all,

I noticed that the seqinfo works on BamFile objects, but not on 
BamFileList objects. For BamFileList, it does not throw an error, but 
rather uses the inherited method for "List", which does not return a 
useful result for BamFileList. I suggest the following implementation of 
a useful seqinfo function for BamFileList, along with some code 
demonstrating the problem:

fl <- BamFile(system.file("extdata", "ex1.bam", package="Rsamtools", 
mustWork=TRUE))
# This works.
seqinfo(fl)

fll <- BamFileList(fl, fl)
## This works, but it uses the generic for "List" which gives a useless 
result.
seqinfo(fll)

## Now add a method
setMethod("seqinfo", signature=list(x="BamFileList"), function (x)
{
     Reduce(merge, lapply(x, seqinfo))
}
)

## Now this returns a good result
seqinfo(fll)
## So does this
seqlengths(fll)



-Ryan Thompson