git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2576 Proposed fix
[jalview.git]
/
src
/
jalview
/
util
/
MapList.java
diff --git
a/src/jalview/util/MapList.java
b/src/jalview/util/MapList.java
index
cae968e
..
58abdc3
100644
(file)
--- a/
src/jalview/util/MapList.java
+++ b/
src/jalview/util/MapList.java
@@
-342,7
+342,8
@@
public class MapList
*/
public static List<int[]> coalesceRanges(final List<int[]> ranges)
{
*/
public static List<int[]> coalesceRanges(final List<int[]> ranges)
{
- if (ranges == null || ranges.size() < 2) {
+ if (ranges == null || ranges.size() < 2)
+ {
return ranges;
}
return ranges;
}
@@
-353,7
+354,7
@@
public class MapList
lastRange = new int[] { lastRange[0], lastRange[1] };
merged.add(lastRange);
boolean first = true;
lastRange = new int[] { lastRange[0], lastRange[1] };
merged.add(lastRange);
boolean first = true;
-
+
for (final int[] range : ranges)
{
if (first)
for (final int[] range : ranges)
{
if (first)
@@
-387,7
+388,8
@@
public class MapList
* if next range is in the same direction as last and contiguous,
* just update the end position of the last range
*/
* if next range is in the same direction as last and contiguous,
* just update the end position of the last range
*/
- boolean sameDirection = range[1] == range[0] || direction == lastDirection;
+ boolean sameDirection = range[1] == range[0]
+ || direction == lastDirection;
boolean extending = range[0] == lastRange[1] + lastDirection;
boolean overlapping = (lastDirection == 1 && range[0] >= lastRange[0] && range[0] <= lastRange[1])
|| (lastDirection == -1 && range[0] <= lastRange[0] && range[0] >= lastRange[1]);
boolean extending = range[0] == lastRange[1] + lastDirection;
boolean overlapping = (lastDirection == 1 && range[0] >= lastRange[0] && range[0] <= lastRange[1])
|| (lastDirection == -1 && range[0] <= lastRange[0] && range[0] >= lastRange[1]);
@@
-404,7
+406,7
@@
public class MapList
lastDirection = (range[1] == range[0]) ? lastDirection : direction;
}
}
lastDirection = (range[1] == range[0]) ? lastDirection : direction;
}
}
-
+
return changed ? merged : ranges;
}
return changed ? merged : ranges;
}
@@
-1103,4
+1105,14
@@
public class MapList
return forwardStrand;
}
return forwardStrand;
}
+ /**
+ *
+ * @return true if from, or to is a three to 1 mapping
+ */
+ public boolean isTripletMap()
+ {
+ return (toRatio == 3 && fromRatio == 1)
+ || (fromRatio == 3 && toRatio == 1);
+ }
+
}
}