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 <[email protected]> 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
> [email protected]
> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing
>

_______________________________________________
Bioc-sig-sequencing mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing

Reply via email to