baobab.bio.permutation
Class WeightedSignedPermutationBPGraph

java.lang.Object
  extended by baobab.bio.permutation.SignedPermutationBPGraph
      extended by baobab.bio.permutation.WeightedSignedPermutationBPGraph
All Implemented Interfaces:
PermutationBPGraph, java.lang.Comparable

public class WeightedSignedPermutationBPGraph
extends SignedPermutationBPGraph

The WeightedSignedPermutationBPGraph class represents a weighted signed permutation pair and its breakpoint graph (the WeightedSignedPermutationBPGraph class does not deal with hurdles)

Version:
1.0, May 2006
Author:
Marilia D. V. Braga

Constructor Summary
WeightedSignedPermutationBPGraph(int[] permutationList, boolean isLinear, double[] weights)
          Creates a new permutation (assumes the identity permutation as target)
WeightedSignedPermutationBPGraph(int[] permutationList, double[] weights)
          Creates a new linear permutation (assumes the identity permutation as target)
WeightedSignedPermutationBPGraph(int[] originList, int[] targetList, boolean isLinear, double[] originWeights)
          Creates a new permutation
WeightedSignedPermutationBPGraph(int[] originList, int[] targetList, double[] originWeights)
          Creates a new linear permutation
WeightedSignedPermutationBPGraph(java.util.Vector<java.lang.String> origin, java.util.Vector<java.lang.String> target, boolean isLinear, java.util.Vector<java.lang.Double> originWeights)
          Creates a new permutation
 
Method Summary
static java.util.Vector<int[]> blocksToIntArrays(java.util.Collection blocks)
          Transforms the collection of blocks to a collection of arrays of int (with length = 2)
 int compareTo(java.lang.Object object)
          Compares this block to another block
 double getAverageWeightOfInterval(int startPos, int endPos)
          Gets the average weight of an interval of the permutation
 java.util.TreeSet<BPGraphPoint> getBreakpoints()
          Gets the breakpoint list of this block
 BPGraphCycle getCycle(int number)
          Gets the list of cycles of this group of cycles
 java.util.SortedSet<BPGraphCycle> getCycles()
          Gets the list of cycles of this group of cycles
 int getNumberOfBreakpoints()
          Gets the number of breakpoints
 int getNumberOfCycles()
          Gets the number of cycles of this group of cycles
 java.util.SortedSet getOrientedCycles()
          Gets the list of oriented cycles of this group of cycles
 java.util.SortedSet<BPGraphPoint> getPoints()
          Gets all points which belong to this group of cycles
 SignedPermutationBPGraphReversalFilter getReversalFilter()
          Gets the reversal filter of this permutation
 java.util.SortedSet<BPGraphCycle> getUnorientedCycles()
          Gets the list of non-oriented cycles of this group of cycles
 double getWeightOf(java.lang.String name)
          Gets the weight of the value identified by the given name
 boolean isOriented()
          Tests whether this cycle group is oriented
 int length()
          Gets the length of the block (the number of values of the permutation between its start and end points)
 int[] toIntArray()
          Gets a representation of the block as an array of int, with size 2, representing its start and end positions
 
Methods inherited from class baobab.bio.permutation.SignedPermutationBPGraph
canCollapse, clone, collapse, containsUnorientedComponent, equals, getData, getFirstPoint, getFormatter, getIntToNamesMap, getLastPoint, getLastPointIndex, getLongestNameLength, getMappedPositions, getMappedValueAt, getMappedValues, getMappedValuesAroundPosition, getMiddleOfInterval, getMinimalReversalDistance, getNameAt, getNameOf, getNamesToIntMap, getNotCollapsed, getPermutationBPGraph, getPointAt, getPointBetweenMapped, getPositionOf, getPositionOf, getPositionOfMapped, getReversalDistance, getSignedDescription, getSignedDescriptor, getTotalWeight, getUnsignedDescription, getUnsignedDescriptor, getValueAt, getWeightMap, getWeightOfInterval, isAdjacency, isCycleBreakingReversal, isLinear, isRevertedAt, isSorted, revert, revert, revert, revertToNewPermutation, revertToNewPermutation, setDescriptor, size, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface baobab.bio.permutation.PermutationBPGraph
getNumberOfCycles
 

Constructor Detail

WeightedSignedPermutationBPGraph

public WeightedSignedPermutationBPGraph(int[] permutationList,
                                        double[] weights)
Creates a new linear permutation (assumes the identity permutation as target)

Parameters:
permutationList - the list of signed integers (from +/-1 to +/-n), as an array of int

WeightedSignedPermutationBPGraph

