[BioC] Minimal region of overlap between two GRanges objects

Daniel Brewer Daniel.Brewer at icr.ac.uk
Tue Dec 13 17:55:38 CET 2011


Thanks Martin,

Yes you're right a simple intersect works great.  I had a suspicion I was missing something very obvious.  Many thanks.

Dan

On 13 Dec 2011, at 4:49 PM, Martin Morgan wrote:

> On 12/13/2011 07:00 AM, Daniel Brewer wrote:
>> Dear mailing list,
>> 
>> I have two GRanges objects each containing segments of copy number
>> change for a tumour.  I would like to find regions where there is
>> copy number change in both the tumours.  I though findOverlaps was
>> giving me what I wanted but soon found that findOverlaps(A,B) !=
>> findOverlaps(B,A).  I am sure there must be a reasonable way to do
>> this but I cannot find it.
> 
> Hi Dan --
> 
>> a = GRanges("chrA", IRanges(11, 20), seqlengths=c(chrA=100))
>> b = GRanges("chrA", IRanges(16, 25), seqlengths=c(chrA=100))
>> intersect(a, b)
> GRanges with 1 range and 0 elementMetadata values:
>       seqnames    ranges strand
>          <Rle> <IRanges>  <Rle>
>   [1]     chrA  [16, 20]      *
>   ---
>   seqlengths:
>    chrA
>     100
> 
> but maybe a working example from your end would help clarify what you're 
> after / where things go wrong for you with findOverlaps.
> 
> Martin
> 
>> 
>> Thanks
>> 
>> Dan
>> 
> 
> 
> -- 
> Computational Biology
> Fred Hutchinson Cancer Research Center
> 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109
> 
> Location: M1-B861
> Telephone: 206 667-2793

-- 
**************************************************************

Daniel Brewer, Ph.D.

Institute of Cancer Research
Molecular Carcinogenesis
MUCRC
15 Cotswold Road
Sutton, Surrey SM2 5NG
United Kingdom 

Tel: +44 (0) 20 8722 4109

**************************************************************




The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the a...{{dropped:5}}



More information about the Bioconductor mailing list