[Biojava-l] order of circular and compound location

Yasumasa Shigemoto yshigemo at genes.nig.ac.jp
Fri Apr 11 11:23:45 EDT 2003


Hi,

I am using CircularLocation and LocationTools.union(Location a, Location b).
I would like to build a compound location including CircularLocation
but the order of sublocation seems to miss in this case.

The details are as folllows.

A sample program
---
import org.biojava.bio.symbol.*;
import java.util.*;

public class CircularTest2 {
        public static void main(String[] args) throws Exception {
                CircularLocation[] locs = new CircularLocation[3];
                locs[0] = LocationTools.makeCircularLocation(13,14,20);
                locs[1] = LocationTools.makeCircularLocation(18,4,20);
                locs[2] = (CircularLocation)LocationTools.union(locs[0], locs[1]
);
                System.out.println(locs[2].toString());
                for(Iterator it = locs[2].blockIterator(); it.hasNext();) {
                        System.out.println(((Location)it.next()).toString());
                }
        }
}
---

Result
---
1, 20 {([1,4]), ([13,14]), ([18,20])}  (circular)
[1,4]
[13,14]
[18,20]
---

I would like to get a sublocation [13,14] at first.
How do I get a correct order in this case?
Does anyone have any suggestion?

Regards,
Yasumasa Shigemoto



More information about the Biojava-l mailing list