public WeightedSignedPermutationBPGraph(int[] permutationList,
                                        boolean isLinear,
                                        double[] weights)
Creates a new permutation (assumes the identity permutation as target)

Parameters:
permutationList - the list of signed integers (from +/-1 to +/-n), as an array of int
isLinear - indicates whether the permutation is linear or circular

WeightedSignedPermutationBPGraph

public WeightedSignedPermutationBPGraph(int[] originList,
                                        int[] targetList,
                                        double[] originWeights)
Creates a new linear permutation

Parameters:
originList - the origin list of signed integers (from +/-1 to +/-n), as an array of int
targetList - the target list of signed integers (from +/-1 to +/-n), as an array of int

WeightedSignedPermutationBPGraph

public WeightedSignedPermutationBPGraph(int[] originList,
                                        int[] targetList,
                                        boolean isLinear,
                                        double[] originWeights)
Creates a new permutation

Parameters:
originList - the origin list of signed integers (from +/-1 to +/-n), as an array of int
targetList - the target list of signed integers (from +/-1 to +/-n), as an array of int
isLinear - indicates whether the permutation is linear or circular

WeightedSignedPermutationBPGraph

public WeightedSignedPermutationBPGraph(java.util.Vector<java.lang.String> origin,
                                        java.util.Vector<java.lang.String> target,
                                        boolean isLinear,
                                        java.util.Vector<java.lang.Double> originWeights)
Creates a new permutation

Parameters:
origin - the origin list of signed markers
target - the target list of signed markers
isLinear - indicates whether the permutation is linear or circular
originWeights - the weights of the markers with respect to the origin list
Method Detail

getWeightOf

public double getWeightOf(java.lang.String name)
Description copied from class: SignedPermutationBPGraph
Gets the weight of the value identified by the given name

Overrides:
getWeightOf in class SignedPermutationBPGraph
Parameters:
name - the name of the value
Returns:
the corresponding weight

getAverageWeightOfInterval

public double getAverageWeightOfInterval(int startPos,
                                         int endPos)
Description copied from class: SignedPermutationBPGraph
Gets the average weight of an interval of the permutation

Overrides:
getAverageWeightOfInterval in class SignedPermutationBPGraph
Parameters:
startPos - the start of the interval
endPos - the end of the interval
Returns:
the average weight

getReversalFilter

public SignedPermutationBPGraphReversalFilter getReversalFilter()
Description copied from class: SignedPermutationBPGraph
Gets the reversal filter of this permutation

Overrides:
getReversalFilter in class SignedPermutationBPGraph
Returns:
the reversal filter

getBreakpoints

public java.util.TreeSet<BPGraphPoint> getBreakpoints()
Gets the breakpoint list of this block

Returns:
a Collection with the list of breakpoints (each breakpoint is represented by a Point)

getNumberOfBreakpoints

public int getNumberOfBreakpoints()
Gets the number of breakpoints

Returns:
the number of breakpoints

getNumberOfCycles

public int getNumberOfCycles()
Gets the number of cycles of this group of cycles

Returns:
the number of cycles

getCycles

public java.util.SortedSet<BPGraphCycle> getCycles()
Gets the list of cycles of this group of cycles

Returns:
a Vector with the list of cycles

getOrientedCycles

public java.util.SortedSet getOrientedCycles()
Gets the list of oriented cycles of this group of cycles

Returns:
a Vector with the list of cycles

isOriented

public boolean isOriented()
Tests whether this cycle group is oriented


getPoints

public java.util.SortedSet<BPGraphPoint> getPoints()
Gets all points which belong to this group of cycles

Returns:
a Collection with the list of points

getCycle

public BPGraphCycle getCycle(int number)
Gets the list of cycles of this group of cycles

Returns:
a Vector with the list of cycles

getUnorientedCycles

public java.util.SortedSet<BPGraphCycle> getUnorientedCycles()
Gets the list of non-oriented cycles of this group of cycles

Returns:
a Vector with the list of cycles

length

public int length()
Gets the length of the block (the number of values of the permutation between its start and end points)

Returns:
the length

toIntArray

public int[] toIntArray()
Gets a representation of the block as an array of int, with size 2, representing its start and end positions

Returns:
representation of the block as an array of int

compareTo

public int compareTo(java.lang.Object object)
Compares this block to another block

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - the other block
Returns:
the result of the comparison, as an int

blocksToIntArrays

public static java.util.Vector<int[]> blocksToIntArrays(java.util.Collection blocks)
Transforms the collection of blocks to a collection of arrays of int (with length = 2)

Parameters:
blocks - a collection of blocks
Returns:
a collection containing the blocks as arrays of int