[BioC] How to get the uniquely mapping reads from object of AlignedRead class [ShortRead]?

Martin Morgan mtmorgan at fhcrc.org
Mon Oct 19 17:15:48 CEST 2009


Likun Wang wrote:
> Hi all,
> I want to get the uniquely mapping reads from an object of AlignedRead class.
> How can I do this?

It depends a little on what you mean by 'uniquely aligning', e.g.,
identical sequence, identical + / - strand, overlap of identical
nucleotides.

You can try

  aln[uniqueFilter()(aln)]

or if that is not to your liking specify your own criteria for subsetting,

   u <- !duplicated(position(aln)) & !duplicated(chromosome(aln))
   aln[u]

Martin

> Thanks.


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

Location: Arnold Building M1 B861
Phone: (206) 667-2793



More information about the Bioconductor mailing list