- }
- // from and to ranges must end up being a series of start/end intervals
- if (fromrange.size() % 2 == 1)
- {
- throw new InvalidGFF3FieldException(attr, set,
- "Couldn't parse the DNA alignment range correctly");
- }
- if (torange.size() % 2 == 1)
- {
- throw new InvalidGFF3FieldException(attr, set,
- "Couldn't parse the protein alignment range correctly");
- }
- // finally, build the map
- int[] frommap = new int[fromrange.size()], tomap = new int[torange
- .size()];
- int p = 0;
- for (Integer ip : fromrange)
- {
- frommap[p++] = ip.intValue();
- }
- p = 0;
- for (Integer ip : torange)
- {
- tomap[p++] = ip.intValue();
- }
-
- return new MapList(frommap, tomap, 3, 1);
- }