|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.vamsas.objects.utils.MapList
MapList Simple way of bijectively mapping a non-contiguous linear range to another non-contiguous linear range Use at your own risk! TODO: efficient implementation of private posMap method TODO: test/ensure that sense of from and to ratio start position is conserved (codon start position recovery) TODO: optimize to use int[][] arrays rather than vectors.
Field Summary | |
java.util.Vector |
fromShifts
|
java.util.Vector |
toShifts
|
Constructor Summary | |
MapList(int[] from,
int[] to,
int fromRatio,
int toRatio)
|
|
MapList(MapList map)
|
Method Summary | |
boolean |
equals(MapList obj)
|
int |
getFromHighest()
|
int |
getFromLowest()
|
int[] |
getFromRanges()
|
int |
getFromRatio()
|
MapList |
getInverse()
|
int |
getMappedPosition(int pos)
get From position in the associated reference frame for position pos in the associated sequence. |
int[] |
getMappedWord(int pos)
|
int |
getToHighest()
|
int |
getToLowest()
|
int |
getToPosition(int mpos)
get the 'initial' position of mpos in To |
int[] |
getToRanges()
|
int |
getToRatio()
|
int[] |
getToWord(int mpos)
get range of positions in To frame for the mpos word in From |
int[] |
locateInFrom(int start,
int end)
find series of intervals mapping from start-end in the From map. |
int[] |
locateInTo(int start,
int end)
find series of intervals mapping from start-end in the to map. |
static void |
main(java.lang.String[] argv)
|
int[][] |
makeFromMap()
get all mapped positions from 'from' to 'to' |
int[][] |
makeToMap()
get all mapped positions from 'to' to 'from' |
int[] |
shiftFrom(int pos)
shift from pos to To(pos) |
int[] |
shiftTo(int pos)
inverse of shiftFrom - maps pos in To to a position in From |
static void |
testMap(MapList ml,
int fromS,
int fromE)
test routine. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public java.util.Vector fromShifts
public java.util.Vector toShifts
Constructor Detail |
public MapList(int[] from, int[] to, int fromRatio, int toRatio)
public MapList(MapList map)
Method Detail |
public boolean equals(MapList obj)
public int[] getFromRanges()
public int[] getToRanges()
public int getFromRatio()
public int getToRatio()
public int getFromLowest()
public int getFromHighest()
public int getToLowest()
public int getToHighest()
public int[][] makeFromMap()
public int[][] makeToMap()
public int[] shiftFrom(int pos)
pos
- int
public int[] shiftTo(int pos)
pos
- (in To)
public int[] locateInFrom(int start, int end)
start
- position in to mapend
- position in to map
public int[] locateInTo(int start, int end)
start
- position in from mapend
- position in from map
public int getToPosition(int mpos)
mpos
- position in from
public int[] getToWord(int mpos)
mpos
- position in From
public int getMappedPosition(int pos)
pos
-
public int[] getMappedWord(int pos)
public static void testMap(MapList ml, int fromS, int fromE)
ml
- fromS
- fromE
- public static void main(java.lang.String[] argv)
public MapList getInverse()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |