baobab.bio.permutation
Class ComplexSignedPermutationBPGraph

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

public class ComplexSignedPermutationBPGraph
extends SignedPermutationBPGraph

The ComplexSignedPermutationBPGraph class represents a signed permutation pair and its breakpoint graph (the ComplexSignedPermutationBPGraph class deals with hurdles)

Author:
Marilia D. V. Braga

Constructor Summary
ComplexSignedPermutationBPGraph(int[] permutationList)
          Creates a new linear permutation (assumes the identity permutation as target)
ComplexSignedPermutationBPGraph(int[] permutationList, boolean isLinear)
          Creates a new permutation (assumes the identity permutation as target)
ComplexSignedPermutationBPGraph(int[] permutationList, boolean isLinear, double[] weightList)
          Creates a new permutation (assumes the identity permutation as target)
ComplexSignedPermutationBPGraph(int[] permutationList, double[] weightList)
          Creates a new linear permutation (assumes the identity permutation as target)
ComplexSignedPermutationBPGraph(int[] originList, int[] targetList)
          Creates a new linear permutation
ComplexSignedPermutationBPGraph(int[] originList, int[] targetList, boolean isLinear)
          Creates a new permutation
ComplexSignedPermutationBPGraph(int[] originList, int[] targetList, boolean isLinear, double[] weightList)
          Creates a new permutation
ComplexSignedPermutationBPGraph(int[] originList, int[] targetList, double[] weightList)
          Creates a new linear permutation
ComplexSignedPermutationBPGraph(SignedPermutationBPGraph other)
          Creates a complex signed permutation over a simple signed permutation
ComplexSignedPermutationBPGraph(java.util.Vector<java.lang.String> origin, java.util.Vector<java.lang.String> target, boolean isLinear, java.util.Vector<java.lang.Double> weights)
          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)
 java.lang.Object clone()
           
 int compareTo(java.lang.Object object)
          Compares this block to another block
 java.util.TreeSet<ComplexSignedPermutationBPGraph> decompose()
          Decompose this graph in its components + adajacencies to replace other components
 boolean equals(ComplexSignedPermutationBPGraph perm)
           
 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
 java.lang.String getData()
           
 int getNumberOfAdjacencies()
          Gets the number of adjacencies of the permutation
 int getNumberOfBreakpoints()
          Gets the number of breakpoints
 int getNumberOfComponents()
          Gets the number of components of the permutation
 int getNumberOfCycles()
          Gets the number of cycles of this group of cycles
 int getNumberOfHurdles()
          Gets the number of hurdles of the permutation
 int getNumberOfOrientedComponents()
          Gets the number of oriented components of the permutation
 int getNumberOfSuperHurdles()
          Gets the number of super hurdles of the permutation
 int getNumberOfUnorientedComponents()
          Gets the number of non-oriented components of the permutation
 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
 int getReversalDistance()
          Gets the reversal distance of this permutation
 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
 boolean isFortress()
          Tests whether this permutation is a fortress
 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)
 SignedPermutationBPGraph revert(BPGraphPoint start, BPGraphPoint end)
          Reverts the permutation between the specified points
 SignedPermutationBPGraph revert(BPGraphReversalBlock block)
          Reverts the specified block of the permutation
 SignedPermutationBPGraph revert(int start, int end)
          Reverts the permutation between the specified positions
 SignedPermutationBPGraph revertToNewPermutation(BPGraphPoint start, BPGraphPoint end)
          Make a new permutation, by reverting the permutation between the specified positions
 int[] toIntArray()
          Gets a representation of the block as an array of int, with size 2, representing its start and end positions
 java.lang.String toString()
           
 
Methods inherited from class baobab.bio.permutation.SignedPermutationBPGraph
canCollapse, collapse, containsUnorientedComponent, equals, getAverageWeightOfInterval, getFirstPoint, getFormatter, getIntToNamesMap, getLastPoint, getLastPointIndex, getLongestNameLength, getMappedPositions, getMappedValueAt, getMappedValues, getMappedValuesAroundPosition, getMiddleOfInterval, getMinimalReversalDistance, getNameAt, getNameOf, getNamesToIntMap, getNotCollapsed, getPermutationBPGraph, getPointAt, getPointBetweenMapped, getPositionOf, getPositionOf, getPositionOfMapped, getSignedDescription, getSignedDescriptor, getTotalWeight, getUnsignedDescription, getUnsignedDescriptor, getValueAt, getWeightMap, getWeightOf, getWeightOfInterval, isAdjacency, isCycleBreakingReversal, isLinear, isRevertedAt, isSorted, revertToNewPermutation, setDescriptor, size
 
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

ComplexSignedPermutationBPGraph

public ComplexSignedPermutationBPGraph(SignedPermutationBPGraph other)
Creates a complex signed permutation over a simple signed permutation

Parameters:
other - the simple signed permutation

