[Biojava-dev] Location overlaps() bug?

Willis,Scooter Scooter.Willis at SanfordHealth.org
Fri Oct 4 20:28:35 UTC 2013


Graham

The challenge here is what is in the start and where is the end. In
looking at the code it appears the intent is that the End position is not
part of the strand. I suspect this is following the definition of GFF for
start and end. This is the same challenger of starting at 0 or 1.

For loc1 really contains 12-14 and loc2 contains 15-19 so they do not
overlap.

In the code the length is defined as end - start so for (12,15) would be 3
and not inclusive of 15.

Scooter Willis

Director of Computational Bioinformatics

Edith Sanford Breast Cancer Research


-----------------------------------------------------------------------

Confidentiality Notice: This e-mail message, including any attachments, is
for the sole use of the intended recipient(s) and may contain privileged
and confidential information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of the original
message.



On 12/14/12 4:52 AM, "graham etherington (TSL)"
<graham.etherington at sainsbury-laboratory.ac.uk> wrote:

>Hi,
>I've discovered a problem with the overlaps() method in
>org.biojava3.genome.parsers.gff.Location.
>It appears that if LocationA overlaps LocationB by 1 nucleotide,
>overlaps() returns false instead of true.
>
>
>Here is the code to replicate it
>
>public static void main(String[] args)
>    {
>        Location loc1 = new Location(12, 15);
>        Location loc2 = new Location(15, 20);
>        if (loc1.overlaps(loc2))
>        {
>            System.out.println("Loc1 overlaps Loc2");
>        }
>        else
>        {
>            System.out.println("No overlap found");
>        }
>    }
>
>BioJava version 3.0.5
>    OS OSX 10.6.8
>
>
>Cheers,
>Graham
>
>
>
>
>Dr. Graham Etherington
>Bioinformatics Support Officer,
>The Sainsbury Laboratory,
>Norwich Research Park,
>Norwich NR4 7UH.
>UK
>Tel: +44 (0)1603 450601
>
>
>
>
>_______________________________________________
>biojava-dev mailing list
>biojava-dev at lists.open-bio.org
>http://lists.open-bio.org/mailman/listinfo/biojava-dev
>

-----------------------------------------------------------------------
Confidentiality Notice: This e-mail message, including any attachments,
is for the sole use of the intended recipient(s) and may contain
privileged and confidential information.  Any unauthorized review, use,
disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply e-mail and destroy
all copies of the original message.





More information about the biojava-dev mailing list