[Biojava-l] org.biojava.nbio.genome.parsers.gff.Location union() and intersect() do not work as described in API

Jose Duarte jose.duarte at rcsb.org
Wed Dec 16 18:22:49 UTC 2015


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 <cgillies at umich.edu>
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  -  Biojava-l at mailman.open-bio.org
> http://mailman.open-bio.org/mailman/listinfo/biojava-l
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biojava-l/attachments/20151216/bbdb9571/attachment.html>


More information about the Biojava-l mailing list