[BioC] bug in pintersect in GenomicRanges

Kasper Daniel Hansen kasperdanielhansen at gmail.com
Mon Nov 12 17:58:35 CET 2012


Well, I am surprised by the zero width IRanges with start and end.
The choice of start = 5 and end = 4 is - as far as I can see -
completely arbitrary.  I also don't like the fact that start() and
end() just reports 5 and 4 - I could see myself making mistakes in my
code, because I believe I assume start <= end.

But perhaps this is because it is now allowed to have zero-width IRanges?

Kasper


On Mon, Nov 12, 2012 at 6:20 AM, Vincent Carey
<stvjc at channing.harvard.edu> wrote:
> does this contradict the doc in some way?  the second range of your result
> has width zero, which i think is correct.
>
> On Sun, Nov 11, 2012 at 12:16 PM, Kasper Daniel Hansen
> <kasperdanielhansen at gmail.com> wrote:
>>
>> Example
>>
>> library(GenomicRanges)
>> gr1 = GRanges(seqnames = c("chr1", "chr1"), ranges = IRanges(start =
>> c(1,5), width = 7))
>> gr2 = GRanges(seqnames = "chr1", ranges = IRanges(start = 1, end = 4))
>> pintersect(gr1, rep(gr2, 2))
>>
>> GRanges with 2 ranges and 0 metadata columns:
>>       seqnames    ranges strand
>>          <Rle> <IRanges>  <Rle>
>>   [1]     chr1    [1, 4]      *
>>   [2]     chr1    [5, 4]      *
>>   ---
>>   seqlengths:
>>    chr1
>>      NA
>>
>> The second element in the return GRanges should be empty.  I would
>> therefore expect that the return length of the pintersect would have
>> length 1, despite the fact that the first object has length 2.
>>
>> Kasper
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives:
>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>
>



More information about the Bioconductor mailing list