uk.ac.vamsas.objects.utils
Class Mapping

java.lang.Object
  extended byuk.ac.vamsas.objects.utils.Mapping

public class Mapping
extends java.lang.Object


Constructor Summary
Mapping(int[] local, int[] mapped, int i, int j)
          create a new mapping from (in Jalview) param to was the destination sequence being mapped
Mapping(MapList map)
          The seuqence that map maps the associated seuqence to (if any).
Mapping(Mapping map2)
          create a duplicate (and independent) mapping object with the same reference to any SequenceI being mapped to.
 
Method Summary
 boolean equals(Mapping other)
          Equals that compares both the to references and MapList mappings.
 MapList getMap()
           
 int getMappedPosition(int pos)
          get mapped position in the associated reference frame for position pos in the associated sequence.
 int getMappedWidth()
          width of unit in mapped reference frame
 int[] getMappedWord(int pos)
           
 int getPosition(int mpos)
          get the 'initial' position in the associated sequence for a position in the mapped reference frame
 int getWidth()
          width of mapped unit in associated sequence
 int[] getWord(int mpos)
          gets boundary in direction of mapping
 Mapping intersectVisContigs(int[] viscontigs)
          return a new mapping object with a maplist modifed to only map the visible regions defined by viscontigs.
 int[] locateFeature(int begin, int end)
          locates the region of feature f in the associated (local) sequence's reference frame
 int[] locateMappedRange(int from, int to)
          return a series of mapped contigs mapped from a range on the associated sequence
 int[] locateRange(int from, int to)
          return a series of contigs on the associated sequence corresponding to the from,to interval on the mapped reference frame
static void main(java.lang.String[] args)
           
 void setMap(MapList map)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mapping

public Mapping(MapList map)
The seuqence that map maps the associated seuqence to (if any). SequenceI to = null;


Mapping

public Mapping(int[] local,
               int[] mapped,
               int i,
               int j)
create a new mapping from (in Jalview) param to was the destination sequence being mapped

Parameters:
local - int[] {start,end,start,end} series on associated sequence
mapped - int[] {start,end,...} ranges on the reference frame being mapped to
i - step size on associated sequence
j - step size on mapped frame

Mapping

public Mapping(Mapping map2)
create a duplicate (and independent) mapping object with the same reference to any SequenceI being mapped to.

Parameters:
map2 -
Method Detail

getMap

public MapList getMap()
Returns:
the map

setMap

public void setMap(MapList map)
Parameters:
map - the map to set

equals

public boolean equals(Mapping other)
Equals that compares both the to references and MapList mappings.

Parameters:
other -
Returns:

getPosition

public int getPosition(int mpos)
get the 'initial' position in the associated sequence for a position in the mapped reference frame

Parameters:
mpos -
Returns:

getWord

public int[] getWord(int mpos)
gets boundary in direction of mapping

Returns:
int{start, end} positions in associated sequence (in direction of mapped word)

getWidth

public int getWidth()
width of mapped unit in associated sequence


getMappedWidth

public int getMappedWidth()
width of unit in mapped reference frame

Returns:

getMappedPosition

public int getMappedPosition(int pos)
get mapped position in the associated reference frame for position pos in the associated sequence.

Parameters:
pos -
Returns:

getMappedWord

public int[] getMappedWord(int pos)

locateFeature

public int[] locateFeature(int begin,
                           int end)
locates the region of feature f in the associated (local) sequence's reference frame

Returns:
int[] { start1, end1, ... starti, endi } for the corresponding interval in local reference frame

locateRange

public int[] locateRange(int from,
                         int to)
return a series of contigs on the associated sequence corresponding to the from,to interval on the mapped reference frame

Parameters:
from -
to -
Returns:
int[] { from_i, to_i for i=1 to n contiguous regions in the associated sequence}

locateMappedRange

public int[] locateMappedRange(int from,
                               int to)
return a series of mapped contigs mapped from a range on the associated sequence

Parameters:
from -
to -
Returns:

intersectVisContigs

public Mapping intersectVisContigs(int[] viscontigs)
return a new mapping object with a maplist modifed to only map the visible regions defined by viscontigs.

Parameters:
viscontigs -
Returns:

main

public static void main(java.lang.String[] args)