ComplexSignedPermutationBPGraph

public ComplexSignedPermutationBPGraph(int[] permutationList)
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

ComplexSignedPermutationBPGraph

public ComplexSignedPermutationBPGraph(int[] permutationList,
                                       double[] weightList)
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

ComplexSignedPermutationBPGraph

public ComplexSignedPermutationBPGraph(int[] permutationList,
                                       boolean isLinear)
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

ComplexSignedPermutationBPGraph

public ComplexSignedPermutationBPGraph(int[] permutationList,
                                       boolean isLinear,
                                       double[] weightList)
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

ComplexSignedPermutationBPGraph

public ComplexSignedPermutationBPGraph(int[] originList,
                                       int[] targetList)
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

ComplexSignedPermutationBPGraph

public ComplexSignedPermutationBPGraph(int[] originList,
                                       int[] targetList,
                                       double[] weightList)
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

ComplexSignedPermutationBPGraph

public ComplexSignedPermutationBPGraph(int[] originList,
                                       int[] targetList,
                                       boolean isLinear)
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

ComplexSignedPermutationBPGraph

public ComplexSignedPermutationBPGraph(int[] originList,
                                       int[] targetList,
                                       boolean isLinear,
                                       double[] weightList)
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

ComplexSignedPermutationBPGraph

public ComplexSignedPermutationBPGraph(java.util.Vector<java.lang.String> origin,
                                       java.util.Vector<java.lang.String> target,
                                       boolean isLinear,
                                       java.util.Vector<java.lang.Double> weights)
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
weights - the
Method Detail

getReversalDistance

public int getReversalDistance()
Description copied from class: SignedPermutationBPGraph
Gets the reversal distance of this permutation

Overrides:
getReversalDistance in class SignedPermutationBPGraph
Returns:
the reversal distance

getNumberOfComponents

public int getNumberOfComponents()
Gets the number of components of the permutation

Returns:
the number of components of the permutation

getNumberOfAdjacencies

public int getNumberOfAdjacencies()
Gets the number of adjacencies of the permutation

Returns:
the number of adjacencies of the permutation

getNumberOfUnorientedComponents

public int getNumberOfUnorientedComponents()
Gets the number of non-oriented components of the permutation

Returns:
the number of non-oriented components of the permutation

getNumberOfOrientedComponents

public int getNumberOfOrientedComponents()
Gets the number of oriented components of the permutation

Returns:
the number of oriented components of the permutation

getNumberOfHurdles

public int getNumberOfHurdles()
Gets the number of hurdles of the permutation

Returns:
the number of hurdles of the permutation

getNumberOfSuperHurdles

public int getNumberOfSuperHurdles()
Gets the number of super hurdles of the permutation

Returns:
the number of super hurdles of the permutation

decompose

public java.util.TreeSet<ComplexSignedPermutationBPGraph> decompose()
Decompose this graph in its components + adajacencies to replace other components


revert

public SignedPermutationBPGraph revert(BPGraphReversalBlock block)
                                throws PermutationException
Reverts the specified block of the permutation

Overrides:
revert in class SignedPermutationBPGraph
Parameters:
block - the block to be reverted
Returns:
the resulting Permutation, after performing the reversion
Throws:
PermutationException

revert

public SignedPermutationBPGraph revert(BPGraphPoint start,
                                       BPGraphPoint end)
                                throws PermutationException
Reverts the permutation between the specified points

Overrides:
revert in class SignedPermutationBPGraph
Parameters:
start - the beginning of the reversion block
end - the end of the reversion block
Returns:
the resulting Permutation, after performing the reversion
Throws:
PermutationException

revert

public SignedPermutationBPGraph revert(int start,
                                       int end)
Reverts the permutation between the specified positions

Overrides:
revert in class SignedPermutationBPGraph
Parameters:
start - the beginning of the reversion block
end - the end of the reversion block
Returns:
the resulting Permutation, after performing the reversion

revertToNewPermutation

public SignedPermutationBPGraph revertToNewPermutation(BPGraphPoint start,
                                                       BPGraphPoint end)
                                                throws PermutationException
Make a new permutation, by reverting the permutation between the specified positions

Overrides:
revertToNewPermutation in class SignedPermutationBPGraph
Parameters:
start - the beginning of the reversion block
end - the end of the reversion block
Returns:
the resulting permutation, after performing the reversion
Throws:
PermutationException

isFortress

public boolean isFortress()
Tests whether this permutation is a fortress

Returns:
true / false

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

clone

public java.lang.Object clone()
Overrides:
clone in class SignedPermutationBPGraph

equals

public boolean equals(ComplexSignedPermutationBPGraph perm)

toString

public java.lang.String toString()
Overrides:
toString in class SignedPermutationBPGraph

getData

public java.lang.String getData()
Overrides:
getData in class SignedPermutationBPGraph

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