[Bioc-sig-seq] srFilter function in ShortRead
Vincent Carey
stvjc at channing.harvard.edu
Tue Feb 9 21:57:19 CET 2010
there are undoubtedly many possibilities, here is a simple stepwise approach
using a closure to satisfy the constraint on filter form (must be
function of one argument 'x')
firstIsX = function(sro, X) {
as(substr(sread(sro),1,1),"character") == X
}
firstIsA = srFilter(function(x) firstIsX(x,"A"), name="firstIsA")
example(srFilter) # to get aln, an instance of AlignedRead, into scope
aln[firstIsA(aln)] # seems to comply
sread( aln[ firstIsA(aln) ] ) # seems to do what was requested
On Tue, Feb 9, 2010 at 3:30 PM, joseph <jdsandjd at yahoo.com> wrote:
> Hi
> can you help me create a filter to subset only reads that start with a particular nucleotide, for example G?
> Many thanks
> -Joseph
>
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioc-sig-sequencing mailing list
> Bioc-sig-sequencing at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing
>
More information about the Bioc-sig-sequencing
mailing list