I noticed this one last week. In particular, the ignore.strands=TRUE
weirdness. It is due to the use of gaps(), which returns the entire
chromosome length for unrepresented strands. Thus, the subsequent union()
call claims the entire chromosome. Would be good to have this fixed.

Michael

On Sun, Jan 15, 2012 at 10:00 PM, Dario Strbenac
<D.Strbenac@garvan.org.au>wrote:

> Hi,
>
> setdiff doesn't work the way I thought it would when one GRanges has
> strands and the other does not. I thought that features stranded as * would
> be taken as being on both strands. The output is even stranger if I use
> ignore.strand = TRUE.
>
> > x
> GRanges with 1 range and 0 elementMetadata values:
>      seqnames    ranges strand
>         <Rle> <IRanges>  <Rle>
>  [1]     chr1    [2, 7]      +
>  ---
>  seqlengths:
>   chr1
>     NA
> > y
> GRanges with 1 range and 0 elementMetadata values:
>      seqnames    ranges strand
>         <Rle> <IRanges>  <Rle>
>  [1]     chr1   [5, 10]      *
>  ---
>  seqlengths:
>   chr1
>     NA
> > setdiff(x, y)
> GRanges with 1 range and 0 elementMetadata values:
>      seqnames    ranges strand
>         <Rle> <IRanges>  <Rle>
>  [1]     chr1    [2, 7]      +
>  ---
>  seqlengths:
>   chr1
>     NA
> > setdiff(x, y, ignore.strand = TRUE)
> GRanges with 2 ranges and 0 elementMetadata values:
>      seqnames    ranges strand
>         <Rle> <IRanges>  <Rle>
>  [1]     chr1   [1, 10]      -
>  [2]     chr1   [1, 10]      *
>  ---
>  seqlengths:
>   chr1
>     NA
>
> How do I get a result of chr1 [2, 4] + ?
>
> R version 2.14.0 (2011-10-31), GenomicRanges_1.6.4, IRanges_1.12.5
>
> --------------------------------------
> Dario Strbenac
> Research Assistant
> Cancer Epigenetics
> Garvan Institute of Medical Research
> Darlinghurst NSW 2010
> Australia
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>

	[[alternative HTML version deleted]]

