Re: org.biojava.nbio.genome.parsers.gff.Location union() and intersect() do not work as described in API

Jose Duarte <[email protected]> Wed, 16 Dec 2015 10:22:49 -0800
Newsgroups gmane.comp.java.bio.general
Message-ID <CAHhO=JE4_=PTr0CKa6VjMgeQfMkGjaLwD1_bBazHNk5MozCGcA@mail.gmail.com>
Hi Christoph

I've added this as an issue in github:
https://github.com/biojava/biojava/issues/355

As I say in there, the first issue you report does work for me. The second
I can reproduce. Let's continue the discussion over in github in any case.

Jose



On Wed, Dec 16, 2015 at 7:45 AM, Christopher Gillies <[email protected]>
wrote:

> Hi biojava,
>
> I am using version 4.1.0 and I am getting some unexpected behavior from
> the Location class.
>
> Please see the unit test below. The union operator returns 51227381 as the
> bioEnd() but it should be 51227382.
>
> Location l1 = Location.fromBio(51227320, 51227381, '+');
> Location l2 = Location.fromBio(51227323, 51227382, '+');
>
> Location union = l1.union(l2);
> assertEquals(51227320,union.bioStart());
> assertEquals(51227382,union.bioEnd());
>
>
>
>
> The documentation for the intersection method says that it will return
> null when there is no overlap for two locations, but the code appears to
> fail for boundary conditions. The following unit test fails. Shouldn’t the
> intersection method return null for this test case?
>
> Location l1 = Location.fromBio(100, 200, '+');
> Location l2 = Location.fromBio(1, 99, '+');
> Location intersection = l1.intersection(l2);
> assertNull(intersection);
>
> Thanks,
>
> Chris
> _______________________________________________
> Biojava-l mailing list  -  [email protected]
> http://mailman.open-bio.org/mailman/listinfo/biojava-l

_______________________________________________
Biojava-l mailing list  -  [email protected]
http://mailman.open-bio.org/mailman/listinfo/biojava-l